examples/monitoring/README.md
This directory contains a ready-to-use monitoring setup for SGLang using Prometheus and Grafana.
python -m sglang.launch_server --model-path meta-llama/Meta-Llama-3.1-8B-Instruct --port 30000 --enable-metrics
By default, the metrics server will run on 127.0.0.1:30000.
cd examples/monitoring
docker compose up
Default Grafana login credentials:
adminadminYou'll be prompted to change the password on first login.
If you see errors like "port is already allocated":
Check if you already have Prometheus or Grafana running:
docker ps | grep -E 'prometheus|grafana'
Stop any conflicting containers:
docker stop <container_id>
Ensure no other services are using ports 9090 and 3000:
lsof -i :9090
lsof -i :3000
If Grafana cannot connect to Prometheus:
prometheus.yamldocker-compose.yamlgrafana/datasources/datasource.yamlgrafana/dashboards/config/dashboard.yamlgrafana/dashboards/json/sglang-dashboard.jsonYou can customize the monitoring setup by modifying the configuration files as needed.