Is there any configurations that I can to get metr...
# ask-ai
n
Is there any configurations that I can to get metrics from agent conversations. for ex - latency and other if available
t
Thanks for reaching out, Vinay. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You can collect detailed metrics from agent conversations in LiveKit, including latency and various performance indicators. How to Collect Metrics: • Subscribe to the
metrics_collected
event on the
AgentSession
to receive metrics in real time. • Metrics include LLM (latency, time to first token, token usage), STT (audio duration, transcript time), TTS, and VAD performance data. • To aggregate metrics across a session, use the
UsageCollector
class. • For conversation latency, you can calculate total latency using:
total_latency = eou.end_of_utterance_delay + llm.ttft + tts.ttfb
• OpenTelemetry integration is available for advanced trace-based observability. • You can also process and forward metrics to external systems for custom analysis. These tools allow you to monitor and optimize agent performance in real time, providing comprehensive insights into latency and other key metrics. Let me know if you need code examples or details on a specific metric type. Sources: Capturing metrics | LiveKit Docs | metrics/send-metrics-to-3p/metrics_server/README.md | Logs, metrics, and telemetry | LiveKit Docs