Grafana 9 Alert Migrations: legacy alert screenshot settings aren't automatically migrated to new alerts

Hi :grafana: users!

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:

Configuring images in new grafana alerts:

First, enable image rendering if it isn’t already!

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

Restart Grafana for the changes to take effect.

Happy Alerting! :bell:


Nice to hear (read) that it is possible.

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?

Thanks in advance!

@robone how are you building your docker image and what is the environment variable you’re trying to use?

@robone tried this out and was able to enable the flag with:

docker run -d --name=grafana9 -p 3000:3000 -e "GF_UNIFIED_ALERTING_SCREENSHOTS_CAPTURE=true" grafana/grafana