What is log sampling and when is it acceptable?
AdvancedConceptLogging: ELK/EFK, Loki & Log Shippers
Answer
Log sampling keeps a fraction of repetitive events (for example 1 in 100 successful request logs) while keeping all errors and warnings. It cuts ingestion cost on high-volume paths.
It is acceptable for success-path access logs when metrics already capture rates and traces capture examples. It is not acceptable for audit, security or billing logs. Implement it in the app logger (zap sampling), the agent (Fluent Bit sampling processor, Vector sample transform) or the OTel Collector, and tag sampled events with the rate so counts can be reconstructed.
More on Logging: ELK/EFK, Loki & Log Shippers
What is the ELK stack, and what is EFK?BeginnerHow does Elasticsearch store and search logs?IntermediateWhat is ILM (Index Lifecycle Management) and why do log clusters need it?IntermediateWhat is an Elasticsearch data stream?AdvancedWhat is an index template and mapping, and what is a mapping explosion?AdvancedWhat does Logstash do compared with Beats?Intermediate