Devendra
Devendra

Reputation: 305

Grafana showing no data points when variable filter set to "All"

I am using grafana v5.4.0 with Prometheus as a data source to monitor my application's API calls.

I have created "Request Count" (spring-boot graph) and configured 2 of my applications to monitor API's.

In Graph Setting --> variable --> type = Custom --> Added 2 application names, also I checked "Include all options" checkbox

But when on the graph I select "All", I get no data points

my metric query is as follows,

irate(http_server_requests_seconds_count{application="$application"}[5m])

But when I select individual application name from a variable filter, It shows proper data only when I select "All" the message comes "No data point"

Can anyone suggest some solutions?

Thanks

Upvotes: 1

Views: 2163

Answers (1)

Nasta
Nasta

Reputation: 929

Turns out I ran into a similar issue, and I found out that using variables makes grafana add extra escape characters into the label strings.

When inspecting the PromSQL query I found out that extra %5C were added to special characters for example.

There is a way to ignore them in the query without modifying the variables, as @Devendra mentioned in his comment:

You need to replace

your_metric_name{labelname="$variable_name"}

by

your_metric_name{labelname=~"$variable_name"}

The tilde will make sure that the PromSQL query ignores escape characters.

Upvotes: 2

Related Questions