JuniorObservability

What are the main metric types (counter, gauge, histogram), and when do you use each?

What they are really testing: Whether you know the Prometheus metric types and, importantly, that latency needs a histogram to compute percentiles. Picking the wrong type gives misleading data.

A real interview question

What are the main metric types (counter, gauge, histogram), and when do you use each?

What most people say

drag me

You use counters to count things and gauges for values; metrics are just numbers over time.

It misses histograms entirely, which is how you measure latency percentiles. Tracking latency as a gauge or average hides the tail (p99) that actually reflects user pain.

The follow-ups they ask next

  • Why do you need a histogram for latency rather than an average?

    Averages hide the tail. A histogram lets you compute p95/p99 across instances, which reflects the worst user experiences. Two services with the same average can have wildly different p99s.

  • What is the limitation of a summary compared to a histogram?

    Summary quantiles are computed client-side and cannot be aggregated across instances, so you cannot get a meaningful fleet-wide p99. Histograms bucket the data and aggregate server-side.

What the interviewer is listening for

  • Counter (up-only, rate it), gauge (up/down), histogram (buckets)
  • Knows histograms give percentiles for latency
  • Knows summary cannot aggregate across instances

What sinks the answer

  • No histogram / no percentiles
  • Tracks latency as an average
  • Cannot distinguish counter from gauge

If you genuinely do not know

Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.

Counter [only goes up (total requests/errors), rate() it]. Gauge [goes up and down (memory, queue depth), a snapshot]. Histogram [buckets observations like durations so you compute p95/p99 aggregated across instances, the tool for latency]. Summary [computes quantiles client-side but cannot aggregate across instances]. Never track [latency as an average].

Keep going with observability

All 336 cloud engineer questions

Knowing the answer is not the same as recalling it under pressure

Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.

Start free