Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

Telemetry and usage tracking

Tracks token usage, costs, tool executions, file changes, and other metrics for monitoring agent performance and providing audit trails.

Structs§

ContextLimit
Context limit tracking
CostEstimate
Cost calculation utilities
FileChange
A single file change record
StageTelemetry
Per-stage telemetry
SwarmTelemetryCollector
Telemetry collector for swarm operations
SwarmTelemetryMetrics
Metrics collected during swarm execution
TelemetryData
Persistent telemetry data that can be saved/loaded from disk
TelemetryStats
Aggregated statistics for persistence
TokenCounts
Token counts for a single request/operation
TokenStats
Statistics for token usage
TokenUsageRegistry
Tracks usage by model, by operation type, and provides aggregation
TokenUsageSnapshot
Immutable snapshot of token usage state
TokenUsageTracker
Thread-safe token usage tracker for a single model or operation type
ToolExecution
A single tool execution record
ToolExecutionStats
Statistics about tool executions
ToolExecutionTracker
Thread-safe tool execution tracker

Enums§

FileChangeType
Type of file change
PrivacyLevel
Privacy level for telemetry data

Statics§

PERSISTENT_TELEMETRY
Global persistent telemetry (loaded on first access, saved on record)
TOKEN_USAGE
Global token usage registry
TOOL_EXECUTIONS
Global tool execution tracker

Functions§

get_persistent_stats
Get a snapshot of persistent telemetry
record_persistent
Record an execution to persistent telemetry

Type Aliases§

SubAgentExecId
Unique identifier for a sub-agent execution
SwarmExecId
Unique identifier for a swarm execution
ToolExecId
Unique identifier for a tool execution