pub struct Filter { /* private fields */ }Expand description
Parsed obs::Filter. Statics are checked first against the
callsite; dynamics are bucketed by full_name and consulted at
emit time against env.labels.
Implementations§
Source§impl Filter
impl Filter
Sourcepub fn parse(s: &str) -> Result<Filter, FilterParseError>
pub fn parse(s: &str) -> Result<Filter, FilterParseError>
Parse a filter spec string (OBS_FILTER / obs.yaml’s filter).
§Errors
Returns FilterParseError::Malformed when a directive is
syntactically invalid, e.g. =info (missing target/level).
Sourcepub fn add_directive(&mut self, raw: &str) -> Result<(), FilterParseError>
pub fn add_directive(&mut self, raw: &str) -> Result<(), FilterParseError>
Add one directive. Public for programmatic construction.
§Errors
Returns FilterParseError::Malformed when the directive is
syntactically invalid.
Sourcepub fn callsite_interest(&self, callsite: &ObsCallsite) -> Interest
pub fn callsite_interest(&self, callsite: &ObsCallsite) -> Interest
Decide Interest for a static callsite (no envelope visible
yet). Used at first-sight by the runtime to populate the
callsite cache.
Sometimes is returned whenever a dynamic directive references
the callsite — the per-emit event_allowed is then consulted
once the envelope is available.
Spec 94 § 2.2: a static directive that matches the callsite
vetoes inclusion regardless of the global default floor — i.e.
info,my_module=off rejects every my_module::* callsite even
when its default severity is at or above info.
Sourcepub fn event_allowed(&self, env: &ObsEnvelope, callsite_sev: Severity) -> bool
pub fn event_allowed(&self, env: &ObsEnvelope, callsite_sev: Severity) -> bool
Per-emit decision once the envelope is built. Honours dynamic
directives ([field=value]) by reading env.labels.
Sourcepub fn default_level(&self) -> Severity
pub fn default_level(&self) -> Severity
Default severity floor.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Filter
impl RefUnwindSafe for Filter
impl Send for Filter
impl Sync for Filter
impl Unpin for Filter
impl UnsafeUnpin for Filter
impl UnwindSafe for Filter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request