Skip to main content

StandardObserver

Struct StandardObserver 

Source
pub struct StandardObserver { /* private fields */ }
Expand description

Production-ready observer with reloadable config and per-tier worker pool.

Implementations§

Source§

impl StandardObserver

Source

pub fn builder() -> StandardObserverBuilder

Builder entry.

Source

pub fn dev() -> Result<StandardObserver, BuildError>

Convenience: StandardObserver with StdoutSink(Full) as fallback.

§Errors

Returns BuildError if config validation fails.

Source

pub fn registry(&self) -> Arc<SchemaRegistry>

Read-only access to the registry (used by sinks).

Source

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.

Source

pub fn config(&self) -> Guard<Arc<EventsConfig>>

Read-only access to the live config.

Source

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.

Source

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.

Source

pub fn filter(&self) -> Arc<Filter>

Read-only access to the live filter.

Source

pub fn counters(&self) -> Arc<WorkerCounters>

Worker counters surface for tests + diagnostics.

Trait Implementations§

Source§

impl Debug for StandardObserver

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Observer for StandardObserver

Source§

fn emit_envelope(&self, env: ObsEnvelope)

Hot-path emit. Never blocks. Never panics. Spec 11 § 3.
Source§

fn enabled(&self, callsite: &ObsCallsite) -> bool

Cheap callsite filter check; called only when the cached Interest is Sometimes. Default impl returns true (allows every callsite that survived enabled_static).
Source§

fn generation(&self) -> u32

Monotonic generation counter; bumped on every filter / config change so callsite caches re-validate. Spec 11 § 3.2.
Source§

fn reload_filter(&self)

Force every callsite’s 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 + '_>>

Flush all sinks; await in-flight batches. Default no-op.
Source§

fn shutdown(&self) -> Pin<Box<dyn Future<Output = ()> + Send + '_>>

Shutdown all sinks and join workers. Idempotent.
Source§

fn shutdown_blocking(&self, timeout: Duration)

Synchronous shutdown for use in panic hooks and Drop impls where awaiting is not possible. Best-effort within timeout. Spec 11 § 3, § 6.1.
Source§

fn callsites(&self) -> Option<Arc<ObsCallsiteRegistry>>

Access this observer’s per-process callsite registry, when it has one. The bridge (Direction A) writes the registry on first sight; ObsToTracingSink reads it to reconstitute tracing::Metadata for interned envelopes. Spec 31 § 3.2.
Source§

fn schema_registry(&self) -> Option<Arc<SchemaRegistry>>

Access this observer’s schema registry, when it has one. Sinks hold their own 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>

Snapshot of the workspace-shared 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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.