Telemetry Collector • Rust AI Agent SDK

TelemetryCollector: Telemetry collector.

TelemetryCollector

Defined in the telemetry module.

Rust AI Agent SDK

Telemetry collector.

Fields

NameTypeDescription
eventsArc<RwLock<Vec<TelemetryEvent>>>Collected events
enabledboolWhether collection is enabled
max_eventsusizeMaximum events to keep

Methods

new

rust
fn new() -> Self

Create a new collector.

with_max_events

rust
fn with_max_events(mut self, max: usize) -> Self

Set max events.

Parameters:

NameType
maxusize

enable

rust
fn enable(&mut self) -> ()

Enable collection.

disable

rust
fn disable(&mut self) -> ()

Disable collection.

record

rust
fn record(&self, event: TelemetryEvent) -> ()

Record an event.

Parameters:

NameType
eventTelemetryEvent

events

rust
fn events(&self) -> Vec<TelemetryEvent>

Get all events.

events_by_type

rust
fn events_by_type(&self, event_type: &TelemetryEventType) -> Vec<TelemetryEvent>

Get events by type.

Parameters:

NameType
event_type&TelemetryEventType

event_count

rust
fn event_count(&self) -> usize

Get event count.

clear

rust
fn clear(&self) -> ()

Clear all events.

Source

View on GitHub

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


Related Documentation