Interview Prep/Monitoring & Observability/Logging: ELK/EFK, Loki & Log Shippers

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.

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Logging: ELK/EFK, Loki & Log Shippers