user1064504
user1064504

Reputation: 593

Stats total count decreases on increasing the date range for prom counter

I have a simple prom counter linked to stats visualization, with total as a reducer function. The total count however decreases when I increase the date range.

12 hour total

24 hour total

I must be missing something.

Upvotes: 0

Views: 734

Answers (2)

You're using the "rate" function. Accordingly with the Prometheus documentation:

rate()

rate(v range-vector) calculates the per-second average rate of increase of the time series in the range vector.

Increasing your data range will not always increase your per-second average rate.

Change the "rate" function to the "increase" one.

For more details see Prometheus documentation here.

Upvotes: 1

user1064504
user1064504

Reputation: 593

I changed the query to

increase(http_server_requests_seconds_count{uri="/api/otp.send", status="200", outcome="SUCCESS"}[$__interval])

The total count came out correctly.

Upvotes: 0

Related Questions