Configure Grafana Mimir metrics storage retention
Grafana Mimir stores the metrics in a 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 of the 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:
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:
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
Grafana Mimir doesn’t support per-series deletion and retention, nor does it support Prometheus’ Delete series API.
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.