Prometheus query using variables from grafana templates having spaces doesn't work

12 views
Skip to first unread message

Debashish Ghosh

unread,
Jul 6, 2020, 11:01:44 AM7/6/20
to Prometheus Users
Hi,
   I have created a grafana template varaible to extract names of organizations from Prometheus db using query 
label_values(custom_message_volume_endpoint_organization_total,Organization).

This yields organization names that have spaces in some cases .. For example
OrgA
OrgB product1
OrgC product2

I use the following query to extract the timeseries corresponding to an organization..
custom_latency_endpoint_organization_total{job="MyJob",Organization=~"$Organization"}

It only works when I select the variable value OrgA but doesn't work for the other 2 . Apparently any organization name having space is discarded.
Is there a workaround to get around this ?

Thanks
Debashish

sayf eddine Hammemi

unread,
Jul 6, 2020, 11:15:43 AM7/6/20
to Debashish Ghosh, Prometheus Users
Hello, did you try strict equality instead of regex?

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/c0fe6136-8ce4-4309-8516-0826cc3f12fbo%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages