PromQL: the Prometheus query language
cheat sheet · Ubuntu 24.04 · Prometheus 2.45 https://lab.dimsanych.ru/en/wiki/promql/Cheat sheet
- q is a short name for promtool query instant
-
q() { promtool query instant http://localhost:9090 "$1"; } -
q 'up'1: target alive, 0: not -
q 'up == 0'only the targets that are down -
q 'node_memory_MemAvailable_bytes'a metric's series by name -
q 'up{job="node"}'series with a given label -
q 'rate(node_cpu_seconds_total[1m])'counter → per-second rate -
q 'increase(prometheus_http_requests_total[5m])'growth -
q 'sum by (mode) (rate(node_cpu_seconds_total[1m]))'a sum -
q 'count by (job) (up)'targets in each job