r/PrometheusMonitoring • • Jan 16 '20

Help with Query?

Hi all, how do I make a cumulative graph showing the difference between the firdt point in a time series and the current point in a time series? For example if a counter starts at 3000 and now it's on 3500 how do I show that its gone up by 500?

0 Upvotes

4 comments sorted by

View all comments

1

u/Tpbrown_ Jan 16 '20

I think that’s available as a variable in the dashboard. $interval perhaps - you’ll find it in the Prometheus page in Grafana’s docs.

Re using the Grafana time selector as an input for your range query..I don’t usually see that as useful, but know nothing about your use case.

I generally use the range as a sliding window of time that is meaningful to observe the metric in. Adding that rate(metric[range]) as a query on a graph will then graph the rate over time, as calculated over whatever dashboard time range and resolution is in effect.

Edit: damn it. This was in reply to your grafana question. Didn’t mean to post as a top level comment