--- title: Recording rules sort_rank: 2 --- # Defining recording rules ## Configuring rules Prometheus supports two types of rules which may be configured and then evaluated at regular intervals: recording rules and [alerting rules](alerting_rules.md). To include rules in Prometheus, create a file containing the necessary rule statements and have Prometheus load the file via the `rule_files` field in the [Prometheus configuration](configuration.md). The rule files can be reloaded at runtime by sending `SIGHUP` to the Prometheus process. The changes are only applied if all rule files are well-formatted. ## Syntax-checking rules To quickly check whether a rule file is syntactically correct without starting a Prometheus server, install and run Prometheus's `promtool` command-line utility tool: ```bash go get github.com/prometheus/prometheus/cmd/promtool promtool check-rules /path/to/example.rules ``` When the file is syntactically valid, the checker prints a textual representation of the parsed rules to standard output and then exits with a `0` return status. If there are any syntax errors, it prints an error message to standard error and exits with a `1` return status. On invalid input arguments the exit status is `2`. ## Recording rules Recording rules allow you to precompute frequently needed or computationally expensive expressions and save their result as a new set of time series. Querying the precomputed result will then often be much faster than executing the original expression every time it is needed. This is especially useful for dashboards, which need to query the same expression repeatedly every time they refresh. To add a new recording rule, add a line of the following syntax to your rule file: [{