What is cardinality cost, and how does it differ between metrics and logs? [Advanced]
Answer
Cardinality cost is the resource and financial impact of unique dimensional combinations. In metrics, cardinality creates new time series and directly affects memory, storage, and query cost. In logs, high-cardinality fields are expected, but ingest volume and indexing/search patterns drive cost.
Technical explanation
Metrics should use bounded labels because every unique label set is a new series.
Logs can contain request_id or user_id for investigation, but logging every event at high volume still creates ingest and storage cost.
Traces also have cardinality concerns through attributes, but sampling and backend indexing policies determine cost impact.
Hands-on example
Example: put user_id in logs and traces for controlled debugging, but never in Prometheus labels. For metrics, expose tenant_tier='enterprise' instead of tenant_id. For logs, control retention and indexing of user_id based on privacy and investigation requirements.
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 distributed tracing, and what is a span and a trace? [Advanced]
- What is head-based versus tail-based sampling for traces? [Advanced]
- What is the difference between the OpenTelemetry SDK and the Collector? [Advanced]
- How do you build alerts in Wavefront, and what is a smart alert? [Advanced]
- How does Wavefront handle high-cardinality metrics compared to Prometheus? [Advanced]
- What is the Wavefront proxy, and why use it? [Advanced]
- What is Wavefront (Tanzu Observability), and what is it used for? [Advanced]
- How do you correlate logs and metrics during an incident? [Advanced]