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

Global organization variables do not translate to a value in queries #24390

Closed
josemoreno opened this issue May 7, 2020 · 1 comment
Closed

Comments

@josemoreno
Copy link

josemoreno commented May 7, 2020

What happened:
When using $__org or $__org.name in the queries to Prometheus, neither the organization ID nor the organization name appears in the query.

Query:

query

Query inspector:

query_inspector

Prometheus log:

prom_log

As it can be seen, the variable $__org.name is never substituted by the organization name and arrives as $__org.name to Prometheus. It is also happening with $__org variable. No matter if I use curly braces (${__org.name}), I don't get the value in Prometheus. Besides, it is also happening when trying to define a new dashboard variable using one of the organization variables.

What you expected to happen:
Get the organization name in the query, instead of the name of the variable

How to reproduce it (as minimally and precisely as possible):
Use $__org or $__org.name in a query

Anything else we need to know?:
Might be related to #23841

Environment:

  • Grafana version: v6.7.3 (a04ef6c)
  • Data source type & version: Prometheus 2.16.0
  • OS Grafana is installed on: Ubuntu 18.04.3 LTS
  • User OS & Browser: Windows server 2012, Chrome
  • Grafana plugins: None

Thanks!!

@dprokop dprokop added the needs investigation for unconfirmed bugs. use type/bug for confirmed bugs, even if they "need" more investigating label May 8, 2020
@Estrax Estrax removed the needs investigation for unconfirmed bugs. use type/bug for confirmed bugs, even if they "need" more investigating label May 15, 2020
@Estrax
Copy link

Estrax commented May 15, 2020

@josemoreno thank you for reporting. To get the organization name you have to use ${__org.name} while you used it without curly braces. I'll leave there a link to the docs: https://grafana.com/docs/grafana/latest/variables/global-variables/#global-variables so you can read more about it (though I am sure you already did!).
As for the problem with variables evaluation itself, it seems to be the same issue as described in #23841, so I'll close this one and then follow up in that issue.

@Estrax Estrax closed this as completed May 15, 2020
Observability (deprecated, use Observability Squad) automation moved this from Backlog bugs and chores to Done May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants