Interface EventSamplingPolicy

All Known Implementing Classes:
AdaptiveSamplingPolicy, AlwaysCapturePolicy, ErrorAlwaysPolicy, HeadBasedSamplingPolicy, PriorityBasedSamplingPolicy, RuleBasedSamplingPolicy, TenantPolicySamplingPolicy

public interface EventSamplingPolicy
SPI for deciding whether to capture an event (issue #82).

Policies are pure functions of SamplingInput — no I/O, no mutable state. A single instance is shared across the framework and MUST be safe to call concurrently from any number of publisher threads.

Default implementations shipped in this package:

Heavier policies (tail-based per-session, adaptive backpressure- driven, YAML-rule-driven) are out of scope for the foundation slice and land in follow-up PRs.

Since:
0.5.0 (issue #82)
  • Method Summary

    Modifier and Type
    Method
    Description
    Inspect an event's metadata and return whether to capture, drop, or capture-with-downsampling marker.
  • Method Details

    • sample

      Inspect an event's metadata and return whether to capture, drop, or capture-with-downsampling marker.