In a data reliability platform, dashboards are not just for visualization.
They often need to be captured and stored as artifacts for reporting, monitoring, and downstream usage.
Typical requirements include:
This leads to the need for:
Automating Grafana dashboard rendering as images (PNG)
The objective of this implementation was:
ETL Pipeline → Data Warehouse → Grafana Dashboard
↑
Render API (Script)
↓
Grafana Image Renderer (Docker)
↓
PNG Image Files
↓
Report / Slack / Storage
The key design:
Grafana and Renderer are separated as independent components
Grafana image rendering is not a simple API call.
It requires Headless Chrome (Chromium) execution.
This introduces several issues:
Environment standardization
→ Same behavior across local and production
Dependency isolation
→ No need to install Chromium manually
Service separation
→ Renderer runs independently from Grafana
Operational stability
→ Easy restart and recovery
failed to render: net::ERR_CONNECTION_REFUSED
Invalid API key
Problem:
Solution:
glsa_...)Initial setup:
http://host.docker.internal:3000
→ Not accessible from container
Solution:
http://<host-ip>:3000
→ Works correctly
Problem:
→ Leads to inconsistent results
→ Requires explicit conversion
date -d "2026-02-23 00:00:00 UTC" +%s
date -d "2026-03-09 23:59:59 UTC" +%s
Convert to milliseconds before passing to API.
#!/usr/bin/env bash
set -euo pipefail
GRAFANA_URL="${1:-http://127.0.0.1:3000}"
TOKEN="${2:-}"
DASH_UID="${3:-}"
OUT_DIR="${4:-./grafana_captures}"
FROM="${5:-now-14d}"
TO="${6:-now}"
ORG_ID="${ORG_ID:-1}"
TZ_NAME="${TZ_NAME:-Asia/Seoul}"
mkdir -p "$OUT_DIR"
curl -sS \
-H "Authorization: Bearer $TOKEN" \
"$GRAFANA_URL/api/dashboards/uid/$DASH_UID" > "$OUT_DIR/meta.json"
PANEL_IDS=$(jq -r '.. | objects | select(has("id")) | .id' "$OUT_DIR/meta.json")
for PANEL_ID in $PANEL_IDS; do
URL="$GRAFANA_URL/render/d-solo/$DASH_UID/_?panelId=$PANEL_ID&from=$FROM&to=$TO&tz=$TZ_NAME"
curl -sS -L \
-H "Authorization: Bearer $TOKEN" \
-o "$OUT_DIR/panel_${PANEL_ID}.png" "$URL"
done
High risk of mistakes
from=2026-02-23T09:00:00
to=2026-03-10T08:59:59
var-profile_id=…
Missing variables → “No data”
curl http://<host-ip>:3000
Grafana UI and Render API do not behave the same
Key differences:
This is not just an automation task.
It is about:
Ensuring that visualized results are reproducible and trustworthy
Pipeline perspective:
The renderer becomes:
The final step of data reliability
With this setup, the following became possible: