Documentation

mc admin prometheus generate

Description

The mc admin prometheus generate command generates a metrics scraping configuration file for use with Prometheus.

For more complete documentation on using MinIO with Prometheus, see How to monitor MinIO server with Prometheus

Use mc admin on MinIO Deployments Only

MinIO does not support using mc admin commands with other S3-compatible services, regardless of their claimed compatibility with MinIO deployments.

The following command generates a Prometheus scrape configuration that collects bucket metrics from the deployment at alias myminio:

mc admin prometheus generate myminio bucket

The command has the following syntax:

mc [GLOBALFLAGS] admin prometheus generate  \
                                  ALIAS     \
                                  [TYPE]
  • Brackets [] indicate optional parameters.

  • Parameters sharing a line are mutually dependent.

  • Parameters separated using the pipe | operator are mutually exclusive.

Copy the example to a text editor and modify as-needed before running the command in the terminal/shell.

Parameters

ALIAS
Required

The alias of a configured MinIO deployment for which the command generates a Prometheus-compatible configuration file.

TYPE
Optional

The type of metrics to scrape.

Changed in version RELEASE.2023-10-07T15-07-38Z: resource metrics added

Valid values are:

  • bucket

  • cluster

  • node

  • resource

If not specified, the command returns cluster metrics. Cluster metrics also include node metrics.

Global Flags

This command supports any of the global flags.

Example

Generate a scrape config for bucket metrics

Use mc admin prometheus generate to generate a scrape configuration that collects bucket metrics for a MinIO deployment:

   mc admin prometheus generate ALIAS bucket
  • Replace ALIAS with the alias of the MinIO deployment.

The output resembles the following:

scrape_configs:
- job_name: minio-job-bucket
  bearer_token: [auth token]
  metrics_path: /minio/v2/metrics/bucket
  scheme: http
  static_configs:
  - targets: ['localhost:9000']