View Source SwarmEx.Telemetry (SwarmEx v0.2.0)
Telemetry integration for SwarmEx. Provides comprehensive metrics and event tracking for agent activities.
Event Categories
Agent Lifecycle Events
[:swarm_ex, :agent, :init]
- Agent initialization- Measurement:
:system_time
- Metadata:
:agent_id
,:network_id
,:correlation_id
- Measurement:
[:swarm_ex, :agent, :terminate]
- Agent termination- Measurement:
:system_time
,:uptime
- Metadata:
:agent_id
,:network_id
,:correlation_id
,:reason
- Measurement:
Message Processing Events
[:swarm_ex, :agent, :message, :start]
- Message processing start- Measurement:
:system_time
- Metadata:
:agent_id
,:message_type
,:network_id
,:correlation_id
,:message_size
- Measurement:
[:swarm_ex, :agent, :message, :stop]
- Message processing completion- Measurement:
:duration
(microseconds),:queue_time
(milliseconds) - Metadata:
:agent_id
,:message_type
,:network_id
,:correlation_id
,:result
- Measurement:
Tool Execution Events
[:swarm_ex, :tool, :execute, :start]
- Tool execution start- Measurement:
:system_time
- Metadata:
:tool_name
,:agent_id
,:network_id
,:correlation_id
,:args
- Measurement:
[:swarm_ex, :tool, :execute, :stop]
- Tool execution completion- Measurement:
:duration
(microseconds) - Metadata:
:tool_name
,:agent_id
,:network_id
,:correlation_id
,:result
- Measurement:
Health and Resource Events
[:swarm_ex, :health, :check]
- Periodic health check- Measurement:
:memory
(bytes),:process_count
,:message_queue_length
- Metadata:
:node
,:network_id
- Measurement:
[:swarm_ex, :agent, :memory]
- Agent memory usage- Measurement:
:memory
(bytes),:heap_size
(bytes),:stack_size
(bytes) - Metadata:
:agent_id
,:network_id
- Measurement:
Summary
Functions
Attaches telemetry event handlers and starts periodic health checks. Call this when your application starts.
Generates a new correlation ID for request tracing.
Emits agent memory usage metrics.
Emits an agent message event with timing and tracing information.
Emits a tool execution event with timing and tracing information.
Types
Functions
Attaches telemetry event handlers and starts periodic health checks. Call this when your application starts.
Options
:health_check_interval
- Interval in milliseconds between health checks. Defaults to 60_000 (1 minute)
Generates a new correlation ID for request tracing.
Emits agent memory usage metrics.
Emits an agent message event with timing and tracing information.
Emits a tool execution event with timing and tracing information.