Which metrics would you instrument in a new backend service?
BeginnerScenarioPrometheus and PromQL at Scale
Answer
Situation read → Use RED for request-driven services and USE for resources.
What I'd do →
- Rate:
http_requests_total{method,route,status}counter. - Errors: derive from the status label, plus business errors such as
payment_failures_total{reason}. - Duration:
http_request_duration_secondshistogram, using route templates. - Saturation: in-flight requests gauge, worker pool queue length, DB pool usage.
- Dependencies: client-side metrics for each downstream call (latency, errors).
- Runtime metrics (GC, goroutines or threads, memory) come free from the client library.
Why → Client-side dependency metrics tell you whether the problem is yours or downstream.
Interview tip → Mention that you instrument on the boundary: incoming requests and outgoing calls.
More on Prometheus and PromQL at Scale
Prometheus memory has grown to 60 GB and keeps climbing. How do you find the cause?IntermediateA developer added `user_id` as a metric label. What is the problem and what do you advise?BeginnerYour dashboard shows the average of per-pod p99 latencies. Why is it wrong, and how do you compute a correct fleet-wide p99?IntermediateChoose histogram bucket boundaries for a service with a 300 ms latency SLO.AdvancedYou have 500 short-lived batch jobs that finish before Prometheus can scrape them. How do you capture their metrics?IntermediateYour EC2 fleet autoscales constantly. How do you keep Prometheus targets up to date?Intermediate