Package com.tnsai.quality.sampling
Class SamplingPolicies
java.lang.Object
com.tnsai.quality.sampling.SamplingPolicies
Convenience factories for the bundled
EventSamplingPolicy
implementations (issue #82).
Three named "shapes" capture the most common operator intents without requiring them to think about per-level rates upfront:
verbose()— capture everything; the dev / single-tenant default. Equivalent toAlwaysCapturePolicy.INSTANCE.defaults()— production-friendly priority-aware policy (WARN+ always; INFO 10%; DEBUG 1%). Equivalent toPriorityBasedSamplingPolicy.withDefaults().production()— strict "errors always, everything else at 10%" — simpler thandefaults()when there's no INFO/DEBUG distinction worth keeping. Equivalent toErrorAlwaysPolicy.withDefault().
Operators with custom volume profiles construct the underlying policy directly with their own rates.
- Since:
- 0.9.0 (issue #82)
-
Method Summary
Modifier and TypeMethodDescriptionstatic EventSamplingPolicydefaults()Production default — priority-aware: CRITICAL/ERROR/WARN always, INFO at 10%, DEBUG at 1%.static EventSamplingPolicyStrict production — WARN+ always captured, INFO + DEBUG sampled at 10%.static EventSamplingPolicyverbose()Capture every event; recommended for dev / staging / single tenant.
-
Method Details
-
verbose
Capture every event; recommended for dev / staging / single tenant. -
defaults
Production default — priority-aware: CRITICAL/ERROR/WARN always, INFO at 10%, DEBUG at 1%. Best when an agent's INFO and DEBUG carry meaningfully different volumes. -
production
Strict production — WARN+ always captured, INFO + DEBUG sampled at 10%. Best when "is this a problem?" is the only distinction that matters.
-