Telemetry Event • Rust AI Agent SDK
TelemetryEvent: A telemetry event.
TelemetryEvent
Defined in the telemetry module.
Rust AI Agent SDK
A telemetry event.
Fields
| Name | Type | Description |
|---|---|---|
event_type | TelemetryEventType | Event type |
timestamp | chrono::DateTime<chrono::Utc> | Timestamp |
data | HashMap<String | Event data |
serde_json | :Value> | Event data |
duration | Option<Duration> | Duration (if applicable) |
Methods
new
fn new(event_type: TelemetryEventType) -> SelfCreate a new event.
Parameters:
| Name | Type |
|---|---|
event_type | TelemetryEventType |
with_data
fn with_data(mut self, key: impl Into<String>, value: impl Serialize) -> SelfAdd data.
Parameters:
| Name | Type |
|---|---|
key | impl Into<String> |
value | impl Serialize |
with_duration
fn with_duration(mut self, duration: Duration) -> SelfSet duration.
Parameters:
| Name | Type |
|---|---|
duration | Duration |
Source
View on GitHubpraisonai/src/telemetry/mod.rs at line 337