Grafana Mimir
Horizontally scalable long-term storage for Prometheus metrics.
Overview
Grafana Mimir is a horizontally scalable, highly available time series database specifically designed for long-term storage of Prometheus metrics. Born from Grafana Labs' experience with Cortex, Mimir addresses the limitations of Prometheus' local storage by providing unlimited retention, multi-tenancy, and the ability to scale storage and query performance independently. Unlike Prometheus' built-in storage which is limited by single-node constraints, Mimir can store years of metrics data while maintaining fast query performance across massive datasets.
This stack combines Mimir with MinIO as the S3-compatible object storage backend and Grafana for visualization, creating a complete metrics platform that can handle enterprise-scale monitoring workloads. MinIO serves as the durable storage layer where Mimir stores its blocks and metadata, eliminating the need for expensive cloud storage while providing the same S3 API compatibility. The integration allows Mimir to leverage MinIO's high-performance object storage for both recent and historical metric data, while Grafana connects directly to Mimir's Prometheus-compatible query API.
This configuration is ideal for organizations that have outgrown single-node Prometheus deployments or need to retain metrics for extended periods for capacity planning, compliance, or historical analysis. DevOps teams managing multiple Prometheus instances can consolidate their metrics into Mimir for centralized querying, while platform engineers can provide a multi-tenant metrics service to multiple teams. The combination provides enterprise-grade metrics storage without vendor lock-in or cloud storage costs.
Key Features
- Prometheus remote_write compatibility for drop-in replacement of Prometheus storage
- Multi-tenancy support with per-tenant query isolation and rate limiting
- Horizontal scaling with independent scaling of ingestion, querying, and storage components
- S3-compatible object storage backend via MinIO for cost-effective long-term retention
- PromQL query federation across multiple Prometheus instances and tenants
- Grafana native integration with Prometheus datasource compatibility
- Block-based storage format optimized for time series data compression and query performance
- Built-in compaction and downsampling for storage efficiency over time
Common Use Cases
- 1Consolidating metrics from multiple Prometheus instances into centralized long-term storage
- 2Multi-tenant SaaS platforms providing isolated metrics storage per customer or team
- 3Financial services requiring extended metrics retention for regulatory compliance
- 4Large-scale Kubernetes environments exceeding single Prometheus node capacity
- 5Hybrid cloud deployments needing unified metrics storage across multiple data centers
- 6Cost optimization by replacing expensive cloud object storage with self-hosted MinIO
- 7Historical capacity planning and trend analysis across years of infrastructure metrics
Prerequisites
- Minimum 4GB RAM (2GB for Mimir, 2GB for MinIO, 512MB for Grafana)
- Available ports 3000, 8080, 9000, and 9001 for service access
- Mimir configuration file at ./mimir/mimir.yaml with MinIO backend settings
- Environment variables MINIO_PASSWORD and GRAFANA_PASSWORD configured
- Understanding of PromQL and Prometheus remote_write configuration
- Basic knowledge of S3 API and object storage concepts for MinIO management
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 minio: 3 image: minio/minio:latest4 container_name: mimir-minio5 command: server /data --console-address ":9001"6 environment: 7 MINIO_ROOT_USER: mimir8 MINIO_ROOT_PASSWORD: ${MINIO_PASSWORD}9 volumes: 10 - minio_data:/data11 ports: 12 - "9000:9000"13 - "9001:9001"14 networks: 15 - mimir-network1617 mimir: 18 image: grafana/mimir:latest19 container_name: mimir20 restart: unless-stopped21 command: 22 - --config.file=/etc/mimir/mimir.yaml23 volumes: 24 - ./mimir/mimir.yaml:/etc/mimir/mimir.yaml:ro25 ports: 26 - "8080:8080"27 depends_on: 28 - minio29 networks: 30 - mimir-network3132 grafana: 33 image: grafana/grafana:latest34 container_name: grafana35 restart: unless-stopped36 environment: 37 GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD}38 ports: 39 - "3000:3000"40 depends_on: 41 - mimir42 networks: 43 - mimir-network4445volumes: 46 minio_data: 4748networks: 49 mimir-network: 50 driver: bridge.env Template
.env
1MINIO_PASSWORD=changeme1232GRAFANA_PASSWORD=adminUsage Notes
- 1Docs: https://grafana.com/docs/mimir/latest/
- 2Prometheus remote_write endpoint: http://localhost:8080/api/v1/push
- 3Create mimir/mimir.yaml config before starting
- 4MinIO provides S3-compatible storage backend
- 5Horizontally scalable - add more Mimir instances for HA
- 6Grafana datasource: add as Prometheus type with Mimir URL
Individual Services(3 services)
Copy individual services to mix and match with your existing compose files.
minio
minio:
image: minio/minio:latest
container_name: mimir-minio
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: mimir
MINIO_ROOT_PASSWORD: ${MINIO_PASSWORD}
volumes:
- minio_data:/data
ports:
- "9000:9000"
- "9001:9001"
networks:
- mimir-network
mimir
mimir:
image: grafana/mimir:latest
container_name: mimir
restart: unless-stopped
command:
- "--config.file=/etc/mimir/mimir.yaml"
volumes:
- ./mimir/mimir.yaml:/etc/mimir/mimir.yaml:ro
ports:
- "8080:8080"
depends_on:
- minio
networks:
- mimir-network
grafana
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: unless-stopped
environment:
GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD}
ports:
- "3000:3000"
depends_on:
- mimir
networks:
- mimir-network
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 minio:5 image: minio/minio:latest6 container_name: mimir-minio7 command: server /data --console-address ":9001"8 environment:9 MINIO_ROOT_USER: mimir10 MINIO_ROOT_PASSWORD: ${MINIO_PASSWORD}11 volumes:12 - minio_data:/data13 ports:14 - "9000:9000"15 - "9001:9001"16 networks:17 - mimir-network1819 mimir:20 image: grafana/mimir:latest21 container_name: mimir22 restart: unless-stopped23 command:24 - --config.file=/etc/mimir/mimir.yaml25 volumes:26 - ./mimir/mimir.yaml:/etc/mimir/mimir.yaml:ro27 ports:28 - "8080:8080"29 depends_on:30 - minio31 networks:32 - mimir-network3334 grafana:35 image: grafana/grafana:latest36 container_name: grafana37 restart: unless-stopped38 environment:39 GF_SECURITY_ADMIN_PASSWORD: ${GRAFANA_PASSWORD}40 ports:41 - "3000:3000"42 depends_on:43 - mimir44 networks:45 - mimir-network4647volumes:48 minio_data:4950networks:51 mimir-network:52 driver: bridge53EOF5455# 2. Create the .env file56cat > .env << 'EOF'57MINIO_PASSWORD=changeme12358GRAFANA_PASSWORD=admin59EOF6061# 3. Start the services62docker compose up -d6364# 4. View logs65docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/mimir/run | bashTroubleshooting
- Mimir fails to start with 'no such file or directory': Create ./mimir/mimir.yaml configuration file with proper MinIO backend settings before starting containers
- MinIO connection refused errors in Mimir logs: Verify minio service is fully started and accessible on port 9000 before Mimir attempts connection
- Grafana shows 'Bad Gateway' when querying Mimir: Check that Mimir container is running and accessible on port 8080, verify network connectivity between containers
- Out of memory errors during metric ingestion: Increase Docker memory limits and ensure adequate memory allocation for Mimir's ingestion components
- Slow query performance on historical data: Verify MinIO storage performance and check Mimir compaction settings for proper block organization
- Authentication failed errors: Ensure MINIO_ROOT_USER matches credentials configured in Mimir's S3 backend configuration
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
mimirminiografana
Tags
#mimir#grafana#prometheus#metrics#scalable
Category
Monitoring & ObservabilityAd Space
Shortcuts: C CopyF FavoriteD Download