Prometheus28 commands
Prometheus & PromQL Cheat Sheet
Essential PromQL queries and Prometheus commands for metrics, alerting, service discovery, and dashboarding.
Basic Queries
| Command | Description |
|---|---|
| Check if targets are up (1) or down (0) |
| Total CPU seconds by mode |
| Filter by label value |
| Regex match (5xx errors) |
| Negative match |
| Range vector (last 5 minutes) |
Aggregation & Math
| Command | Description |
|---|---|
| Per-second request rate |
| Total increase over 1 hour |
| Sum rate grouped by status |
| Average by instance |
| Top 5 by request rate |
| Count healthy targets |
| P99 latency |
Common Patterns
| Command | Description |
|---|---|
| CPU usage % |
| Memory usage % |
| Disk usage % |
| Error rate % |
| Disk full in 4 hours? |
Alert Rules
| Command | Description |
|---|---|
| Alert when target down for 5m |
| Alert on high error rate |
| Disk space < 10% |
| Set alert severity label |
| Alert annotation template |
promtool & Admin
| Command | Description |
|---|---|
| Validate config file |
| Validate alert rules |
| Hot-reload config |
| List scrape targets |
| Query via HTTP API |