Hacker News new | ask | show | jobs
by foxylion 3189 days ago
You would expose a counter with the total request count. Summing those up across all nodes known by Prometheus will give you the total amount of requests currently visible to monitoring. With "rate()" you could calculate the requests/second.

But yes it is possible to miss some requests if a node goes down without Prometheus collecting the latest stats.

But as the parent said, if you need such totals it might be better to store them persistently. Also I do not know a scenario where the total number of requests will trigger an alert.

1 comments

> But yes it is possible to miss some requests if a node goes down without Prometheus collecting the latest stats.

The rate() function allows for this, you'll get the right answer on average.