This is archived documentation for v2.0.x. Go to the latest version.
(Optional) Grafana Mimir ruler
The ruler is an optional component that evaluates PromQL expressions defined in recording and alerting rules. Each tenant has a set of recording and alerting rules and can group those rules into namespaces.
The ruler evaluates the expressions in the recording rules at regular intervals and writes the results back to the ingesters. The ruler has a built-in querier that evaluates the PromQL expressions and a built-in distributor, so that it can write directly to the ingesters. Configuration of the built-in querier and distributor uses their respective configuration parameters:
The ruler evaluates the expressions in alerting rules at regular intervals and if the result includes any series, the alert becomes active.
If an alerting rule has a defined
for duration, it enters the PENDING (
After the alert has been active for the entire
for duration, it enters the FIRING (
The ruler then notifies Alertmanagers of any FIRING (
Configure the addresses of Alertmanagers with the
-ruler.alertmanager-url flag, which supports the DNS service discovery format.
For more information about DNS service discovery, refer to Supported discovery modes.
The ruler supports multi-tenancy and horizontal scalability. To achieve horizontal scalability, the ruler shards the execution of rules by rule groups. Ruler replicas form their own hash ring stored in the KV store to divide the work of the executing rules.
To configure the rulers’ hash ring, refer to configuring hash rings.
HTTP configuration API
The ruler HTTP configuration API enables tenants to create, update, and delete rule groups. For a complete list of endpoints and example requests, refer to ruler.
The ruler uses the backend configured via
The ruler supports the following backends:
- Amazon S3:
- Google Cloud Storage:
- Microsoft Azure Storage:
- OpenStack Swift:
- Local storage:
local storage backend reads Prometheus recording rules from the local filesystem.
Note: Local storage is a read-only backend that does not support the creation and deletion of rules through the Configuration API.
When all rulers have the same rule files, local storage supports ruler sharding. To facilitate sharding in Kubernetes, mount a Kubernetes ConfigMap into every ruler pod.
The following example shows a local storage definition:
The ruler looks for tenant rules in the
/tmp/rules/<TENANT ID> directory.
The ruler requires rule files to be in the Prometheus format.
Related Mimir resources
How to control metrics growth in Prometheus and Kubernetes with Grafana Cloud
This webinar will introduce a metrics cost management framework to optimize metrics growth while keeping rising costs at bay with Grafana Cloud.
Intro to Grafana Mimir: The open source time series database that scales to 1 billion metrics & beyond
Grafana Mimir webinar—learn about our open source solution for extending Prometheus at organizations needing massive scale, rapid query performance.
For billion-series scale or home IoT projects, get started in minutes with Grafana Mimir
Learn how easy it is to get started with Mimir, no matter how many or few time series you need to store.