pub struct TracingObserver;Expand description
An Observer that emits one structured tracing event per signal.
Signals that report a safety-integrity problem
(Signal::is_safety_signal) are emitted at WARN, everything else at
DEBUG: a claim violation or a stale interaction should surface without a
filter change, while the ordinary flow of a busy system should not.
The event carries the signal name, the typed labels and, for a latency signal, the measured duration in milliseconds. It never carries text.
use turnframe_core::ids::WorkflowKey;
use turnframe_core::observe::{Observer, Signal, SignalLabels};
use turnframe_telemetry::TracingObserver;
let observer = TracingObserver::new();
observer.observe_labeled(
&Signal::WorkflowInvariantViolation,
&SignalLabels::workflow(WorkflowKey::from("trip")).with_error_code("two_open_drafts"),
);Implementations§
Trait Implementations§
Source§impl Clone for TracingObserver
impl Clone for TracingObserver
impl Copy for TracingObserver
Source§impl Debug for TracingObserver
impl Debug for TracingObserver
Source§impl Default for TracingObserver
impl Default for TracingObserver
Source§impl Observer for TracingObserver
impl Observer for TracingObserver
Source§fn observe_labeled(&self, signal: &Signal, labels: &SignalLabels)
fn observe_labeled(&self, signal: &Signal, labels: &SignalLabels)
Observes a signal with labels. The default drops the labels.
Source§fn observe_duration(
&self,
signal: &Signal,
duration: Duration,
labels: &SignalLabels,
)
fn observe_duration( &self, signal: &Signal, duration: Duration, labels: &SignalLabels, )
Observes a duration signal (
SignalKind::DurationMillis or
SignalKind::DurationMicros) with its measured value. The default
drops the value and forwards to Observer::observe_labeled.Auto Trait Implementations§
impl Freeze for TracingObserver
impl RefUnwindSafe for TracingObserver
impl Send for TracingObserver
impl Sync for TracingObserver
impl Unpin for TracingObserver
impl UnsafeUnpin for TracingObserver
impl UnwindSafe for TracingObserver
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