Interview Prep/Monitoring & Observability/Cardinality Control & Cost

Which labels should never appear on metrics?

BeginnerProductionCardinality Control & Cost
Answer

Unbounded or per-request values: user IDs, emails, session IDs, request IDs, trace IDs, full URLs with IDs (/orders/839201), raw error messages, IP addresses of clients, timestamps. Those belong in logs or traces. Normalise routes to templates (/orders/{id}) in the instrumentation middleware.

All Monitoring & Observability questions

More on Cardinality Control & Cost