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.
More on Cardinality Control & Cost
What is cardinality and why is it the main cost driver for metrics?BeginnerHow do you find which metrics and labels are driving cardinality?IntermediateWhich labels should never appear on metrics?BeginnerHow do you enforce cardinality limits so one team cannot blow up the shared system?AdvancedHow do you drop or aggregate metrics you do not need?IntermediateHow do histograms affect cardinality, and how do you control it?Intermediate