Interview Observability

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.

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