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: Grafana shows datasource UID instead of name in legend #78949

Closed
dmitriishaburov opened this issue Dec 1, 2023 · 5 comments
Closed
Assignees

Comments

@dmitriishaburov
Copy link

dmitriishaburov commented Dec 1, 2023

What happened?

We're using datasource variable in dashboard, and putting it into legend in some panels.
Before it was rendering datasource name picked via dropdown.
After update to 10.1.0 and later it's rendering datasource UID instead.

What did you expect to happen?

Panel legend that's using ${datasource} should render datasource name instead of UID

Did this work before?

Yes, last version is 10.0.9

How do we reproduce it?

  1. Create datasource kind variable in dashboard, i.e. named datasource
  2. Put it into legent in panel, i.e. ${datasource} - usage
  3. Datasource will be shown as UID instead of name in dropdown.
    image

Is the bug inside a dashboard panel?

No response

Environment (with versions)?

Grafana: 10.2.2
OS: Windows 11
Browser: Chrome

Grafana platform?

Kubernetes

Datasource(s)?

No response

@baldm0mma baldm0mma self-assigned this Feb 20, 2024
@adela-almasan
Copy link
Contributor

Hi @dmitriishaburov, thank you for submitting this issue. Could you please provide the (correct) last working version? Thanks!

@dmitriishaburov
Copy link
Author

@adela-almasan sorry, last working version was 10.0.9, not 10.9.0 😄

@baldm0mma
Copy link
Contributor

baldm0mma commented Feb 21, 2024

Hey @dmitriishaburov , this was an intentional change, and can be reflected in the "breaking changes" category of our CHANGELOG for 10.1.0 (2023-08-22), and was created in this PR: #69259.

From the above CHANGELOG:

"The data source template variable type has changed the way it represents its options. The text field still represents the data source name, but the value has been changed to the uid of the data source. This allows dashboards to declare the currently selected option by uid, however it changes how a datasource template variable value will be rendered by default. If the name of the data source is expected, the variable syntax will have to be changed to specify the text format."

In other words, if you try ${datasourceVariable:text} instead of ${datasourceVariable}, I believe that should solve the issue.

@dmitriishaburov
Copy link
Author

Oh, sorry, will pay more attention to that changelog instead of what's new in Grafana X 😢
Thanks for explanation

@baldm0mma
Copy link
Contributor

Oh, sorry, will pay more attention to that changelog instead of what's new in Grafana X 😢 Thanks for explanation

No worries. There's a lot of new features and changes all the time; it's even hard for us to keep track! ☺️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants