Skip to content

fix(chart): make Grafana dashboard datasource portable#46

Merged
ynsta merged 1 commit into
mainfrom
chart/dashboard-datasource-var
May 20, 2026
Merged

fix(chart): make Grafana dashboard datasource portable#46
ynsta merged 1 commit into
mainfrom
chart/dashboard-datasource-var

Conversation

@ynsta

@ynsta ynsta commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

The bundled Grafana dashboard hard-coded datasource.uid: prometheus, so
it only rendered on clusters whose Prometheus data source happened to be
named prometheus. This patch adds a datasource template variable
(type datasource, query prometheus) and rewrites every panel target
plus the existing instance query to reference ${datasource}.

Chart bump 1.9.0 → 1.9.1. No values changes; upgrade is in-place.

See CHANGELOG.mdChart / 1.9.1.

Test plan

  • helm lint charts/s3proxy
  • jq empty charts/s3proxy/dashboards/s3proxy.json
  • Render emits chart: s3proxy-1.9.1 and the new template var:
    helm template t charts/s3proxy \
      --set grafanaDashboard.enabled=true \
      --set grafanaDashboard.folder=s3proxy \
      --show-only templates/grafana-dashboard.yaml
    
    Expect a templating.list entry with "name": "datasource",
    "type": "datasource", "query": "prometheus", and every panel
    target carrying "datasource": {"type": "prometheus", "uid": "${datasource}"}.
  • Apply against a real Grafana instance whose Prometheus DS is not
    named prometheus; confirm the dashboard renders and the data source
    picker is populated.
  • CI green on chart/dashboard-datasource-var.

Release flow

Merge → tag chart-v1.9.1 on main → CI publishes
ghcr.io/intrinsec/s3proxy/charts/s3proxy:1.9.1.

🤖 Generated with Claude Code

Hard-coded `uid: prometheus` only worked on clusters whose Prometheus
data source happened to be named `prometheus`. Replace it with a
`datasource` template variable (type `datasource`, query `prometheus`)
so the dashboard binds to whichever Prometheus the target Grafana
exposes. Every panel target and the `instance` query now reference
`${datasource}`.

Chart bump 1.9.0 -> 1.9.1.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ynsta ynsta merged commit 92be92d into main May 20, 2026
5 checks passed
@ynsta ynsta deleted the chart/dashboard-datasource-var branch May 20, 2026 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant