All jobs / DevOps / SRE / cloud / Observability
DevOps / SRE / cloud interview question · 0–1 years
When do you use a metric instead of a log line?
The strongest answer
When I need a number over time I can alert on — rate, latency, errors — logs are for the story of one request
Why it works
Exactly. Metrics for the pulse, logs for the story. Grepping numbers is how you miss the page.
What a good answer covers
- Metrics: pulse and alerts.
- Logs: one request’s story.
- Do not grep a rate.
- You usually want both.
Answers that fall short
- Close, but not the strongest: Always logs; metrics are a luxury
Logs without a pulse are a haystack. - Weak: Always metrics; logs are legacy
Logs still explain the one request. - Red flag: I print the metric into a log and grep for it
A log of a number is not a metric system.
Who gets asked this
More Observability questions
- Describe the parts of an ELK or OpenSearch logging stack and what each does.
- What do you mean by observability in this interview?
- On-call cannot find the one failing request in a sea of lines. What do you standardise?
- You page on CPU > 80%. Users are fine. What do you change?
- How does Prometheus collect metrics, and why does a thirty-second batch job show none?
- Why instrument services with OpenTelemetry instead of the observability vendor’s own SDK?
- Logs are 40% of the observability bill. What do you cut without going blind?
- You can afford traces on some paths. Which do you instrument first?