Interview Observability

What are the Prometheus metric types (counter, gauge, histogram, summary)? [Basic]

Answer

The main Prometheus metric types are counter, gauge, histogram, and summary. Counters only increase, gauges go up and down, histograms bucket observations, and summaries calculate quantiles on the client side.

Technical explanation

Counters fit totals such as requests, errors, retries, and bytes processed.

Gauges fit current values such as memory usage, queue depth, in-flight requests, and temperature.

Histograms and summaries are used for distributions such as latency or payload size, with histograms generally preferred when server-side aggregation is needed.

Hands-on example

Instrumentation example: create http_requests_total as a counter, in_flight_requests as a gauge, and http_request_duration_seconds as a histogram with buckets matching SLO thresholds such as 0.1, 0.25, 0.5, 1, and 2.5 seconds.

Preparing for an interview?

Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.

More Observability interview questions

← All Observability questions