pub struct StandardObserver { /* private fields */ }Expand description
Production-ready observer with reloadable config and per-tier worker pool.
Implementations§
Source§impl StandardObserver
impl StandardObserver
Sourcepub fn builder() -> StandardObserverBuilder
pub fn builder() -> StandardObserverBuilder
Builder entry.
Sourcepub fn dev() -> Result<StandardObserver, BuildError>
pub fn dev() -> Result<StandardObserver, BuildError>
Convenience: StandardObserver with StdoutSink(Full) as
fallback.
§Errors
Returns BuildError if config validation fails.
Sourcepub fn registry(&self) -> Arc<SchemaRegistry>
pub fn registry(&self) -> Arc<SchemaRegistry>
Read-only access to the registry (used by sinks).
Sourcepub fn callsites(&self) -> Arc<ObsCallsiteRegistry>
pub fn callsites(&self) -> Arc<ObsCallsiteRegistry>
Read-only access to the per-process callsite registry. Used by
the bridge (Direction A inserts; Direction B reads to
reconstitute tracing::Metadata). Spec 31 § 3.2.
Sourcepub fn config(&self) -> Guard<Arc<EventsConfig>>
pub fn config(&self) -> Guard<Arc<EventsConfig>>
Read-only access to the live config.
Sourcepub fn set_resource_attrs(&self, attrs: ResourceAttrs)
pub fn set_resource_attrs(&self, attrs: ResourceAttrs)
Atomically swap the resource attribute set. Sinks pick up the
new value on the next Observer::resource_attrs call.
Spec 20 § 2.1 / spec 94 § 2.7 / P1-E.
Sourcepub fn reload_config(&self, new_config: EventsConfig) -> Result<(), BuildError>
pub fn reload_config(&self, new_config: EventsConfig) -> Result<(), BuildError>
Atomically swap the config and bump the generation so all callsites re-probe. Spec 11 § 3.2.
§Errors
Returns BuildError::InvalidConfig if validation rejects
new_config.
Sourcepub fn counters(&self) -> Arc<WorkerCounters>
pub fn counters(&self) -> Arc<WorkerCounters>
Worker counters surface for tests + diagnostics.
Trait Implementations§
Source§impl Debug for StandardObserver
impl Debug for StandardObserver
Source§impl Observer for StandardObserver
impl Observer for StandardObserver
Source§fn emit_envelope(&self, env: ObsEnvelope)
fn emit_envelope(&self, env: ObsEnvelope)
Source§fn enabled(&self, callsite: &ObsCallsite) -> bool
fn enabled(&self, callsite: &ObsCallsite) -> bool
Interest is Sometimes. Default impl returns true
(allows every callsite that survived enabled_static).Source§fn generation(&self) -> u32
fn generation(&self) -> u32
Source§fn reload_filter(&self)
fn reload_filter(&self)
interest cache back to Unknown.
Default impl is a no-op for observers that don’t filter.Source§fn flush(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>
fn flush(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>
Source§fn shutdown(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>
fn shutdown(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>
Source§fn shutdown_blocking(&self, timeout: Duration)
fn shutdown_blocking(&self, timeout: Duration)
Drop impls
where awaiting is not possible. Best-effort within timeout.
Spec 11 § 3, § 6.1.Source§fn callsites(&self) -> Option<Arc<ObsCallsiteRegistry>>
fn callsites(&self) -> Option<Arc<ObsCallsiteRegistry>>
ObsToTracingSink reads it to reconstitute
tracing::Metadata for interned envelopes. Spec 31 § 3.2.Source§fn schema_registry(&self) -> Option<Arc<SchemaRegistry>>
fn schema_registry(&self) -> Option<Arc<SchemaRegistry>>
Arc<SchemaRegistry> from construction; this
hook lets the bridge fall back to the global observer’s
registry without depending on StandardObserver.Source§fn resource_attrs(&self) -> Arc<ResourceAttrs>
fn resource_attrs(&self) -> Arc<ResourceAttrs>
ResourceAttrs (OTel
semantic-convention keys). Sinks call this at flush time so a
single config-watcher reload re-projects every sink. Default
returns the empty / observer-less attribute set; concrete
observers (StandardObserver) override. Spec 20 § 2.1 / spec
94 § 2.7 / P1-E.Auto Trait Implementations§
impl !Freeze for StandardObserver
impl !RefUnwindSafe for StandardObserver
impl Send for StandardObserver
impl Sync for StandardObserver
impl Unpin for StandardObserver
impl UnsafeUnpin for StandardObserver
impl !UnwindSafe for StandardObserver
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
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> 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