Prometheus Breadcrumbs 1

Hello all,

It has been a while since the last knowledge breadcrumb. I've been busy with life in general, and I want to come back with this type of content as it's short and valuable. This week we are going to start with a series about Prometheus, specifically for today, we are going to explain the different types of metrics you can find in Prometheus and what are they used for.

  1. Counter: This type of metrics is used to know how many times something happened. It can go only up and is used for stuff like total requests, number of exceptions and stuff like that.

  2. Gauge: Very similar to the counter, but it can go up and down, it represents the current value of something. It's used for CPU or memory available.

  3. Histogram: In a nutshell how big or long something is. With this type of metric, you define groups of observations or buckets, and then for every value received, it's allocated to one of those buckets. This is used for stuff like response time or request size, you could have 3 buckets for response time:

    • One for times below one second
    • One for times below half second
    • One for times below 0.2 seconds

    Like this you can easily see the distribution of response times. One important note, buckets are cumulative, this means that values that fall under times below half second also fall for the bucket under one second.

  4. Summary: Same as histogram but you don't define groups ahead of time. The groups are quantiles. You can check the percentage of response times that fell below certain threshold.

And that's it. As always my knowledge breadcrumbs are short and easy to understand. If you want to stay tuned with Backend and DevOps stuff, feel free to follow me and if you feel extra generous please give some love to the post by commenting on it or reacting.

Prometheus Breadcrumbs 1 - Javier Guzman