What is a scrape target, and how does service discovery find them? [Basic]
Answer
A scrape target is an endpoint Prometheus will scrape for metrics, typically host:port plus a metrics path. Service discovery finds targets automatically and attaches labels that can be relabeled before storage.
Technical explanation
In Kubernetes, targets can come from pods, services, endpoints, EndpointSlices, or custom resources through the Prometheus Operator.
Relabeling controls which targets are kept and how discovery metadata becomes Prometheus labels.
Good target labels should identify job, instance, namespace, service, pod, and environment without adding unbounded values.
Hands-on example
Hands-on: open Prometheus UI -> Status -> Targets. Verify the checkout target is UP, check last scrape duration and error, then query up{namespace='prod', service='checkout'}. If the target is missing, inspect ServiceMonitor labels and endpoint port names.
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]