pub struct EventLog { /* private fields */ }Expand description
Append-only event log with optional JSONL journal.
Implementations§
Source§impl EventLog
impl EventLog
pub fn new() -> EventLog
pub fn with_journal(path: PathBuf) -> EventLog
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more