List active alerts prometheus
Show only firing alerts with name and severity
curl -s http://prometheus:9090/api/v1/alerts | jq '.data.alerts[] | select(.state=="firing") | {name: .labels.alertname, severity: .labels.severity}'
more prometheus
all 30 commands →
List all metric names
curl -s http://prometheus:9090/api/v1/label/__name__/values | jq '.data | length, .[0:20]'
Series cardinality per job
count by (job) ({__name__=~".+"})
Silence an alert
amtool silence add alertname=HighMemory --duration=2h --comment='Investigating'
Check TSDB status
curl -s http://prometheus:9090/api/v1/status/tsdb | jq '{head_chunks: .data.headStats.numChunks, series: .data.headStats.numSeries}'
95th percentile latency from histogram
histogram_quantile(0.95, sum by(le,job)(rate(http_request_duration_seconds_bucket[5m])))