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.
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
- What is observability, and how is it different from traditional monitoring? [Basic]
- What are the three pillars of observability (metrics, logs, traces)? [Basic]
- What is the difference between monitoring and observability in practice? [Basic]
- What are the four golden signals of monitoring? [Basic]
- What is the difference between the USE method and the RED method? [Basic]
- When would you use the USE method versus the RED method? [Basic]
- What is an SLI, an SLO, and an SLA, and how do they relate? [Basic]
- How do you choose good SLIs for a service? [Basic]