pub struct Filter { /* private fields */ }Expand description
Parses and evaluates METRICS_FILTER-style directives.
Filter string: comma-separated pattern=on|off. Bare on/off is a
global default. A pattern matches if it is a prefix of the metric name OR
is a component/prefix of the module path (e.g. traffic_controller matches
iota_core::traffic_controller::metrics).
Implementations§
Source§impl Filter
impl Filter
Sourcepub fn is_enabled(&self, name: &str, module: &str) -> bool
pub fn is_enabled(&self, name: &str, module: &str) -> bool
Returns true if the metric should be registered (default when no
directives match: true).
Matching order (last wins):
- Empty pattern — global default.
name.starts_with(pattern)— metric name prefix.module.starts_with(pattern)— module path prefix.modulecontains"::{pattern}"— exact module component.
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
Mutably borrows from an owned value. Read more