Quick Start
To enable metrics collection, configure OpenTelemetry:http://localhost:9464/metrics.
MetricsCollector
TheMetricsCollector records metrics via normalized on_*() hooks that plugins call directly. Each Agent creates a root collector and merges child collectors from STT, TTS, LLM, and other components during initialization, so metrics collection is enabled by default.
If no OpenTelemetry providers are configured, metrics are no-ops and have no performance impact.
For new integrations, prefer the collector’s normalized on_* metric hooks and agent.metrics over provider-specific event classes.
Plugins record metrics through hooks such as:
- LLM —
on_llm_response,on_tool_call,on_llm_error - STT —
on_stt_transcript,on_stt_error - TTS —
on_tts_synthesis,on_tts_error - Turn Detection —
on_turn_ended - Realtime LLM —
on_realtime_audio_input/output,on_realtime_user/agent_transcription - VLM —
on_vlm_inference,on_vlm_error - Video Processors —
on_video_detection
Metric Attributes
All metrics include contextual attributes:Metrics Reference
All metrics use thevision_agents.core meter namespace.
STT Metrics
TTS Metrics
LLM Metrics
Turn Detection Metrics
Realtime LLM Metrics
For speech-to-speech models like OpenAI Realtime:VLM / Vision Metrics
Video Processor Metrics
AgentMetrics
For in-process metrics without external infrastructure, access aggregated metrics directly from the agent:Available AgentMetrics
Prometheus Setup
Export metrics to Prometheus for monitoring dashboards and alerting. Step 1 — Install the exporterhttp://localhost:9464/metrics.
Tracing with Jaeger
Trace requests across components for debugging latency issues. Step 1 — Install the exporterhttp://localhost:16686.
Complete Example
http://localhost:9464/metrics.
Example Prometheus Queries
OpenTelemetry metric names use dots (e.g.,
llm.latency.ms). Prometheus converts these to underscores when scraping (e.g., llm_latency_ms).Best Practices
Configure OpenTelemetry - Set up providers to enable metric collection. If no providers are configured, metrics are no-ops. MetricsCollector is automatic - Each Agent automatically creates a MetricsCollector internally. If no OpenTelemetry provider is configured, metrics are no-ops with no performance impact. Use AgentMetrics for simple logging - Accessagent.metrics directly for in-process metrics without external infrastructure.
Add resource attributes - Include service name and environment in your metrics:
- LLM latency > 2000ms (p95)
- Error rate > 1%
- Token usage anomalies
Next Steps
- Kubernetes Deployment - Helm chart with Prometheus and Grafana out of the box
- Built-in HTTP Server - Console mode and HTTP server for session management