How would I be able to connect prometheus to send ...
# ask-ai
f
How would I be able to connect prometheus to send metrics all of the enhanced usage metrics
t
Thanks for reaching out, Roshan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm glad you're interested in connecting Prometheus to collect enhanced usage metrics from LiveKit! Let's walk through the steps together: 1. Enable Prometheus Scraping: LiveKit services offer a
/metrics
endpoint over HTTP. Just make sure this endpoint is accessible, and you're good to go. 2. Configure Prometheus Server: In your
prometheus.yml
file, add a scrape configuration that points to the LiveKit service's HTTP port (like 7880) and the
/metrics
endpoint. Here's an example to guide you:
Copy code
scrape_configs:
  - job_name: 'livekit'
    static_configs:
      - targets: ['<livekit-host>:<port>']
3. Use Built-in Metrics: LiveKit comes with handy metrics like
livekit_room_total
,
livekit_participant_total
, and
livekit_session_duration_ms
that you can start using right away. 4. Optional - Custom Metrics: If you want to get even more detailed, you can define and emit your own custom metrics using LiveKit's event system. 5. Enable Telemetry: Don’t forget to enable telemetry in your LiveKit configuration to ensure you’re capturing comprehensive metrics. And if you're self-hosting LiveKit with Kubernetes, there's an extra helpful option: you can use the Prometheus adapter for even more monitoring capabilities. If you have any questions along the way, feel free to ask—I'm here to help! Sources: Self-hosting the Ingress Service | LiveKit Docs | livekit-agents/livekit/agents/telemetry/http_server.py | Logs, metrics, and telemetry | LiveKit Docs | pkg/telemetry/prometheus/rooms.go | rpc/metrics.go