Skip to main content

TelemetryRuntime

Struct TelemetryRuntime 

Source
pub struct TelemetryRuntime { /* private fields */ }

Implementations§

Source§

impl TelemetryRuntime

Source

pub fn new() -> Self

Source

pub fn start( &mut self, config: Option<TelemetryConfig>, ) -> Result<TelemetryConfig, TelemetryError>

Start the runtime, optionally with an explicit config.

None reads the environment. Mirrors Python’s start(config), TypeScript’s start(config?) and Go’s Start(ctx, opts...).

Source

pub fn shutdown( &mut self, timeout_seconds: Option<f64>, ) -> Result<(), TelemetryError>

Shut down, bounding the pre-teardown drain by timeout_seconds.

Source

pub fn flush( &self, timeout_seconds: Option<f64>, ) -> Result<FlushResult, TelemetryError>

Flush installed providers, bounding the drain by timeout_seconds.

Each signal reports its own outcome. A signal with no provider is not_installed; one whose provider was adopted from the OTel globals is not_owned (the host’s to drain, so we leave it alone); the rest carry the result of their own drain, not an aggregate of all three.

Returns Err when any owned signal’s records may still be queued — abandoned at the deadline, or rejected by its exporter inside it — so rt.flush(None)? before a freeze fails loudly instead of freezing with records still queued — the contract setup::flush_telemetry has always had. The two error messages stay distinct: an exporter that rejected the drain in milliseconds never exceeded any deadline. Inspect the FlushResult on Ok for per-signal detail.

Source

pub fn get_logger(&self, name: Option<&str>) -> Logger

Source

pub fn get_tracer(&self, name: Option<&str>) -> Tracer

Source

pub fn get_meter(&self, name: Option<&str>) -> Meter

Source

pub fn get_runtime_config(&self) -> Option<TelemetryConfig>

Source

pub fn get_runtime_status(&self) -> RuntimeStatus

Source

pub fn update_config( &mut self, overrides: RuntimeOverrides, ) -> ReconfigureResult

Source

pub fn reconfigure( &mut self, config: Option<TelemetryConfig>, ) -> Result<TelemetryConfig, TelemetryError>

Source

pub fn provider_mode(&self) -> ProviderMode

Source

pub fn state(&self) -> RuntimeState

Trait Implementations§

Source§

impl Default for TelemetryRuntime

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V