How and when do you sample logs?

IntermediateProductionLog Pipelines
Answer

Never sample errors, warnings, audit or security logs. Sample high-volume, low-value lines (successful health checks, 200 OK access logs) at 1–10%, and record the sample rate as a field so counts can be scaled back:

[transforms.sample_access]
type = "sample"
inputs = ["access_logs"]
rate = 10            # keep 1 in 10
exclude = '.status >= 400'

Better still, turn those access logs into metrics (rate, latency) and stop shipping most of them.

All Monitoring & Observability questions Roadmap: Logging & tracing

More on Log Pipelines