pub struct TelemetryProcessor { /* private fields */ }Expand description
Processes an AggregatedMetricsState into a Prometheus text exposition payload.
Owns the underlying [PrometheusRenderer] (whose internal buffers are reused across calls) and
an optional set of RemapperRules. See the module-level docs for the two rendering modes.
Implementations§
Source§impl TelemetryProcessor
impl TelemetryProcessor
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new TelemetryProcessor with no remapper rules.
In this mode, every metric in the state is rendered under its raw name and tags.
Sourcepub fn with_remapper_rules(self, rules: Vec<RemapperRule>) -> Self
pub fn with_remapper_rules(self, rules: Vec<RemapperRule>) -> Self
Configures the set of RemapperRules applied during rendering.
In this mode, only metrics that match at least one rule are rendered; rule order matters
(see RemapperRule::with_continued_matching for how a single source metric can fan out
to multiple remapped metrics).
Sourcepub fn process(&mut self, state: &AggregatedMetricsState) -> String
pub fn process(&mut self, state: &AggregatedMetricsState) -> String
Processes the given state and returns the resulting Prometheus exposition payload.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TelemetryProcessor
impl RefUnwindSafe for TelemetryProcessor
impl Send for TelemetryProcessor
impl Sync for TelemetryProcessor
impl Unpin for TelemetryProcessor
impl UnsafeUnpin for TelemetryProcessor
impl UnwindSafe for TelemetryProcessor
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Track for T
impl<T> Track for T
§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Instruments this type by attaching the given resource group token, returning a
Tracked wrapper. Read more§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Instruments this type by attaching the current resource group, returning a
Tracked wrapper. Read more