Forrest logo
back to the promtool tool

promtool:tldr:05e41

promtool: Check if the rule files are valid or not (if present report errors).
$ promtool check rules ${rules_file-yml}
try on your machine

The command "promtool check rules ${rules_file-yml}" is used to check the syntax and validity of Prometheus recording rules defined in a YAML file. Here's a breakdown of the command:

  • "promtool": This is the command-line tool provided by Prometheus for various utility operations and rule checking.
  • "check": This sub-command of promtool is used to validate and check the correctness of Prometheus configuration files, including rules files.
  • "rules": This flag indicates that we want to check Prometheus recording rules specifically.
  • "${rules_file-yml}": This is a placeholder for the name of the rules file (in YAML format) that you want to check. The "-yml" part indicates the default file extension if "rules_file" variable is not set.

In order to use this command, you need to replace "${rules_file-yml}" with the actual name and path of your YAML rules file. The command will then execute the rule checking process and provide feedback on any syntax errors or rule configuration issues found in the file.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the promtool tool