home / system-monitoring / promtool

promtool

Official · Prometheus
63k

Prometheus utility CLI for validating configs and rules, querying servers, linting metrics, and inspecting TSDB data.

$go install github.com/prometheus/prometheus/cmd/...
Language
Go
Stars
63,098
Agent
Ready
Agent Compatibility
JSON Output
Agent Skill
MCP Support
AI Analysis

promtool is Prometheus's utility CLI for checking, querying, testing, and debugging monitoring setups from the shell. It sits around a Prometheus deployment rather than replacing the server, giving you direct commands for validation, inspection, and TSDB-level maintenance tasks.

What It Enables
  • Validate Prometheus config files, rule files, web config, and discovered targets before rollout or in CI.
  • Query a Prometheus server, check health and readiness, inspect label values or series, and fetch debug data from the terminal.
  • Lint scraped metrics, unit test alerting or recording rules, dump or analyze TSDB blocks, and backfill blocks from OpenMetrics or recording rules.
Agent Fit
  • promtool query can emit JSON, and most commands use stable flags, stdout, and exit codes that fit unattended validation and follow-up parsing.
  • It works well in inspect, change, verify loops around Prometheus because agents can check configs, run rule tests, query live data, and inspect TSDB state without opening the UI.
  • Coverage is narrower than a general infrastructure CLI: many commands are read-only diagnostics, and server-facing actions depend on reachable Prometheus endpoints or local TSDB files.
Caveats
  • Some useful surfaces are explicitly experimental, including promql editing and parts of the TSDB tooling.
  • The recommended install path in the repo is released binaries from prometheus.io, so the current go install entry is more of a build path than the main end-user install flow.