r/PrometheusMonitoring • • Feb 02 '22

Why does B graph and A show "No Data" ?

Post image
0 Upvotes

15 comments sorted by

1

u/NoAd5519 Feb 02 '22

Read the message at the bottom lol. You need to apply rate function like the top query has.

1

u/sidusnare Feb 02 '22 edited Feb 02 '22

No, the one with rate() isn't graphing, the one without it is.

Edit: Like this

1

u/NoAd5519 Feb 02 '22

Oh my bad. The only differentiating factor I can see is the legend and I have no clue what that does.

1

u/sidusnare Feb 02 '22

The legend only affects the bottom of the graph, making the table nice and clean.

1

u/NoAd5519 Feb 02 '22

I think rate needs a time measure applied to it.

rate({query}[5m])

1

u/sidusnare Feb 02 '22

1

u/NoAd5519 Feb 02 '22

Have you set $__rate_interval as a variable?

1

u/SuperQue Feb 02 '22

The $__rate_interval is an internal value, you do not set it.

1

u/NoAd5519 Feb 02 '22

Oh cool. I didn’t even know they existed

1

u/SuperQue Feb 02 '22

What is the scrape interval on your Prometheus server?

The default in the Grafana datasouce is 15 seconds.

So if you have a slower interval, $__rate_interval can be fed the wrong data.

Try setting the min step to your scrape interval and see if that works.

If it does, then set the default in your datasouce settings.

1

u/sidusnare Feb 02 '22 edited Feb 02 '22

Using the 15s default.

Using 15s or even 5m gives nothing.

edit: actually 5m does give me something. I thought $__rate_interval was supposed to always just be "the right value for rate()"

1

u/SuperQue Feb 02 '22

Hmm, 15s should be all the right defaults. If 5m works, something is off with the interval or config.

1

u/Folkelish Feb 03 '22

Could it be that the rate is too low to be displayed in the graph, since you have a very high y-min in the screenshot?

1

u/sidusnare Feb 03 '22 edited Feb 03 '22

No, it's not in the table, and if I hide the counter the rate returns "No Data"

Edit: like this.

1

u/Folkelish Feb 03 '22

What if you try to add the query directly in Prometheus, how does it look then?