Reputation: 593
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.
I must be missing something.
Upvotes: 0
Views: 734
Reputation: 22371
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
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