Skip to content

feat(monitoring): enable the image renderer for panel checks - #5193

Merged
dan-petty merged 3 commits into
mainfrom
feat/5185-grafana-image-renderer
Nov 12, 2026
Merged

dan-petty merged 3 commits into
mainfrom
feat/5185-grafana-image-renderer

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Enable the image renderer of the grafana chart, so the render API, the MCP tool get_panel_image and alert images get a PNG of a panel. The image is grafana/grafana-image-renderer:v5.12.11 with IfNotPresent, requests of 100m CPU and 512Mi, limits of 2 CPUs and 1536Mi, GOMEMLIMIT=192MiB and the ingress NetworkPolicy of the chart. The chart points Grafana at the renderer Service. No Ingress routes to it.

The token comes from Secret monitoring/grafana-image-renderer, a new row of the cluster Secret table, because the chart's own Secret gets a new random token at each helm template, which Argo CD runs. k8s/README.md documents the renderer and the render check in the light and the dark theme.

Closes #5185

Change: openspec/changes/archive/2026-11-12-5185-grafana-image-renderer/

Grafana had no image renderer, so the render API returned HTTP 500
and no agent could render a panel in the light and the dark theme.

- Enable imageRenderer of the grafana chart at v5.12.11 with
  IfNotPresent, CPU and memory requests and limits, GOMEMLIMIT and
  the ingress NetworkPolicy of the chart. The chart points Grafana at
  the renderer Service and adds no Ingress.
- Take the renderer token from Secret monitoring/grafana-image-renderer,
  a new row of the cluster Secret table, because the chart's own
  Secret gets a new random token at each helm template.
- Document the renderer and the render check in k8s/README.md.

Refs #5185
@dan-petty dan-petty added type/feature Type feature: a new function scope/monitoring Grafana, Prometheus, Loki, alerts and dashboards labels Nov 12, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Proof

helm template grafana <grafana-community/grafana 14.4.1> --namespace monitoring --skip-tests -f k8s/monitoring/grafana-values.yaml:

  • Objects of the renderer: Deployment grafana-image-renderer, Service grafana-image-renderer (ClusterIP, port 8081), NetworkPolicy grafana-image-renderer-ingress (port 8081 from the Grafana pods only). No chart Secret. No Ingress.
  • Renderer container: docker.io/grafana/grafana-image-renderer:v5.12.11, IfNotPresent, requests cpu: 100m, memory: 512Mi, limits cpu: "2", memory: 1536Mi, env GOMEMLIMIT=192MiB, AUTH_TOKEN from secretKeyRef grafana-image-renderer/token, automountServiceAccountToken: false, no nodeSelector and no affinity, read-only root file system, all capabilities dropped.
  • Grafana container: GF_RENDERING_SERVER_URL=http://grafana-image-renderer.monitoring:8081/render, GF_RENDERING_CALLBACK_URL=http://grafana.monitoring:80/, GF_RENDERING_RENDERER_TOKEN from secretKeyRef grafana-image-renderer/token.

uv run devops k8s image-pins: each of the 40 pinned images resolves; the renderer tag resolves to sha256:cfa6c8f63e…, the index digest of v5.12.11 on Docker Hub.

Local measurement (Grafana 13.3.1 and the renderer v5.12.11 in containers, the security context of the chart, the limits of this pull request): 10 renders in a row of panel 11 of devops-cli-telemetry, light and dark, each 200 image/png in 4 s to 7 s, 370 MiB at most. 3 renders at one time and one render of the 55 panels of the dashboard: 897 MiB at most (58 % of the limit), no OOM kill.

Scoped checks: 1072 tests of the k8s, Secret table, Renovate and monitoring files pass; devops ci --check --only lint,format,docs and devops openspec check pass.

Pending steps

  1. Before the merge (a person): push the token Secret from this branch: uv run devops k8s push-secrets --only monitoring/grafana-image-renderer. The Grafana pod (Recreate strategy) does not start without the Secret, so a merge before the push stops Grafana until the push.
  2. After the sync: render panel 11 of devops-cli-telemetry with theme=light and with theme=dark (get_panel_image, or the commands of k8s/README.md, section Grafana Image Renderer). Each must give a PNG.
  3. After the sync: render 10 panels in a row and check that max_over_time(container_memory_working_set_bytes{namespace="monitoring", container="grafana-image-renderer"}[30m]) / (1536 * 1024 * 1024) stays below 0.8.
  4. After the sync: check that Argo CD shows the app grafana Synced and Healthy.

Bandit B105 reads a constant with "TOKEN" in its name as a hard-coded
password. The value is the name of a keyring entry, so the constant
takes the *_AUTH_KEY form of the other keyring-only keys.

Refs #5185
@dan-petty
dan-petty force-pushed the feat/5185-grafana-image-renderer branch from bf08855 to e91bb17 Compare November 12, 2026 19:19
@dan-petty
dan-petty marked this pull request as ready for review November 12, 2026 19:27
@dan-petty
dan-petty merged commit e413c40 into main Nov 12, 2026
24 checks passed
@dan-petty
dan-petty deleted the feat/5185-grafana-image-renderer branch November 12, 2026 19:42
@dan-petty

Copy link
Copy Markdown
Owner Author

Post-merge checks, 2026-11-12:

  • Grafana was down from about 19:42Z to 20:07Z. Argo CD synced the merge before the Secret monitoring/grafana-image-renderer existed, and both pods stopped in CreateContainerConfigError. After devops k8s push-secrets --only monitoring/grafana-image-renderer, both pods started with no restart.
  • Argo CD app grafana: Synced and Healthy. Grafana 2/2, renderer 1/1.
  • Render of panel 64 of devops-cli-telemetry (24 h): a PNG in theme=light and in theme=dark.
  • Renderer memory: 15 MiB at rest against the limit of 1536 MiB. The check over 10 renders in Prometheus waits for the series of the new pod.

dan-petty pushed a commit that referenced this pull request Nov 12, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.123.0](v0.122.0...v0.123.0)
(2026-11-12)


### Features

* **infra:** plan a playbook of an infra repo in check mode
([#5196](#5196))
([050a6ef](050a6ef))
* **monitoring:** enable the image renderer for panel checks
([#5193](#5193))
([e413c40](e413c40))


### Bug Fixes

* **monitoring:** make the GitHub and command panels readable
([#5194](#5194))
([e99810e](e99810e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/monitoring Grafana, Prometheus, Loki, alerts and dashboards type/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(grafana): enable the image renderer for panel checks

1 participant