Configuring Grafana Image Renderer

Grafana ships with the Grafana server. For scenarios were you must use store images from dashboards for alerting or reports, enable the Grafana-Image-Renderer Plugin.

To enable the plugin, see the configuration steps in Grafana Documentation, the Grafana Helm Chart.

Relevant YAML configuation
grafana:
  imageRenderer:
    enabled: true
    # resources:    {} # Set resource limits for image-renderer pods {}
    # nodeSelector: {} # Node labels for pod assignment {}
    # tolerations:  [] # Toleration labels for pod assignment []
    # affinity:     {} # Affinity settings for pod assignment {}
    # extraConfigmapMounts: []	# Additional image-renderer configMap volume mounts (values are templated)	[]
    # extraSecretMounts:    []	# Additional image-renderer secret volume mounts	[]
    # extraVolumeMounts:    []	# Additional image-renderer volume mounts	[]
    # extraVolumes:         []	# Additional image-renderer volumes	[]
    # serviceAccountName:   ""	# image-renderer deployment serviceAccountName ""

Server Requirements

Grafana creates browser instances in the background for the actual rendering. Depending on how many concurrent images are being created this could cause performance problems if the Pod is running on the same machines as the Kloudfuse cluster.

To avoid this, it is recommended that you create a node to only run the image renderer. There are several advantages to this, . The machine required to run this Pod is signficantly smaller than one required for the Kfuse Cluster . It will prevent a heavy workload on the image renderer from impacting other processes on the machine . The node can be secured seperately from the rest of the cluster. In particular with writing files to public accessible cloud storage.

For system requirements, Grafana recommended a minimum of 16GB with more required for a higher workload.

Configuring the Pod

  1. To begin configuring the pod, see the Grafana Documentation on Set Up Image Rendering.

  2. While the image renders, the the system temporarily writes the PNG image to the file system. After completion, the PNG image appears in the png folder in the Grafana data folder, and then the system removes it — a background job runs every 10 minutes and removes temporary images. You can configure how long the system stores the image using the temp_data_lifetime setting.

Documentation on https://grafana.com/docs/grafana/latest/setup-grafana/configure-grafana/#unified_alertingscreenshots[configuring screenshts can be found here]
This may be necessary if many images are being renderered at the same time.

[[images]]
== Using Images in Alerts

Grafana documentation https://grafana.com/docs/grafana/latest/alerting/configure-notifications/template-notifications/images-in-notifications/#use-images-in-notifications[can be found here]

Consider these requirements:

[%interactive]
* [ ] To use images in notifications, Grafana must be set up to use image rendering.
* [ ] When a screenshot is taken, it is saved to the [data][paths] folder, even if Grafana is configured to upload screenshots to a cloud storage service.
* [ ] You should use a cloud storage service unless sending alerts to Discord, email, Pushover, Slack or Telegram.
* [ ] Image previews might not work in all instant messaging and communication platforms as some services rewrite URLs to use their CDN.
* [ ] When uploading screenshots to a cloud storage service Grafana uses a random filename for each image.
* [ ] Grafana does not delete screenshots from cloud storage. You need to use a storage policy
* [ ] Grafana does not delete screenshots uploaded to its internal web server.