mirror of
https://github.com/vectorize-io/hindsight.git
synced 2026-09-14 19:31:49 +08:00
7083fd7909
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