Skip to main content
Promtool is the command-line utility bundled with Prometheus. It helps you validate configurations, test rules, and debug metric exposition so Prometheus can reliably scrape and evaluate targets. Common promtool use cases:
  • Validate Prometheus configuration files (for example, prometheus.yml) and rule files.
  • Validate metric exposition formats to ensure Prometheus can consume them.
  • Run ad hoc queries against a Prometheus server.
  • Debug and profile a Prometheus server.
  • Execute unit-style checks against recording and alerting rules.
Slide titled "Promtools" describing a Prometheus utility. It lists features: checking/validating configuration (Prometheus.yml and rules files), validating metric formatting, and performing queries on a Prometheus server.

Validate Prometheus configuration: promtool check config

One of the most useful promtool commands is check config. It parses and validates a Prometheus configuration file before you deploy it so you don’t accidentally bring Prometheus down with a bad config. Example — successful validation of /etc/prometheus/prometheus.yml:
If the configuration contains a typo or an unsupported field, promtool returns a parsing error and usually shows the line and field that caused the problem. For example, if metrics_path is misspelled as metric_path inside a scrape_config, promtool reports the offending line:
Minimal problematic snippet (typo: metric_path instead of metrics_path):
Promtool pointing to the exact line and field makes it fast to locate and fix configuration errors before reloading or restarting Prometheus.
Always validate Prometheus configuration files with promtool check config before reloading or restarting Prometheus in production to avoid downtime caused by invalid configs.

Useful promtool commands (quick reference)

Common error messages and remediation

Best practices

  • Always run promtool check config locally or in CI before applying config changes.
  • Save rule and config changes in version control so you can review diffs and run automated promtool checks in CI pipelines.
  • Pair promtool check rules with promtool test rules to verify alerting and recording rules behave as expected.
  • Use promtool check metrics <URL> when developing instrumented applications to ensure metrics are exposed in the correct format.

Watch Video