Rules
Prometheus supports two types of rules which may be configured and then evaluated at regular intervals: recording rules and alerting rules.
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.
Recording and alerting rules exist in a rule group. Rules within a group are run sequentially at a regular interval.
https://prometheus.io/docs/prometheus/latest/configuration/recording_rules
Alerting Rules
Alerting rules allow you to define alert conditions based on Prometheus expression language expressions and to send notifications about firing alerts to an external service. Whenever the alert expression results in one or more vector elements at a given point in time, the alert counts as active for these elements' label sets.
https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules