Interview Observability

What labels should and should not be put on a metric? [Intermediate]

Answer

Metric labels should describe stable, bounded dimensions that are useful for aggregation, such as service, route, method, status, environment, cluster, and dependency. They should not contain unbounded identifiers such as user_id, request_id, session_id, raw URL, or exception message.

Technical explanation

Labels multiply time-series cardinality, so every new label must have operational value.

Keep label semantics consistent across services so dashboards and alerts can be reused.

Use logs and traces for high-cardinality investigative fields, not metrics.

Hands-on example

Example: good metric: http_requests_total{service='checkout', route='/orders/{id}', method='POST', status='201'}. Bad metric: http_requests_total{url='/orders/abc123', user='u987', request_id='...'}. The bad version is expensive and hard to aggregate.

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