grafana / grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
https://grafana.com
GNU Affero General Public License v3.0
60.95k stars 11.63k forks source link

Dashboards/Templating: Label Value query works when picking a datasource but not when repeating rows by datasource. #87997

Open Jaypers opened 2 weeks ago

Jaypers commented 2 weeks ago

What happened?

When using a label_value() query across repeated rows the respective datasource isn't used. It seems to use the default datasource instead.

This might be similar to https://github.com/grafana/grafana/issues/58558

What did you expect to happen?

I expected to see label_value() data from each of the repeated datasources.

Did this work before?

I don't know but it seems like it should intuitively work this way.

How do we reproduce it?

  1. Create a new dashboard.
  2. Add a Prometheus datasource variable
    • it should result in 2 or more datasources (for repeating later)
    • make sure to enable the “Include All option”

image image

  1. Add a Label Value dashboard variable. Choose a label that:

    • results in a single value per datasource
    • and results in a unique value per datasource.
    • e.g. label_value(grafana_environment_info,app.kubernetes.io/name) image image
  2. Note: When selecting a different data source the value for the Label Value is updated as expected: image

  3. Create a row that repeats per datasource: image

  4. Add a text visualisation to the repeated row that uses the Label Value variable: image

  5. Selecting one or the other datasource reflects correctly: image

  6. Selecting all with repeat does not: image

Is the bug inside a dashboard panel?

No.

Environment (with versions)?

Grafana: Grafana v10.4.1 (d94d597d84) OS: Kubernetes 1.29 Browser: Chrome

Grafana platform?

Kubernetes

Datasource(s)?

Prometheus