pub struct NodeCtx { /* private fields */ }Expand description
Per-node bundle of metric attributes and instrument handles.
Constructed once per node by spawn_pipeline (or by tests). The
hot-path code in BasicTransform / ManagedSink stores the
NodeCtx alongside its other state and calls processed_add(1)
without hashmap lookups.
Implementations§
Source§impl NodeCtx
impl NodeCtx
Sourcepub fn for_node(
pipeline: &str,
node_id: &str,
node_kind: NodeKind,
handle: ObsHandle,
) -> Self
pub fn for_node( pipeline: &str, node_id: &str, node_kind: NodeKind, handle: ObsHandle, ) -> Self
Build a NodeCtx for a single node. The attribute set is
pipeline, node_id, node_kind — kept tight on purpose to
avoid cardinality blow-ups (no meta.key, no payload labels).
Sourcepub fn noop() -> Self
pub fn noop() -> Self
No-op context with empty attributes, backed by a private
no-op meter. Used by tests that build pipelines manually and
by the default state of BasicTransform / ManagedSink until
spawn_pipeline attaches a real ctx.
pub fn attrs(&self) -> &[KeyValue]
pub fn handle(&self) -> &ObsHandle
pub fn pipeline(&self) -> &str
pub fn node_id(&self) -> &str
pub fn node_kind(&self) -> NodeKind
pub fn node_kind_str(&self) -> &'static str
pub fn log_keys(&self) -> bool
pub fn record_processed(&self)
pub fn record_filtered(&self)
pub fn record_failed(&self)
pub fn record_retry(&self)
pub fn record_dead_letter(&self)
pub fn record_stage_duration_ms(&self, ms: f64)
pub fn record_end_to_end_latency_ms(&self, ms: f64)
pub fn record_channel_capacity_used(&self, used: u64)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NodeCtx
impl !RefUnwindSafe for NodeCtx
impl Send for NodeCtx
impl Sync for NodeCtx
impl Unpin for NodeCtx
impl UnsafeUnpin for NodeCtx
impl !UnwindSafe for NodeCtx
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> 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> 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 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>
Wrap the input message
T in a tonic::Request