| Start Prometheus |
./prometheus --config.file=prometheus.yml |
Run Prometheus with config file. |
| Query metrics |
curl 'http://localhost:9090/api/v1/query?query=node_cpu_seconds_total' |
Query metrics via API. |
| Check targets |
http://localhost:9090/targets |
View scrape targets in browser. |
| Reload config |
kill -HUP <prometheus_pid> |
Reload Prometheus configuration. |
| Check version |
prometheus --version |
Show Prometheus version. |
| PromQL example |
rate(http_requests_total[5m]) |
Calculate per-second rate over 5 minutes. |
| List rules |
http://localhost:9090/rules |
View alerting and recording rules. |
| View alerts |
http://localhost:9090/alerts |
See active alerts. |