pub struct TelemetryService { /* private fields */ }Expand description
Telemetry service for emitting structured events.
Per FR-093: Telemetry failure must not affect task/agent state. All emission methods are fire-and-forget.
Implementations§
Source§impl TelemetryService
impl TelemetryService
pub fn new(enabled: bool) -> Self
Sourcepub fn emit(&self, event: &TelemetryEvent) -> Result<(), TelemetryError>
pub fn emit(&self, event: &TelemetryEvent) -> Result<(), TelemetryError>
Emit a telemetry event as a structured JSON tracing log.
§Errors
Returns TelemetryError only if serialization fails.
Per FR-093, callers should not propagate this error to task state.
Sourcepub fn record(
&self,
event_type: &str,
status: &str,
builder: impl FnOnce(TelemetryEvent) -> TelemetryEvent,
) -> Result<(), TelemetryError>
pub fn record( &self, event_type: &str, status: &str, builder: impl FnOnce(TelemetryEvent) -> TelemetryEvent, ) -> Result<(), TelemetryError>
Trait Implementations§
Source§impl Clone for TelemetryService
impl Clone for TelemetryService
Source§fn clone(&self) -> TelemetryService
fn clone(&self) -> TelemetryService
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TelemetryService
impl RefUnwindSafe for TelemetryService
impl Send for TelemetryService
impl Sync for TelemetryService
impl Unpin for TelemetryService
impl UnsafeUnpin for TelemetryService
impl UnwindSafe for TelemetryService
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
Mutably borrows from an owned value. Read more