Span Event • Rust AI Agent SDK

SpanEvent: An event within a span.

SpanEvent

Defined in the trace module.

Rust AI Agent SDK

An event within a span.

Fields

NameTypeDescription
nameStringEvent name
timestampDurationTimestamp (as duration since trace start)
attributesHashMap<StringAttributes
serde_json:Value>Attributes

Methods

new

rust
fn new(name: impl Into<String>, timestamp: Duration) -> Self

Create a new event.

Parameters:

NameType
nameimpl Into&lt;String&gt;
timestampDuration

with_attribute

rust
fn with_attribute(mut self, key: impl Into<String>, value: impl Serialize) -> Self

Add an attribute.

Parameters:

NameType
keyimpl Into&lt;String&gt;
valueimpl Serialize

Source

View on GitHub

praisonai/src/trace/mod.rs at line 175