{{ summaryTitle }} {{ summaryValue }} {{ summaryLine }} {{ badge.label }} {{ badge.value }} {{ summaryAnnouncement }}
Log stream volume and retention target inputs
Enter a representative pre-sampling counter and choose its time basis.
Keep the measurement basis consistent with the retained-volume target.
Sampling is solved so modeled retained bytes fit this daily cap when the protected reserve allows it.
{{ workflowFeedback }}
Leave zero when every event can share one probability. Protect audit, security, error, or other critical categories separately when needed.
%
Leave 1 for average-day sizing or use a measured peak-to-average ratio.
×
Leave zero when the event-size measurement is already based on stored bytes.
%
Use a short service, index, stream, or environment name for exported handoffs.
Use 0 to 4 decimal places; exported canonical chart values remain unrounded.
digits
{{ budgetExportStatus }}
MeasureValuePlanning meaningCopy
{{ row.label }}{{ row.value }}{{ row.note }}
{{ policyExportStatus }}
Policy leverSettingEvidenceOperator actionCopy
{{ row.lever }}{{ row.setting }}{{ row.evidence }}{{ row.action }}
{{ chartExportStatus }}

Introduction

Logging systems often receive far more routine events than a storage budget can retain. Request successes, health checks, debug messages, retries, and repeated application notices may dominate daily volume even though investigations depend on a much smaller set of errors, security records, audit events, or unusual traces.

Sampling reduces a chosen portion of that stream by keeping each eligible event with a probability. A 10% sampling rate means roughly one eligible event in ten is expected to remain over a large population. It does not promise one event from every block of ten, and it can miss a rare event entirely. Records that must be complete therefore need an always-keep rule before sampling is applied.

Ways to reduce retained log volume
MethodUseful whenMain risk
Filter known noiseA category has little diagnostic valueA broad rule may discard an unexpected clue
Probabilistic samplingRoutine events need a representative baselineLow-frequency events may disappear
Keep selected classes in fullAudit, security, billing, or critical errors require coverageThe protected share may consume the whole budget
Shorten retention or reduce indexingRecent search matters more than long historyOlder investigations or rich queries become harder

Daily volume depends on more than events per second. Average event size, traffic bursts, enrichment fields, indexing overhead, and the time basis of the rate all change the byte total. Measurements should come from a representative pre-sampling counter and a realistic encoded event size, not from a quiet interval or an uncompressed message sample.

A storage-fitting rate is a capacity plan rather than a complete observability policy. It can show how much of the sampleable stream fits after protected logs are reserved. It cannot decide which event classes are safe to sample, preserve related requests together, or guarantee enough evidence for incident response and compliance.

How to Use This Tool:

Measure the unsampled stream first, then reserve logs that must remain complete before solving the eligible sampling rate.

  1. Enter Incoming log rate with the correct per-second, per-minute, per-hour, or per-day basis.
  2. Enter the average encoded event size and the target retained volume per day. Keep the binary units consistent with the storage quote.
  3. Set Full-fidelity reserve to the share that bypasses sampling, then add a burst multiplier and storage overhead when the measured average understates peak or indexed volume.
  4. Read Sampleable keep rate, Overall keep rate, and the one-in-N guide together. A budget conflict means the protected share alone exceeds the target.
  5. Translate the percentage into the actual logging system and validate retained bytes over a representative day before treating the target as stable.

Interpreting Results:

Sampleable keep rate applies only to logs outside the protected reserve. Overall keep rate includes both protected and sampled events, so it will be higher whenever some records bypass sampling. The retained and dropped volume estimates describe the modeled day after burst and overhead adjustments.

A low percentage is not automatically wrong, but it raises the chance that uncommon eligible events will be absent. Protect critical classes explicitly, and check whether related records require consistent sampling by request, trace, user, or another stable key.

Technical Details:

All rates are converted to events per second, sizes to bytes per event, and target capacity to bytes per day. The burst multiplier increases the modeled event rate, while overhead increases bytes after event count and average size are combined. Binary storage factors are used: 1 KiB is 1,024 bytes, 1 MiB is 1,024² bytes, and 1 GiB is 1,024³ bytes.

Formula Core

The protected share is reserved first. Only the remaining bytes are reduced by the solved sampling probability.

B=qb×86400×(1+o100) P=B×p100 S=B-P r=clamp(K-PS,0,1) R=P+Sr
Symbols used in the log sampling formulas
SymbolMeaningUnit
qIncoming events per second after the burst multiplierevents/second
bAverage event sizebytes/event
o, pStorage overhead and protected keep sharepercent
B, P, SRaw, protected, and sampleable daily bytesbytes/day
KTarget retained capacitybytes/day
r, REligible-event sampling probability and retained daily bytesratio; bytes/day

When raw volume already fits, r is capped at 1. When protected bytes exceed the target, the rate is capped at 0 and the result reports a budget conflict because sampling cannot remove protected records. One-in-N is the reciprocal of r whenever the rate is above zero. Full precision is kept through the calculation; the display setting rounds only visible values.

Rule Core

Sampling plan status rules
ConditionStatus
Protected bytes exceed the targetBudget conflict
Sampleable keep rate is at least 99.999%Full fidelity fits
Sampleable keep rate is below 1%Sparse baseline
Sampleable keep rate is at least 1% but below 10%Tight budget
All other valid ratesSampling planned

Accuracy Notes:

Expected volume is only as sound as the measured rate and size distribution. Large stack traces, payload fragments, enrichment fields, multiline events, and index replicas can make an average message sample too small.

  • Measure before sampling and across a period that includes normal peaks.
  • Keep compliance, security, billing, and incident-critical classes outside probabilistic sampling when completeness matters.
  • Recalculate after parser, enrichment, indexing, routing, or retention policy changes.

Worked Examples:

A stream that needs a half-rate sample

One 1,024-byte event per second produces 86,400 events and 84.375 MiB per day with no burst or overhead. A 42.1875 MiB target and no protected reserve yields a 50% sampleable keep rate. The expected result is 0.5 retained events per second, 42.1875 MiB retained per day, and a one-in-two guide.

References: