How to Set Up MinIO Enterprise Monitoring with Prometheus & Grafana
This guide walks you through configuring MinIO's enterprise monitoring panel, generating Prometheus metrics for clusters, nodes, buckets, and resources, integrating them into Grafana dashboards, and verifying successful data collection to enhance data management and operational efficiency.
With the rise of big data, enterprises need reliable storage monitoring; MinIO offers an enterprise‑grade monitoring panel that integrates with Prometheus and Grafana to ensure data safety and availability.
1. Create MinIO client and configure connection
<code>$ kubectl run minio-client --rm -it --image 172.139.20.170:5000/library/minio/minio-client:2024.10.29-debian-12-r1 -- bash
If you don’t see a command prompt, try pressing enter.
I have no name!@minio-client:/opt/bitnami/minio-client$ mc alias set 'minio' 'http://minio-headless.kube-system.svc:9000' admin clouD@0209
mc: Configuration written to `/.mc/config.json`. Please update your access credentials.
mc: Successfully created `/.mc/share`.
mc: Initialized share uploads `/.mc/share/uploads.json` file.
mc: Initialized share downloads `/.mc/share/downloads.json` file.
Added `minio` successfully.</code>2. Generate Prometheus metrics for MinIO
Run the following commands to obtain metrics for the cluster, node, bucket, and resource:
<code>I have no name!@minio-client:/opt/bitnami/minio-client$ mc admin prometheus generate minio
scrape_configs:
- job_name: minio-job
bearer_token: <redacted>
metrics_path: /minio/v2/metrics/cluster
scheme: http
static_configs:
- targets: ['minio-headless.kube-system.svc:9000']
I have no name!@minio-client:/opt/bitnami/minio-client$ mc admin prometheus generate minio node
scrape_configs:
- job_name: minio-job-node
bearer_token: <redacted>
metrics_path: /minio/v2/metrics/node
scheme: http
static_configs:
- targets: ['minio-headless.kube-system.svc:9000']
I have no name!@minio-client:/opt/bitnami/minio-client$ mc admin prometheus generate minio bucket
scrape_configs:
- job_name: minio-job-bucket
bearer_token: <redacted>
metrics_path: /minio/v2/metrics/bucket
scheme: http
static_configs:
- targets: ['minio-headless.kube-system.svc:9000']
I have no name!@minio-client:/opt/bitnami/minio-client$ mc admin prometheus generate minio resource
scrape_configs:
- job_name: minio-job-resource
bearer_token: <redacted>
metrics_path: /minio/v2/metrics/resource
scheme: http
static_configs:
- targets: ['minio-headless.kube-system.svc:9000']</code>3. Configure Prometheus to scrape MinIO metrics (GitLab example)
<code>$ kubectl -n kube-system edit cm prometheus
- job_name: minio
bearer_token: <redacted>
metrics_path: /minio/v2/metrics/cluster
scheme: http
static_configs:
- targets: ['minio.kube-system.svc:9000']
- job_name: minio-node
bearer_token: <redacted>
metrics_path: /minio/v2/metrics/node
scheme: http
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- action: keep
source_labels: [__meta_kubernetes_namespace, __meta_kubernetes_endpoints_name, __meta_kubernetes_endpoint_port_name]
regex: kube-system;minio;minio-api
- job_name: minio-bucket
bearer_token: <redacted>
metrics_path: /minio/v2/metrics/bucket
scheme: http
static_configs:
- targets: ['minio.kube-system.svc:9000']
- job_name: minio-resource
bearer_token: <redacted>
metrics_path: /minio/v2/metrics/resource
scheme: http
static_configs:
- targets: ['minio.kube-system.svc:9000']</code>4. Verify metric collection
<code>$ curl -s $(kubectl -n kube-system get svc prometheus -ojsonpath='{.spec.clusterIP}:{.spec.ports[0].port}')/prometheus/api/v1/query --data-urlencode 'query=up{job=~"minio.*"}' | jq '.data.result[] | {job: .metric.job, instance: .metric.instance ,status: .value[1]}'
{ "job": "minio-bucket", "instance": "minio.kube-system.svc:9000", "status": "1" }
{ "job": "minio-resource", "instance": "minio.kube-system.svc:9000", "status": "1" }
{ "job": "minio", "instance": "minio.kube-system.svc:9000", "status": "1" }
{ "job": "minio-node", "instance": "10.244.85.203:9000", "status": "1" }
... (additional node instances) ...</code>5. Add Grafana dashboards for MinIO
Import the following dashboard IDs into Grafana: 19237 (MinIO Bucket) and 13502 (MinIO Grafana). Also import the JSON file from
raw.githubusercontent.com/minio/minio/master/docs/metrics/prometheus/grafana/node/minio-node.json.
Tip: To collect all MinIO server instances for the node job, use the endpoint discovery method.
Below are example screenshots of the resulting Grafana panels:
Conclusion
MinIO's enterprise monitoring panel is a powerful tool that simplifies storage management, boosts operational efficiency, and strengthens data security and service stability, positioning enterprises to meet future challenges and stay competitive.
Linux Ops Smart Journey
The operations journey never stops—pursuing excellence endlessly.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.