Grafanaで特定条件時に通知を送信することができますが、その通知にグラフの画像を添付することが可能です。
今回はその方法を紹介します。
![alert-sample](https://i0.wp.com/developers-trash.com/wp-content/uploads/2022/01/alert-sample.png?resize=456%2C406&ssl=1)
環境
- CentOS7
- Grafana 7.2.2
画像を添付する設定
アラート通知時に画像を添付するための設定は簡単で Alerting → Notification channel でチャンネル一覧を表示します。
一覧から画像を添付したいNotification channelを選択し、 Notification settings の Include image にチェックを入れSaveで保存するだけです。これで文字だけではなく視覚的にアラート内容を把握することができます。
![alert-setting](https://i0.wp.com/developers-trash.com/wp-content/uploads/2022/01/alert-setting.png?resize=529%2C676&ssl=1)
エラー画像が添付される場合
アラート通知で画像が添付されるようになっても以下のようなエラー画像となってしまう場合があります。
No image renderer available/installed
For Grafana to be able to generate an image you
need to install the Grafana Image Renderer plugin.
Please contact your Grafana administrator
to install the plugin.
![alert-plugin-not-install-image](https://i0.wp.com/developers-trash.com/wp-content/uploads/2022/01/alert-plugin-not-install-image.png?resize=409%2C141&ssl=1)
この場合はプラグインをインストールする必要があるので以下の手順を実施してください。
- Plugins で image renderer と検索し、該当のプラグインをインストール
- Grafanaサーバを再起動
systemctl restart grafana-server
以上です。
コメント