clean-doctor-99713
11/07/2025, 2:04 PMtall-airline-16756
11/07/2025, 2:05 PMtall-airline-16756
11/07/2025, 2:05 PMmetrics_collected event, and tools like the UsageCollector make it easier to bring all that data together for you to analyze. When it comes to tracing, LiveKit supports OpenTelemetry, which means you can send trace data to platforms like Langfuse, Honeycomb, or Jaeger seamlessly.
If you'd like a hand setting up metrics collection or getting OpenTelemetry tracing configured, just let me know which part you'd like to dive into, and I’ll be happy to walk you through it step-by-step.
Sources: livekit/livekit_metrics.pb.go | docs/index.yaml | livekit-agents/livekit/agents/telemetry/__init__.py | Logs, metrics, and telemetry | LiveKit Docs | Logs, metrics, and telemetry | LiveKit docsclean-doctor-99713
11/07/2025, 2:06 PMtall-airline-16756
11/07/2025, 2:06 PMset_tracer_provider function in LiveKit works. It sets up OpenTelemetry tracing (spans) for you, but it doesn’t automatically export real-time metrics like STT, TTS, or LLM metrics. To make sure those metrics get exported, you’ll want to handle the metrics_collected event on the AgentSession or the individual components yourself.
For instance, a simple way to log metrics locally is by using this example:
from livekit.agents import metrics
@session.on("metrics_collected")
def _on_metrics_collected(ev):
metrics.log_metrics(ev.metrics)
Another option is to aggregate metrics with the UsageCollector, or you could attach them to OpenTelemetry spans using record_realtime_metrics. If you'd like, I’m here to walk you through any of these methods or help troubleshoot if you’re running into any issues with your current setup. Just let me know!
Sources: Logs, metrics, and telemetry | LiveKit docs | Logs, metrics, and telemetry | LiveKit Docs | metrics/send-metrics-to-3p/send_metrics_to_3p.py | livekit-agents/livekit/agents/telemetry/utils.py