Metrics
As we said before, metrics are about the big picture of our system. When you do monitoring, you want to keep track of things in absolute numbers or averages over time. For example, is your CPU consumption at a sane level over time? How much time is it taking your API endpoints to reply on average? How well or not are you leveraging the cache?
There are multiple tools and services that you can use to add metrics to your application, but the most popular one is Prometheus. Prometheus is a robust, open source monitoring and alerting toolkit widely used for collecting metrics. So, whenever you want to add metrics to your application, it is probably one of the first names you will find.
Before adding metrics to your application, you need to understand the kind of data that you are collecting and the format it will be in. There are three main formats—counters, gauges, and histograms:
- A counter is a number that only goes up and represents a total value,...