pub struct TelemetryHandle { /* private fields */ }Expand description
Cloneable telemetry capability injected into business components.
This type deliberately has no shutdown method and contains no SDK provider. Clone it freely;
the corresponding non-cloneable TelemetryRuntimeGuard remains the sole shutdown owner.
Implementations§
Source§impl TelemetryHandle
impl TelemetryHandle
Sourcepub const fn noop() -> Self
pub const fn noop() -> Self
Creates a handle that never reads or installs OpenTelemetry global state.
Sourcepub fn state(&self) -> TelemetryState
pub fn state(&self) -> TelemetryState
Returns the current shared lifecycle state.
Sourcepub fn is_active(&self) -> bool
pub fn is_active(&self) -> bool
Returns whether this handle currently admits telemetry operations.
Sourcepub fn metrics_enabled(&self) -> bool
pub fn metrics_enabled(&self) -> bool
Returns whether this active runtime currently enables metrics.
Sourcepub fn metrics_runtime_policy(&self) -> MetricsRuntimePolicy
pub fn metrics_runtime_policy(&self) -> MetricsRuntimePolicy
Returns final metrics runtime policy while the telemetry lifecycle is active.
No-op, closing, and closed handles return a disabled policy so surviving clones cannot continue metrics work after their runtime owner begins shutdown.
Sourcepub fn trace_policy(&self) -> TracePolicy
pub fn trace_policy(&self) -> TracePolicy
Returns this handle’s immutable trace policy while the runtime is active.
A closing or closed handle returns a disabled policy so clones that outlive their runtime cannot continue producing telemetry.
Sourcepub fn metric_label_policy(&self) -> MetricLabelPolicy
pub fn metric_label_policy(&self) -> MetricLabelPolicy
Returns this telemetry instance’s shared metric-label policy.
Clones of this handle share one bounded-cardinality budget. Independently initialized handles receive independent policies and budgets.
Sourcepub fn child(&self, scope: &'static str) -> TelemetryRecorder
pub fn child(&self, scope: &'static str) -> TelemetryRecorder
Returns a recorder bound to a fixed instrumentation scope.
Sourcepub fn release_identity_registered(&self) -> bool
pub fn release_identity_registered(&self) -> bool
Returns whether this active runtime registered a release identity.