aloof-scooter-47164
05/25/2026, 2:57 PMtall-airline-16756
05/25/2026, 2:57 PMtall-airline-16756
05/25/2026, 2:57 PMaloof-scooter-47164
05/25/2026, 2:59 PMtall-airline-16756
05/25/2026, 2:59 PMup{job="livekit-agent"} or a livekit_worker_info metric with worker_id label).
• Use PromQL to compute the 24h average sessions per worker.
If you already have no metrics scraping (you answered “no”), next step is to enable metrics on the agent pods:
• Ensure the agent process exposes Prometheus metrics (HTTP /metrics).
• Add a Prometheus scrape config for the agent pod endpoints (or use ServiceMonitor if using Prometheus Operator).
Recommended metrics to expose (or create)
• A counter livekit_session_started_total{worker_id="<id>"} that increments when a session starts (or)
• A gauge livekit_worker_active_sessions{worker_id="<id>"} reporting current active sessions per worker.
Example PromQL (24‑hour avg)
1. If you have a session start counter:
◦ Sessions started per worker over 24h:
sum(increase(livekit_session_started_total[24h])) by (worker_id)
• Average sessions per worker (24h):
avg(sum(increase(livekit_session_started_total[24h])) by (worker_id))
1. If you have an active‑sessions gauge and want time‑averaged active sessions:
◦ Per worker 24h average:
avg_over_time(livekit_worker_active_sessions[24h]) by (worker_id)
• Overall average across workers:
avg(avg_over_time(livekit_worker_active_sessions[24h]) )
If you need a ratio of total sessions to worker count (workers may come and go):
• Total sessions started over 24h:
sum(increase(livekit_session_started_total[24h]))
• Worker count (instant or average over 24h):
count(up{job="livekit-agent"}) # instant avg_over_time(count_over_time(up{job="livekit-agent"}[5m])[24h]) # approximate
• 24h average sessions per worker:
sum(increase(livekit_session_started_total[24h])) / count(up{job="livekit-agent"})
How I can help next
• If you tell me which metric names your agent exposes (or paste a sample /metrics output), I’ll give the exact PromQL/Grafana panels.
• I can provide a scrape_config snippet for Prometheus or a ServiceMonitor for Prometheus Operator if you’re on Kubernetes. Sources: Voice Agent Architecture: STT, LLM, and TTS Pipelines Explained | LiveKit, with interactive elementsaloof-scooter-47164
05/26/2026, 12:30 AMtall-airline-16756
05/26/2026, 12:31 AMsession.start and room.connect in the LK agent?"
• room.connect
◦ Low‑level LiveKit SDK call that joins a participant to a LiveKit room (handles signaling/WebRTC, auth with a token, and media transport).
◦ Use it when you only need to establish the WebRTC connection for a client or participant.
• session.start
◦ High‑level Agents framework call that starts an agent session. It internally performs the room connection (via room.connect or equivalent) and also initializes the agent lifecycle: STT, LLM, TTS, VAD, I/O plumbing, and any agent orchestration logic.
◦ Use it when you want the full agent pipeline and session management rather than just a raw room join.
If you want, tell me which SDK/class you’re using (AgentSession vs Session vs plain Room) and I’ll point to the exact code paths or events that fire for each.
Sources: Agent session | LiveKit Documentation | How to Build a Background Observer for Voice AI Guardrails | LiveKit | Build agent experiences faster with Session APIs | LiveKit, with interactive elements