Portal Community

On This Page

  1. Application-Level Capacity Guard
  2. Prometheus Metrics
  3. Alert Thresholds
  4. Prometheus Alert Rules
  5. Grafana Dashboard
  6. Health Endpoints
  7. Incident Runbooks
  8. Disaster Recovery Targets

Application-Level Capacity Guard

MinioCapacityGuard is the first line of defence. Before every write, it reads the MinIO Prometheus metrics endpoint, computes disk usage percentage, and throws StorageCapacityException (HTTP 507) if usage meets or exceeds the configured threshold.

SettingDefaultBehaviour
WriteStopThresholdPercent90.0Block all writes at or above this percentage
WriteStopThresholdPercent = 0Disable the guard entirely (useful for local dev)
Fail-open design If the Prometheus endpoint is unreachable (network partition, MinIO restart), the guard logs a warning and allows the write to proceed. Storage availability is prioritised over capacity enforcement in degraded states.

Prometheus Metrics

MinIO exposes a Prometheus-compatible metrics endpoint at {Endpoint}/minio/v2/metrics/cluster. The capacity guard reads two metrics:

MetricDescription
minio_node_disk_used_bytesTotal bytes currently used across all disks
minio_node_disk_total_bytesTotal disk capacity across all disks
minio_bucket_objects_countObject count per bucket (useful for monitoring growth)
minio_bucket_usage_total_bytesActual bytes stored per bucket
minio_s3_requests_totalTotal S3 API request count by type (GET, PUT, DELETE)
minio_s3_errors_totalTotal API errors — useful for detecting connectivity issues

Enable public Prometheus access in your MinIO Docker configuration:

environment:
  MINIO_PROMETHEUS_AUTH_TYPE: public

Alert Thresholds

Three alert levels are defined for disk usage. Each requires a different response:

LevelThresholdSeverityRequired Action
Info≥ 70%WarningReview storage growth rate. Plan capacity expansion within 30 days.
Warn≥ 85%HighImmediate capacity review. Expand or archive within 7 days.
Critical≥ 95%CriticalEmergency — application writes blocked at 90%. Act immediately.

Prometheus Alert Rules

groups:
  - name: bizfirst-storage
    rules:

      - alert: StorageDiskHigh
        expr: |
          sum(minio_node_disk_used_bytes) /
          sum(minio_node_disk_total_bytes) * 100 >= 70
        for: 5m
        labels:
          severity: warning
          team: infra
        annotations:
          summary: "MinIO disk usage above 70%"
          description: "Current usage: {{ $value | humanizePercentage }}"

      - alert: StorageDiskCritical
        expr: |
          sum(minio_node_disk_used_bytes) /
          sum(minio_node_disk_total_bytes) * 100 >= 85
        for: 2m
        labels:
          severity: high
          team: infra
        annotations:
          summary: "MinIO disk usage above 85% — action required"
          description: "Current usage: {{ $value | humanizePercentage }}"

      - alert: StorageDiskEmergency
        expr: |
          sum(minio_node_disk_used_bytes) /
          sum(minio_node_disk_total_bytes) * 100 >= 95
        for: 1m
        labels:
          severity: critical
          team: infra
        annotations:
          summary: "MinIO disk at 95% — writes will stop at 90%"
          description: "Current usage: {{ $value | humanizePercentage }}"

      - alert: StorageHighErrorRate
        expr: rate(minio_s3_errors_total[5m]) > 0.05
        for: 3m
        labels:
          severity: warning
        annotations:
          summary: "MinIO S3 error rate elevated"

      - alert: StorageBackupMissed
        expr: time() - bizfirst_last_backup_timestamp > 90000
        for: 0m
        labels:
          severity: high
        annotations:
          summary: "Storage backup has not run in over 25 hours"

Grafana Dashboard

Import the following panel configuration into Grafana (connected to your Prometheus data source):

PanelQueryVisualization
Disk Usage %sum(minio_node_disk_used_bytes)/sum(minio_node_disk_total_bytes)*100Gauge (thresholds at 70/85/95)
Disk Used (GB)sum(minio_node_disk_used_bytes)/1e9Stat
Disk Free (GB)sum(minio_node_disk_free_bytes)/1e9Stat
Objects per Bucketminio_bucket_objects_countBar chart
Request Raterate(minio_s3_requests_total[5m])Time series
Error Raterate(minio_s3_errors_total[5m])Time series

Health Endpoints

EndpointPurposeExpected Response
GET /minio/health/liveLiveness — MinIO process is runningHTTP 200
GET /minio/health/readyReadiness — MinIO is ready to serve requestsHTTP 200
GET /minio/v2/metrics/clusterPrometheus metrics scrape endpointHTTP 200 + text/plain metrics
# Quick health check from the application container
curl -f http://minio:9000/minio/health/live && echo "MinIO is healthy"

Incident Runbooks

Runbook 1 — Disk at 85–90% (StorageDiskCritical alert)

Check current usage

mc admin info local

Identify largest buckets/prefixes

mc du local/bizfirst-files --depth 2

Trigger manual lifecycle run

mc ilm tier ls local
mc admin lifecycle start local/bizfirst-files

Expand volume if needed

Add a new data volume to the MinIO container, or extend the Docker volume on the host.

Runbook 2 — StorageCapacityException in application logs

Application writes are already blocked. The disk is at or above WriteStopThresholdPercent (default 90%).

  1. Immediately review disk usage via MinIO console or mc admin info local.
  2. If growth is from a runaway process, stop the process first.
  3. Delete or archive large unnecessary objects to bring usage below the threshold.
  4. The capacity guard will automatically resume writes once usage drops below the threshold on the next write attempt.
Do not raise the threshold to clear the alert Raising WriteStopThresholdPercent above 95% risks MinIO running completely out of disk space, which causes data corruption. Fix the underlying capacity issue instead.

Runbook 3 — MinIO container down

  1. Check container status: docker ps -a | grep minio
  2. Inspect logs: docker logs bizfirst-minio --tail 100
  3. Common causes: out of disk space, port conflict, corrupted data volume.
  4. Restart: docker start bizfirst-minio
  5. If data is corrupted, restore from last restic backup. See Point-in-Time Restore.

Disaster Recovery Targets

ScenarioRPORTOMethod
MinIO container restart (no data loss)0< 2 minDocker restart
Host disk failure (data volume lost)< 24 hrs< 4 hrsrestic restore from B2
Accidental object deletion< 24 hrs< 1 hrSelective restic restore
Full host loss< 24 hrs< 8 hrsNew host + restic restore from B2