pub struct MetricCardinalityGuard { /* private fields */ }Expand description
Enforces the per-family label-cardinality and name-allowlist budgets.
Implementations§
Source§impl MetricCardinalityGuard
impl MetricCardinalityGuard
Sourcepub fn new(
job_names: impl IntoIterator<Item = JobName>,
step_names: impl IntoIterator<Item = StepName>,
) -> Result<Self, MetricConfigurationError>
pub fn new( job_names: impl IntoIterator<Item = JobName>, step_names: impl IntoIterator<Item = StepName>, ) -> Result<Self, MetricConfigurationError>
Configures explicit job and step name allowlists.
§Errors
Rejects either allowlist when it contains more than 50 names.
Sourcepub fn observe(
&mut self,
family: MetricFamily,
dimensions: &MetricDimensions,
) -> MetricObservation
pub fn observe( &mut self, family: MetricFamily, dimensions: &MetricDimensions, ) -> MetricObservation
Applies the declared family label set and finite series budget.
Sourcepub fn dropped_cardinality(&self, family: MetricFamily) -> u64
pub fn dropped_cardinality(&self, family: MetricFamily) -> u64
Returns the count of combinations mapped to the reserved series.
Sourcepub fn series_count(&self, family: MetricFamily) -> usize
pub fn series_count(&self, family: MetricFamily) -> usize
Returns the currently retained series count for one family.
Trait Implementations§
Source§impl Debug for MetricCardinalityGuard
impl Debug for MetricCardinalityGuard
Source§impl Default for MetricCardinalityGuard
impl Default for MetricCardinalityGuard
Source§fn default() -> MetricCardinalityGuard
fn default() -> MetricCardinalityGuard
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MetricCardinalityGuard
impl RefUnwindSafe for MetricCardinalityGuard
impl Send for MetricCardinalityGuard
impl Sync for MetricCardinalityGuard
impl Unpin for MetricCardinalityGuard
impl UnsafeUnpin for MetricCardinalityGuard
impl UnwindSafe for MetricCardinalityGuard
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more