Graphic slow counters with Prometheus and grafanoy

We sum(rate(my_counter_total[1m])) )) fast counters with a sum(rate(my_counter_total[1m])) )) or sum(irate(my_counter_total[20s])) . Where the second is preferable if you can always expect a change in the last few seconds.

But how to make the schedule of slow counter when you only have a few increments every couple of minutes or even hours? With values ​​such as 0.0013232 / s, it is not very convenient for people.

Let's say I want to represent, how many users are registered in our service (we expect a couple of logs per hour). What is a reasonable request?

Currently, we use the following to display it in grafane:

  • Inquiry: 3600 * sum(rate(signup_total[1h])) ]))
  • Step: 3600
  • Resolution: 1/1

Slow counter setup

It is reasonable?

I'm still trying to understand how all these parameters play together, to draw a graph. Can anyone explain how a selector band ( [10m] ), the function rate() and irate() , setting Step and Resolution in grafane affect each other?

+7
source share
1 answer

This is the right way to do it. You can also use increase() , which is syntactic sugar for rate() this way.

Can anyone explain how a range selector

It is used only Prometheus and specifies what data will work.

Parameters Step and Resolution in grafane affect each other?

It is used on the side of Grafana, it affects the number of time slots that it will ask for Prometheus.

These settings do not directly affect one another. However, the resolution must be less than the range, or you'll get bugs and miss information.

+2
source

All Articles