Skip to content

mconf/livekit-healthchecker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LiveKit Health Checker

This application performs periodic health checks against a LiveKit instance to ensure it is reachable and operational. The health check is done externally via a full client connection procedure, including:

  • Room creation
  • Signaling establishment
  • WebRTC connection establishment
  • Teardown

The goal is for this to be an E2E health checker that takes into account most of the moving parts of a LiveKit deployment from an end-user perspective.

Configuration

The application is configured using environment variables.

Variable Description Default
LIVEKIT_HOST The WebSocket URL of the LiveKit server. ws://localhost:7880
LIVEKIT_API_KEY The API key for connecting to LiveKit. (none)
LIVEKIT_API_SECRET The API secret for connecting to LiveKit. (none)
HEALTHCHECK_INTERVAL The interval at which to perform health checks (e.g., 30s, 1m, 5m). 1m
HEALTHCHECK_ABORT_BOOT_ON_FAILURE If true, the application will exit if the initial health check fails. false
PROMETHEUS_ENABLED If true, exposes a /metrics endpoint for Prometheus. true
PROMETHEUS_LISTEN_ADDRESS The address and port for the Prometheus metrics server. 127.0.0.1:3201

Running the Application

Using go run

To run the application directly from the source code, you can use the go run command.

# Set the required environment variables
export LIVEKIT_HOST="ws://your-livekit-host:7880"
export LIVEKIT_API_KEY="your-api-key"
export LIVEKIT_API_SECRET="your-api-secret"

# Run the application
go run .

Using Docker

The application can also be run as a Docker container.

  1. Build the Docker image:

    Build the image:

    docker build -t livekit-healthcheck .
  2. Run the Docker container:

    Run the container, passing the configuration as environment variables.

    docker run --rm -it \
      -e LIVEKIT_HOST="ws://your-livekit-host:7880" \
      -e LIVEKIT_API_KEY="your-api-key" \
      -e LIVEKIT_API_SECRET="your-api-secret" \
      -e HEALTHCHECK_INTERVAL="30s" \
      --network="host" \
      livekit-healthcheck

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors