grafana / mimir

Grafana Mimir provides horizontally scalable, highly available, multi-tenant, long-term storage for Prometheus.
https://grafana.com/oss/mimir/
GNU Affero General Public License v3.0
4.05k stars 515 forks source link

Unify direct and caching `RuleStore`s in ruler #9434

Open 56quarters opened 2 days ago

56quarters commented 2 days ago

What this PR does

Instead of using two different RuleStore implementations within the Ruler, use a single caching implementation and selectively disable caching when required.

This change removes the "direct" RuleStore implementation from the Ruler's gRPC and HTTP API layers. Instead, the caching implementation is used for all calls. In cases where caching returning stale results would not be acceptable, the caching is disabled just for that call.

This allows rule group contents to be safety cached with the understanding that it is safe to cache them because they will correctly invalidated when deleted or modified.

Which issue(s) this PR fixes or relates to

Part of #9386

Checklist