-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Full Prometheus query support in label_values function #12715
Comments
Github is mainly for features and bug reports, but as you've already created a topic on the community site I'll answer here. The label_values function is something specific for Grafana (not prometheus) and we have no plans at the moment to extend that to support full queries. Use the query_result(query) instead and extract the values using regex. We recently merged #12597 which will be released in Grafana v5.3. I think that may be the missing point which enables you to do for example: This variable returns the busiest 5 request instances based on average QPS over the time range shown in the dashboard.
Make sure to set the variable's |
Duplicate of #11047 |
Please include this information:
What Grafana version are you using?
5.2.1
What datasource are you using?
MariaDB
What OS are you running grafana on?
CentOS 7.4
What did you do?
Attempted to use a valid Prometheus query as the first argument to the label_values function
What was the expected result?
Correct population of variable.
What happened instead?
Received the following error:
Template variables could not be initialized: parse error at char 1: vector selector must contain label matchers or metric name
I asked this question on the community page a week ago but didn't get a response. You can see this here: https://community.grafana.com/t/full-query-support-when-creating-variable/8906.
As stated in the ticket, I don't understand why I can't use a full and proper query as the first argument to label_values. Both the first and second example in the ticket should theoretically produce identical output, and this would be really handy.
The text was updated successfully, but these errors were encountered: