Grafana 9 adds support for images to grafana alerts! This is a feature that legacy alerting had - but it’s new for unified grafana alerting. That said, we want to point out that if you’re migrating from legacy alerting - there are a few configuration steps to add images in new alerts. These settings aren’t migrated from the legacy alerting section of your configuration file.
A short list of helpful docs to review for managing and configuring migrated grafana alerts:
If Grafana has been set up to use image rendering images in notifications can be turned on via the capture option in [unified_alerting.screenshots]:
# Enable screenshots in notifications. This option requires a remote HTTP image rendering service. Please
# see [rendering] for further configuration options.
capture = true
It is recommended that max_concurrent_screenshots is set to a value that is less than or equal to concurrent_render_request_limit. The default value for both max_concurrent_screenshots and concurrent_render_request_limit is 5:
# The maximum number of screenshots that can be taken at the same time. This option is different from
# concurrent_render_request_limit as max_concurrent_screenshots sets the number of concurrent screenshots
# that can be taken at the same time for all firing alerts where as concurrent_render_request_limit sets
# the total number of concurrent screenshots across all Grafana services.
max_concurrent_screenshots = 5
If Grafana has been set up to use an external image store, upload_external_image_storage should be set to true:
# Uploads screenshots to the local Grafana server or remote storage such as Azure, S3 and GCS. Please
# see [external_image_storage] for further configuration options. If this option is false, screenshots
# will be persisted to disk for up to temp_data_lifetime.
upload_external_image_storage = false
Unfortunetly I still can’t do it. I have Grafana and the renderer launched in a docker-compose.yml file and the option “[unified_alerting.screenshots]” does not appear in the grafana.ini file, so I cannot change it from enviornment variables of the docker-compose file. I have already set to true the variable “unified_alertin_enabled” and clustered mode for “…image_renderer_rendering_mode”. I’m missing something?
By the way, once running, should appear any option to select for doing the snapshot in the alert?
Hi @melori.arellano . Sorry for the delay, I had holiday. I’ve tried your instruction (in a new container) but didn’t work either, basically I cannot find that “send capture” option. Should the option be at the “contact point” window?. Here is my docker-compose conf:
It states that: Unlike legacy dashboard alerts where images in notifications are enabled per contact point, images in notifications for Grafana Alerting must be enabled in the Grafana configuration, either in the configuration file or environment variables, and are enabled for either all or no contact points. Please refer to the documentation for images in notifications.
For the moment, I’m still not able to send those screenshots.
Grafana does not support images for alert rules that are not associated with a panel. An alert rule is associated with a panel when it has both Dashboard UID and Panel ID annotations.
For example, this alert is associated with a panel:
Well my objective is send images trough slack, but this still is not working, is there any example of implementation? Here is the ENV variables that I am using :
Double check that the port you are using for the renderer it is the one matching in your variables. It was an error of mine. (Both services deployed in Docker).
@ndt1092 this option was added in grafana 9. If your grafana.ini file doesn’t already include it, you can add the settings. I’d recommend making a copy of your existing config file before making any changes.
Many thanks, I have more questions, about the alert, can “value” minimize it?, Alert received with too much content in “value”. Value: [ var=‘B0’ metric=‘systemStateMemoryDeviceStatusCombined{hostname=“IdracDell-HN”, instance=“ip address”, job=“Idrac_DELL”, systemStatechassisIndex=“1”}’ labels={name=systemStateMemoryDeviceStatusCombined, hostname=IdracDell-HN, instance=ip address, job=Idrac_DELL, systemStatechassisIndex=1} value=4 ]