Skip to main content
In this lesson we will learn about promtool. What is promtool? promtool is a command-line utility shipped with Prometheus. It helps with:
  • Validating Prometheus configuration files (for example, prometheus.yml) and rule files.
  • Validating metrics input formatting so Prometheus can scrape them.
  • Running ad hoc queries against a Prometheus server.
  • Debugging and profiling a Prometheus server.
  • Running unit tests for recording and alerting rules.
The image is a slide describing "Promtools," a utility tool for Prometheus, highlighting its functions such as validating configurations and metrics, and performing queries on a Prometheus server.
One of the most commonly used promtool commands is check config, which validates your Prometheus configuration file for syntax and unsupported fields before you apply it. Example: validate a local Prometheus configuration file:
Below is a minimal scrape_configs snippet with the correct field name metrics_path. Note the plural form (metrics_path)—this is the correct property.
If you accidentally introduce a typo—for example using metric_path (singular) instead of metrics_path—promtool will detect it and point to the offending line and field:
Running promtool check config on a file containing that typo produces an error similar to:
Use promtool check config before reloading or restarting Prometheus to avoid downtime caused by invalid configuration changes.
Using promtool in this way prevents accidental outages caused by invalid configs. Throughout this course, we will introduce additional promtool features as they become relevant to the topics being covered.

Watch Video