Telemetry Context • Rust AI Agent SDK

TelemetryContext: Telemetry context for scoped tracking

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

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

Create a new telemetry context

Parameters:

NameType
nameimpl Into&lt;String&gt;

property

rust
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

rust
fn elapsed_ms(&self) -> u64

Get elapsed time in milliseconds

complete

rust
fn complete(self) -> ()

Complete the context and track event

Source

View on GitHub

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


Related Documentation