what the caculation rule of increase function.

11 views
Skip to first unread message

何吉林

unread,
Aug 27, 2020, 6:14:18 AM8/27/20
to Prometheus Users
dear all, i have a question.
firstly, the scrape time interval is 2m(only one instance). and I use range queries(HTTP API) with increase(metric_name[1m]) and step is 20s.
with my knowledge, I think I will get zero in the time range, because the range duration is 1m and is smaller than 2m. the range-vector(metric_name[1m]) only have a datapoint or nothing.in actual, I get some value which is not zero.

Brian Candler

unread,
Aug 27, 2020, 8:36:29 AM8/27/20
to Prometheus Users
You can prove whether or not there are multiple data points in the 1m window by looking at the raw samples.

In the UI: go to the PromQL expression browser in the web interface, select "Console" tab, and enter

metric_name{instance="foo"}[1m]

as the query.  It will show you the raw stored samples, with exact stored timestamps.

In this example, my scrape interval is 15 seconds:



You can do this via the API too.  I think you send a normal query (rather than a range query), but with a range vector as the PromQL expression.
Reply all
Reply to author
Forward
0 new messages