Skip to main content

Observability

Struct Observability 

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

Producer-facing routing runtime for typed observations.

Implementations§

Source§

impl Observability

Source

pub fn new(config: ObservabilityConfig) -> Result<Self, InitError>

Builds a runtime using the documented default logger integration.

Source

pub fn builder(config: ObservabilityConfig) -> ObservabilityBuilder

Starts a construction-time builder for subscribers and projections.

§Examples
use std::path::PathBuf;
use sc_observability_types::ToolName;
use sc_observe::{Observability, ObservabilityConfig};

let config = ObservabilityConfig::default_for(
    ToolName::new("demo-tool").expect("valid tool"),
    PathBuf::from("logs"),
)
.expect("valid config");

let _builder = Observability::builder(config);
Source

pub fn emit<T>( &self, observation: Observation<T>, ) -> Result<(), ObservationError>
where T: Observable,

Routes one typed observation through the registered subscribers and projections.

§Panics

Panics if the internal last-error mutex has been poisoned while the runtime records a routing, subscriber, or projection failure summary.

Source

pub fn flush(&self) -> Result<(), FlushError>

Flushes the attached logger. Routing itself does not keep an async queue in v1.

§Panics

Panics if the attached logger encounters a poisoned internal mutex while flushing its registered sinks.

Source

pub fn shutdown(&self) -> Result<(), ShutdownError>

Shuts down the routing runtime. Repeated calls are idempotent.

§Panics

Panics if the attached logger encounters a poisoned internal mutex while flushing sinks or updating query/follow health during shutdown.

Source

pub fn health(&self) -> ObservabilityHealthReport

Returns the aggregate runtime health view.

§Panics

Panics if the internal last-error mutex has been poisoned.

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.
Source§

impl<T> Observable for T
where T: Send + Sync + 'static,