Skip to main content

TelemetryContext

Defined in the Telemetry Funcs module.
Rust AI Agent SDK Telemetry context for scoped tracking

Fields

NameTypeDescription
nameStringContext name
start_timestd::time::InstantStart time
propertiesstd::collections::HashMap<StringProperties
serde_json:Value>Properties

Methods

new

fn new(name: impl Into<String>) -> Self
Create a new telemetry context Parameters:
NameType
nameimpl Into&lt;String&gt;

property

fn property(mut self, key: impl Into<String>, value: serde_json::Value) -> Self
Add a property Parameters:
NameType
keyimpl Into&lt;String&gt;
valueserde_json::Value

elapsed_ms

fn elapsed_ms(&self) -> u64
Get elapsed time in milliseconds

complete

fn complete(self) -> ()
Complete the context and track event

Source

View on GitHub

praisonai/src/parity/telemetry_funcs.rs at line 256