3 ms·
How do you handle aggregated metrics, e.g. request count? What does the instance (either server/container) expose at localhost:9001/metrics?
by boto3 9y ago
How do you handle aggregated metrics, e.g. request count? What does the instance (either server/container) expose at localhost:9001/metrics?
- jalk 9y agoThe same way push based systems do it. Prom. scrapes the individual metrics off each instance and provides aggr. functions in the query lang.
- foxylion 9y agoYou 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.
- bbrazil 9y ago> 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.