Choosing instrumentation type

Prometheus supports four major metric types. We can make a choice between counters, gauges, summaries, and histograms. We will see them in action soon. For now, we'll limit the discussion to a brief overview of each.

A counter can only go up. We cannot decrease its value. It is useful for accumulating values. An example would be errors. Each error in the system should increase the counter by one.

Unlike counters, gauge values can go both up and down. A good example of a gauge is memory usage. It can increase, only to decrease a few moments later.

Histograms and summaries are more complex types. They are often used to measure durationĀ of requests and sizes of responses. They track both summaries and counts. When those two are combined, we can measure averages over time. Their data is usually placed in buckets that form quantiles.

We'll go deeper into each of the metric types through practical examples starting with a counter as the simplest of all. But, before we do that, we need to create a cluster that will serve as our playground.