Interview Prep/Monitoring & Observability/Cardinality Control & Cost

When should you use logs, metrics or traces for a given signal to keep costs sane?

BeginnerProductionCardinality Control & Cost
Answer
  • Metrics for aggregated numbers you alert and trend on: cheap per event, fixed cost.
  • Logs for per-event detail you search occasionally: expensive per event.
  • Traces for request flow across services: sample them.

Turning a hot log line ("request completed") into a counter plus sampled traces often cuts log volume dramatically while improving alerting.

All Monitoring & Observability questions

More on Cardinality Control & Cost