Telemetry Event • Rust AI Agent SDK

TelemetryEvent: A telemetry event.

TelemetryEvent

Defined in the telemetry module.

Rust AI Agent SDK

A telemetry event.

Fields

NameTypeDescription
event_typeTelemetryEventTypeEvent type
timestampchrono::DateTime<chrono::Utc>Timestamp
dataHashMap<StringEvent data
serde_json:Value>Event data
durationOption<Duration>Duration (if applicable)

Methods

new

rust
fn new(event_type: TelemetryEventType) -> Self

Create a new event.

Parameters:

NameType
event_typeTelemetryEventType

with_data

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

Add data.

Parameters:

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

with_duration

rust
fn with_duration(mut self, duration: Duration) -> Self

Set duration.

Parameters:

NameType
durationDuration

Source

View on GitHub

praisonai/src/telemetry/mod.rs at line 337


Related Documentation