Project: Grafana (Observability and Analysis / Observability)
File: images-in-notifications.md

aliases: ../manage-notifications/images-in-notifications/ # /docs/grafana/<GRAFANA_VERSION>/alerting/manage-notifications/images-in-notifications/ canonical: https://grafana.com/docs/grafana/latest/alerting/configure-notifications/template-notifications/images-in-notifications/ description: Use images in notifications to help users better understand why alerts are firing or have been resolved keywords: grafana alerting images notifications labels: products: cloud enterprise oss title: Use images in notifications weight: 500 {{% admonition type="note" %}} Grafana Cloud users can request this feature by . {{% /admonition %}} Images in notifications helps recipients of alert notifications better understand why an alert has fired or resolved by including a screenshot of the panel associated with the alert. {{% admonition type="note" %}} This feature is not supported in Mimir or Loki, or when Grafana is configured to send alerts to other Alertmanagers such as the Prometheus Alertmanager. {{% /admonition %}} When an alert is fired or resolved Grafana takes a screenshot of the panel associated with the alert. This is determined via the Dashboard UID and Panel ID annotations of the rule. Grafana cannot take a screenshot for alerts that are not associated with a panel. Grafana takes at most two screenshots for each alert: once when the alert fires and again when the alert is resolved. Screenshots are not re-taken over the lifetime of the alert, instead you should open the panel in Grafana to follow the data in real time. In addition, depending on how alerts are grouped in your notification policies, Grafana might send a notification with many screenshots of the same panel. This happens because Grafana does not know how your alerts are grouped at the time a screenshot is taken, and so acts conservatively by taking a screenshot for every alert. Once a screenshot has been taken Grafana can either upload it to a cloud storage service such as Amazon S3, Azure Blob Storage or Google Cloud Storage; upload the screenshot to it's internal web server; or upload it to the service that is receiving the notification, such as Slack. Which option you should choose depends on how your Grafana is managed and which integrations you use. More information on this can be found in Requirements. Refer to the table at the end of this page for a list of contact points and their support for images in notifications. To use images in notifications, Grafana must be set up to use image rendering. You can either install the image rendering plugin or run it as a remote rendering service. When a screenshot is taken it is saved to the folder, even if Grafana is configured to upload screenshots to a cloud storage service. Grafana must have write-access to this folder otherwise screenshots cannot be saved to disk and an error will be logged for each failed screenshot attempt. You should use a cloud storage service unless sending alerts to Discord, Email, Pushover, Slack or

These integrations support either embedding screenshots in the email or attaching screenshots to the notification, while other integrations must link screenshots uploaded to a cloud storage bucket. If a cloud storage service has been configured then integrations that support both will link screenshots from the cloud storage bucket instead of embedding or attaching screenshots to the notification. If uploading screenshots to a cloud storage service such as Amazon S3, Azure Blob Storage or Google Cloud Storage; and accessing screenshots in the bucket requires authentication, logging into a VPN or corporate network; then image previews might not work in all instant messaging and communication platforms as some services rewrite URLs to use their CDN. If this happens we recommend using or altogether. When uploading screenshots to a cloud storage service Grafana uses a random 20 character (30 characters for Azure Blob Storage) filename for each image. This makes URLs hard to guess but not impossible. Grafana does not delete screenshots from cloud storage. We recommend configuring a retention policy with your cloud storage service to delete screenshots older than 1 month. If Grafana is configured to upload screenshots to its internal web server, and accessing Grafana requires logging into a VPN or corporate network; image previews might not work in all instant messaging and communication platforms as some services rewrite URLs to use their CDN. If this happens we recommend using or altogether. Grafana does not delete screenshots uploaded to its internal web server. To delete screenshots from `staticrootpath/images/attachments` after a certain amount of time we recommend setting up a CRON job. {{% admonition type="note" %}} Grafana Cloud users can request this feature by . {{% /admonition %}} Having installed either the image rendering plugin, or set up Grafana to use a remote rendering service, set `capture` in `[unified_alerting.screenshots]` to `true`: capture = false If screenshots should be uploaded to cloud storage then `uploadexternalimage_storage` should also be set to `true`: uploadexternalimage_storage = false Restart Grafana for the changes to take effect. We recommended that `maxconcurrentscreenshots` is less than or equal to `concurrentrenderrequestlimit`. The default value for both `maxconcurrentscreenshots` and `concurrentrenderrequestlimit` is `5`: maxconcurrentscreenshots = 5 Grafana supports a wide range of contact points with varied support for images in notifications. The table below shows the list of all contact points supported in Grafana and their support for uploading screenshots to the receiving service and referencing screenshots that have been uploaded to a cloud storage

| Name | Upload from disk | Reference from cloud storage | | -- | - | -- | | DingDing | No | No | | Discord | Yes (Maximum of 10 per notification) | Yes (Maximum of 10 per notification) | | Email | Yes (Embedded in the email) | Yes | | Google Chat | No | Yes | | Kafka | No | No | | Line | No | No | | Microsoft Teams | No | Yes | | Opsgenie | No | Yes | | Pagerduty | No | Yes | | Prometheus Alertmanager | No | No | | Pushover | Yes (Maximum of 1 per notification) | No | | Sensu Go | No | No | | Slack | Yes (when using Bot tokens, maximum of 5 per notification) | Yes (when using webhooks, maximum of 1 per notification) | | Telegram | Yes | No | | Threema | No | No | | VictorOps | No | No | | Webhook | No | Yes | This feature is not supported in Mimir or Loki, or when Grafana is configured to send alerts to other Alertmanagers such as the Prometheus Alertmanager. A number of contact points support at most one image per notification. In this case, just the first image is either uploaded to the receiving service or referenced from cloud storage per notification. When multiple alerts are sent in a single notification a screenshot might be included for each alert. The order the images are shown is random. If uploading screenshots to a cloud storage service such as Amazon S3, Azure Blob Storage or Google Cloud Storage; and accessing screenshots in the bucket requires authentication, logging into a VPN or corporate network; image previews might not work in all instant messaging and communication platforms as some services rewrite URLs to use their CDN. If Grafana has been set up to send images in notifications, however notifications are still being received without them, follow the troubleshooting steps below: Check that images in notifications has been set up as per the instructions. Enable debug logging in Grafana and look for logs with the logger `ngalert.image`. If the alert is not associated with a dashboard there will be logs for `Cannot take screenshot for alert rule as it is not associated with a dashboard`. If the alert is associated with a dashboard, but no panel in the dashboard, there will be logs for `Cannot take screenshot for alert rule as it is not associated with a panel`. If images cannot be taken because of mis-configuration or an issue with image rendering there will be logs for `Failed to take an image` including the Dashboard UID, Panel ID, and the error message. Check that the contact point supports images in notifications and whether it supports uploading images to the receiving service or referencing images that have been uploaded to a cloud storage service. Grafana provides the following metrics to observe the performance and failure rate of images in notifications. For example, if a screenshot could not be taken within the expected time (10 seconds) then the counter `grafanascreenshotfailures_total` is updated. `grafanaalertingimagecachehits_total` `grafanaalertingimagecachemisses_total` `grafanascreenshotduration_seconds` `grafanascreenshotfailures_total` `grafanascreenshotsuccesses_total` `grafanascreenshotuploadfailurestotal` `grafanascreenshotuploadsuccessestotal`