How to use wildcard in query: label_values

I have below labels in prometheus, how to create wildcard query for label_values while templating
some like “query”: “label_values(application_*Count_Total,xyx)”


Newwbie to Grafana :frowning:

I do something similar for regions in my data set. My SQL query includes a WHERE clause like so:
… AND application LIKE ‘BMSI_TAF_[[Region]]’ …

The dashboard defines the variables with a SELECT DISTINCT query on the data set to gather the possible values (e.g. BMSI_TAF_BC, BMSI_TAF_AB, etc.), and a regex to isolate the varying part of the value:

With this setup, the region variable contains values such as BC, AB, etc., and the queries respect the selected region.

Your regex might look something like:

With MySQL datasource in Query Editor, we can write SQL queries, like “select * from …” I dont see the same option with Prometheus datasource, am I missing something or I need to install a plugin ?
Using Grafana v6.5.2

Apologies, I missed that you said you were working with Prometheus. I don’t have experience with that tool. My example was from working with a PostgreSQL/TimescaleDB data source.

I got by templating a variable with
“name”: “operation”,
“query”: “metrics(application_get.*Count_total)”,
“regex”: “/application_get(.*)Count_total/”,

and in a graph with
expr": “application_get${operation}Count_total”