Files
vectorize-io__hindsight/monitoring/grafana/dashboards
Nick Old 7083fd7909 fix(monitoring): make Grafana dashboards importable on older Grafana (#3972)
The three bundled dashboards used save-model shapes that only exist in
Grafana >= 8.3: an object datasource ref ({"type", "uid"}) and the
Prometheus variable-editor query object ({"query", "refId"}). Grafana's
DashboardMigrator only ever migrates up, so on an older instance
(reproduced on 7.5.17) both objects are handed to templateSrv.replace(),
which calls target.replace() and throws "e.replace is not a function".
The templating error aborts variable init and leaves every panel empty.

Switch to the string forms, which modern Grafana still accepts and
migrates at runtime:

- "datasource": "$datasource" on every panel plus a datasource template
  variable ("query": "prometheus", "current": {}), so any Prometheus
  datasource is auto-selected. This also drops the hardcoded
  "uid": "prometheus", which only exists in the grafana/otel-lgtm image
  used by scripts/dev/monitoring and made the dashboards unusable
  elsewhere ("Datasource prometheus was not found").
- the tenant variable keeps the legacy string query label_values(...).

${DS_PROMETHEUS} + __inputs was rejected because file provisioning does
not substitute inputs, and "datasource": null because otel-lgtm marks no
datasource as isDefault.

Fixes #3968
2026-09-01 10:50:15 +02:00
..