pub struct EventLog { /* private fields */ }Expand description
Append-only event log with optional JSONL journal.
Implementations§
Source§impl EventLog
impl EventLog
pub fn new() -> Self
pub fn with_journal(path: PathBuf) -> Self
pub fn append( &mut self, kind: EventKind, action_id: Option<&str>, proposal_id: Option<&str>, data: HashMap<String, Value>, ) -> &Event
pub fn events(&self) -> &[Event]
pub fn len(&self) -> usize
pub fn span_len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn stats(&self) -> EventLogStats
pub fn truncate_events_keep_last(&mut self, keep_last: usize) -> usize
pub fn truncate_spans_keep_last(&mut self, keep_last: usize) -> usize
pub fn clear(&mut self) -> EventLogStats
pub fn filter( &self, kind: Option<&EventKind>, action_id: Option<&str>, ) -> Vec<&Event>
Sourcepub fn begin_span(
&mut self,
name: &str,
trace_id: &str,
parent_span_id: Option<&str>,
attributes: HashMap<String, Value>,
) -> String
pub fn begin_span( &mut self, name: &str, trace_id: &str, parent_span_id: Option<&str>, attributes: HashMap<String, Value>, ) -> String
Begin a new trace span. Returns the generated span_id.
Sourcepub fn end_span(&mut self, span_id: &str, status: SpanStatus)
pub fn end_span(&mut self, span_id: &str, status: SpanStatus)
End an open span by setting its status and end time.
Sourcepub fn export_traces(&self) -> String
pub fn export_traces(&self) -> String
Export traces as OTLP-compatible JSON.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EventLog
impl RefUnwindSafe for EventLog
impl Send for EventLog
impl Sync for EventLog
impl Unpin for EventLog
impl UnsafeUnpin for EventLog
impl UnwindSafe for EventLog
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