Prometheus CLI Commands Reference
Useful Prometheus commands for reloading configuration and enabling management endpoints.
Reload configuration without restart
# Via the /-/reload HTTP endpoint (requires --web.enable-lifecycle flag)
curl -s -XPOST http://localhost:9090/-/reload
Enable the lifecycle API (edit startup flags)
# Run Prometheus with lifecycle endpoint enabled
./prometheus --web.enable-lifecycle --config.file=prometheus.yml
Or in /etc/systemd/system/prometheus.service:
ExecStart=/usr/local/bin/prometheus \
--config.file=/etc/prometheus/prometheus.yml \
--storage.tsdb.path=/var/lib/prometheus \
--web.enable-lifecycle
sudo systemctl daemon-reload && sudo systemctl restart prometheus
Check Prometheus health
curl -s http://localhost:9090/-/healthy
curl -s http://localhost:9090/-/ready
Query the API
# Instant query
curl 'http://localhost:9090/api/v1/query?query=up'
# Range query
curl 'http://localhost:9090/api/v1/query_range?query=rate(http_requests_total[5m])&start=2024-01-01T00:00:00Z&end=2024-01-01T01:00:00Z&step=60s'