pub struct HistogramGroup<L: Labels, N: HistogramValue = f64> { /* private fields */ }Expand description
A Histogram partitioned by labels of type L.
Implementations§
Source§impl<L: Labels, N: HistogramValue> HistogramGroup<L, N>
impl<L: Labels, N: HistogramValue> HistogramGroup<L, N>
Sourcepub const fn new(name: &'static str) -> Self
pub const fn new(name: &'static str) -> Self
Declares a histogram group with the given name. Names must start with a letter and contain only letters, digits, _, ., -, and /. name must be a string literal so Encore can parse it statically.
Declares the histogram with shared app-wide scope rather than service scope. Any service may record to it, and each service that does is tracked as a user. See scope.
Sourcepub const fn global(self) -> Self
pub const fn global(self) -> Self
Declares the histogram with global app-wide scope so any code (including shared libraries outside any service) may record to it without per-service tracking. See scope.
Sourcepub const fn unit(self, unit: &'static str) -> Self
pub const fn unit(self, unit: &'static str) -> Self
Sets the exported unit of the histogram (using UCUM notation such as "s", "By", or "{request}").
Sourcepub const fn description(self, description: &'static str) -> Self
pub const fn description(self, description: &'static str) -> Self
Sets the description of the histogram when no doc comment is present.
Sourcepub const fn tag(self, _key: &'static str, _value: &'static str) -> Self
pub const fn tag(self, _key: &'static str, _value: &'static str) -> Self
Attaches a key/value tag to the histogram (for example, .tag("data", "pii")) for policy and governance tooling. Call once per tag with unique keys. Both key and value must be string literals so Encore can parse them statically. Keys must start with a letter, contain only lowercase letters, digits, _, and -, and must not start with encore (reserved for Encore’s own tags). Values use the same character set or may be empty. Each key and value is at most 63 characters, and a histogram may have at most 32 tags.
Tags classify the metric declaration itself and are distinct from recorded metric labels.
Sourcepub const fn buckets(self, bounds: &'static [f64]) -> Self
pub const fn buckets(self, bounds: &'static [f64]) -> Self
Sets explicit increasing upper bucket boundaries.
Each recorded value is counted in the first bucket whose upper bound is greater than or equal to the value (or in an overflow bucket if larger than all bounds). If omitted, OpenTelemetry’s default bucket boundaries are used.
Source§impl<L: Labels, N: HistogramValue> HistogramGroup<L, N>
impl<L: Labels, N: HistogramValue> HistogramGroup<L, N>
Sourcepub const fn named(name: &'static str) -> Self
pub const fn named(name: &'static str) -> Self
Binds a shared or global histogram group named name that was declared elsewhere (for example, in another service or language). It inherits the declaration’s labels, scope, unit, description, and buckets, and is exported as name without a service prefix. name must be a string literal so Encore can parse it statically.
Auto Trait Implementations§
impl<L, N = f64> !Freeze for HistogramGroup<L, N>
impl<L, N = f64> !RefUnwindSafe for HistogramGroup<L, N>
impl<L, N = f64> !UnwindSafe for HistogramGroup<L, N>
impl<L, N> Forget for HistogramGroup<L, N>
impl<L, N> Move for HistogramGroup<L, N>
impl<L, N> Send for HistogramGroup<L, N>
impl<L, N> Sync for HistogramGroup<L, N>
impl<L, N> Unpin for HistogramGroup<L, N>
impl<L, N> UnsafeUnpin for HistogramGroup<L, N>where
&'static str: UnsafeUnpin,
&'static [f64]: UnsafeUnpin,
Align4<u32>: UnsafeUnpin,
*const ArcInner<dyn SyncInstrument<N> + Sync + Send> is !null: UnsafeUnpin,
PhantomData<ArcInner<dyn SyncInstrument<N> + Sync + Send>>: UnsafeUnpin,
PhantomData<Histogram<N>>: UnsafeUnpin,
PhantomData<fn(&L)>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> 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> ⓘ
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> ⓘ
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 moreSource§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