magnificent-furniture-73003
05/15/2026, 11:47 AMtall-airline-16756
05/15/2026, 11:47 AMtall-airline-16756
05/15/2026, 11:48 AMlistRooms() / room.list_rooms()) to get all active rooms and read the count. This works from LiveKit server SDKs (Node/Python).
◦ Example (Node):
const roomService = new RoomServiceClient(url, apiKey, apiSecret);
const rooms = await roomService.listRooms();
console.log(`Number of rooms: ${rooms.rooms.length}`);
• Example (Python):
from livekit import api
lkapi = api.LiveKitAPI(url, api_key, api_secret)
rooms = await lkapi.room.list_rooms()
print(len(rooms.items))
• Use Prometheus metrics the server exposes. LiveKit emits room lifecycle metrics you can scrape and visualize to track total/active rooms and trends over time.
• Use webhooks for room_started and room_finished events to get real‑time notifications and maintain your own count/history.
Notes:
• Rooms are created dynamically when the first participant joins and are removed based on your server’s timeout configuration (e.g., empty_timeout), so counts are runtime values, not pre-provisioned.
• If you want, tell me which SDK/language you’re using or whether you prefer metrics or webhooks, and I’ll give exact code or Prometheus metric names you can use., with interactive elementsmagnificent-furniture-73003
05/15/2026, 11:48 AMtall-airline-16756
05/15/2026, 11:49 AM/metrics endpoint.
◦ Example job (replace host/port):
- job_name: 'livekit'
static_configs:
- targets: ['livekit-host:7979']
1. Useful metrics to monitor
◦ LiveKit exports operational, room, and participant metrics. Specific names may vary, but typical useful metrics are:
▪︎ room lifecycle counters (total rooms created / finished)
▪︎ current active rooms (gauge)
▪︎ participant counts per room (gauge)
▪︎ session durations (histogram/summary)
▪︎ data/packet/bitrate metrics for tracks
◦ If you do not see a specific room metric, use webhook events (room_started / room_finished) to increment a custom Prometheus counter in your service.
1. Example PromQL queries
◦ Current active rooms (if gauge exists): sum(livekit_rooms_active)
◦ Total rooms created (counter): increase(livekit_rooms_created_total[1h])
◦ Participants across all rooms: sum(livekit_participants_connected)
◦ Average session duration: histogram_quantile(0.95, sum(rate(livekit_session_duration_seconds_bucket[5m])) by (le))
1. If metric names are missing
◦ Create and export custom metrics in a small service that receives LiveKit webhooks (room_started, room_finished) and exposes Prometheus counters/gauges. See Creating and Publishing Custom Metrics: Creating and Publishing Custom Metrics
Next step Tell me which environment you use (K8s/Helm, Docker Compose, or binary) and whether you want example Prometheus scrape config, Grafana dashboard queries, or a webhook-to-metrics snippet — I’ll provide exact configs/code.
Sources: Creating and Publishing Custom Metrics, with interactive elementsmagnificent-furniture-73003
05/15/2026, 1:18 PMTwirpError(code=unknown, message=twirp error unknown: update room failed: could not connect after timeout, status=500)tall-airline-16756
05/15/2026, 1:18 PMupdate room failed: could not connect after timeout, status=500.
To help diagnose and fix this, please share:
• Which SDK/language and LiveKit server version you’re using.
• Deployment type (Kubernetes/Helm, Docker Compose, single binary, or LiveKit Cloud).
• When this happens: on room create, update, or when a participant joins? Repro steps.
• Recent changes (config, network, scaling) before the error started.
• Any relevant server logs around the error (LiveKit server and any gateway/proxy) and the client SDK logs.
Meanwhile try these checks:
• Verify network connectivity from the component calling LiveKit’s Room service to the LiveKit server (curl/telnet to the Twirp endpoint).
• Check LiveKit server logs for the same timestamp — look for connection timeouts, RPC errors, or resource saturation (CPU/memory).
• If behind a proxy/load balancer, confirm idle/timeouts and max connections aren’t closing Twirp calls prematurely.
• Ensure API key/secret and TLS settings are correct for the Room service client.
• Restart the LiveKit process that handles room updates to rule out transient state.
• If using multiple LiveKit nodes, confirm the caller is reaching the correct node or a healthy gateway (sticky routing if required).
If you can paste the SDK call code (redact secrets), a short server log excerpt around the error, and your deployment type, I’ll provide targeted next steps and commands to run.
, with interactive elements