Menu
Open source
Configure Grafana Mimir metrics storage retention
Grafana Mimir stores metrics in object storage.
By default, metrics that are stored in the object storage are never deleted, and the storage utilization will increase over time. You can configure the object storage retention to automatically delete all metrics data older than the configured period.
Configure the storage retention
The compactor is the Mimir component that is responsible for enforcing the storage retention.
To configure the storage retention, set the CLI flag -compactor.blocks-retention-period
or change the following YAML configuration:
yaml
limits:
# Delete from storage metrics data older than 1 year.
compactor_blocks_retention_period: 1y
To configure the storage retention on a per-tenant basis, set overrides in the runtime configuration:
yaml
overrides:
tenant1:
# Delete from storage tenant1's metrics data older than 1 year.
compactor_blocks_retention_period: 1y
tenant2:
# Delete from storage tenant2's metrics data older than 2 years.
compactor_blocks_retention_period: 2y
tenant3:
# Disable retention for tenant3's metrics (never delete its data).
compactor_blocks_retention_period: 0
Per-series retention
Grafana Mimir doesn’t support per-series deletion and retention, nor does it support Prometheus’ Delete series API.
Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
60 min
Intro to metrics with Grafana: Prometheus, Grafana Mimir, and beyond
In this webinar, we’ll go over challenges when scaling metrics systems, with a particular focus on Prometheus and Grafana Mimir.
Video
Scaling and securing your Prometheus metrics in Grafana Cloud
In this webinar, we’ll go over Grafana Enterprise Metrics (GEM), a simple and scalable Prometheus service that is seamless to use, and simple to maintain
12 min read
Less is more: How Grafana Mimir queries run faster and more cost efficiently with fewer indexes
By avoiding inverted index lookups in the Prometheus TSDB, Mimir's memory usage was reduced by up to 64%.