Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Jaypers opened this issue May 16, 2024 · 1 comment

Comments

@Jaypers
Copy link

Jaypers commented May 16, 2024

What happened?

When using the label_value() query as a dashboard variable across repeated rows the respective datasource isn't used inside each row. Instead it uses first Value Label returned from all datasources in alphabetical order.

What did you expect to happen?

I expected to see label_value() data only from the datasource for its row.
This query should be limited to its own datasource/row rather than all datasources on a page.

Did this work before?

I don't think so 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 (d94d597)
OS: Kubernetes 1.29
Browser: Chrome

Grafana platform?

Kubernetes

Datasource(s)?

Prometheus

@Jaypers Jaypers changed the title Dashboards: Label value query works when picking a datasource but not when repeating rows by datasource. Dashboards/Templating: Label value query works when picking a datasource but not when repeating rows by datasource. May 16, 2024
@Jaypers Jaypers changed the title Dashboards/Templating: Label value query works when picking a datasource but not when repeating rows by datasource. Dashboards/Templating: Label Value query works when picking a datasource but not when repeating rows by datasource. May 16, 2024
@Jaypers
Copy link
Author

Jaypers commented Jun 5, 2024

Am I missing something?
Is there a better way to return label_value() per datasource/row in a dashboard?
Should I log a feature request instead?

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

No branches or pull requests

1 participant