pub struct ObservationEvent {
pub kind: ObservationKind,
pub severity: ObservationSeverity,
pub name: String,
pub timestamp_ms: u64,
pub trace_id: Option<String>,
pub attributes: BTreeMap<String, String>,
}Expand description
Generic runtime fact suitable for logs, diagnostics, metrics and audit sinks.
Fields§
§kind: ObservationKindRuntime subsystem category.
severity: ObservationSeverityObservation severity.
name: StringStable observation name.
timestamp_ms: u64Timestamp in Unix milliseconds.
trace_id: Option<String>Optional trace identity.
attributes: BTreeMap<String, String>Bounded non-sensitive dimensions.
Implementations§
Source§impl ObservationEvent
impl ObservationEvent
Sourcepub fn new(
kind: ObservationKind,
severity: ObservationSeverity,
name: impl Into<String>,
timestamp_ms: u64,
) -> Self
pub fn new( kind: ObservationKind, severity: ObservationSeverity, name: impl Into<String>, timestamp_ms: u64, ) -> Self
Creates an event without attributes.
Sourcepub fn with_trace_id(self, trace_id: impl Into<String>) -> Self
pub fn with_trace_id(self, trace_id: impl Into<String>) -> Self
Attaches a trace identity.
Trait Implementations§
Source§impl Clone for ObservationEvent
impl Clone for ObservationEvent
Source§fn clone(&self) -> ObservationEvent
fn clone(&self) -> ObservationEvent
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 moreSource§impl Debug for ObservationEvent
impl Debug for ObservationEvent
Source§impl<'de> Deserialize<'de> for ObservationEvent
impl<'de> Deserialize<'de> for ObservationEvent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ObservationEvent
Source§impl PartialEq for ObservationEvent
impl PartialEq for ObservationEvent
Source§impl Serialize for ObservationEvent
impl Serialize for ObservationEvent
impl StructuralPartialEq for ObservationEvent
Auto Trait Implementations§
impl Freeze for ObservationEvent
impl RefUnwindSafe for ObservationEvent
impl Send for ObservationEvent
impl Sync for ObservationEvent
impl Unpin for ObservationEvent
impl UnsafeUnpin for ObservationEvent
impl UnwindSafe for ObservationEvent
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