diff --git a/source/operations/checklists/software.rst b/source/operations/checklists/software.rst index 9c9703b9..d3eee548 100644 --- a/source/operations/checklists/software.rst +++ b/source/operations/checklists/software.rst @@ -58,9 +58,6 @@ MinIO Pre-requisites * - :octicon:`circle` - :ref:`Prometheus ` or a Prometheus-compatible setup for monitoring and metrics - * - :octicon:`circle` - - (optional) `Grafana `__ for custom dashboards - * - :octicon:`circle` - (optional) :mc:`mc` installed on the local host system diff --git a/source/operations/monitoring/collect-minio-metrics-using-prometheus.rst b/source/operations/monitoring/collect-minio-metrics-using-prometheus.rst index 086c46fe..58011ed2 100644 --- a/source/operations/monitoring/collect-minio-metrics-using-prometheus.rst +++ b/source/operations/monitoring/collect-minio-metrics-using-prometheus.rst @@ -37,7 +37,6 @@ The procedure on this page documents the following: Starting with MinIO Server :minio-release:`RELEASE.2024-07-15T19-02-30Z` and MinIO Client :mc-release:`RELEASE.2024-07-11T18-01-28Z`, metrics version 3 replaces the deprecated :ref:`metrics version 2 `. - MinIO recommends new monitoring configurations use :ref:`version 3 metrics `. Collect and alert on metrics ---------------------------- diff --git a/source/operations/monitoring/metrics-and-alerts.rst b/source/operations/monitoring/metrics-and-alerts.rst index 15465632..eaae840a 100644 --- a/source/operations/monitoring/metrics-and-alerts.rst +++ b/source/operations/monitoring/metrics-and-alerts.rst @@ -15,12 +15,12 @@ Metrics and Alerts .. admonition:: Metrics Version 2 Deprecated :class: note - Starting with MinIO Server :minio-release:`RELEASE.2024-07-15T19-02-30Z` and MinIO Client :mc-release:`RELEASE.2024-07-11T18-01-28Z`, metrics version 3 replaces the deprecated :ref:`metrics version 2 `. + Starting with MinIO Server :minio-release:`RELEASE.2024-07-15T19-02-30Z` and MinIO Client :mc-release:`RELEASE.2024-07-11T18-01-28Z`, metrics version 3 (v3) replaces the deprecated :ref:`metrics version 2 (v2) `. MinIO publishes metrics using the :prometheus-docs:`Prometheus Data Model `. You can use any scraping tool to pull metrics data from MinIO for further analysis and alerting. -For metrics version 3, all metrics are available under the base ``/minio/metrics/v3`` endpoint, optionally by appending an additional path for each category. +For metrics version 3, all metrics are available under the base ``/minio/metrics/v3`` endpoint, optionally appending an additional path for each category. For example, the following endpoint returns audit metrics: @@ -36,9 +36,6 @@ By default, MinIO requires authentication to scrape the metrics endpoints. To generate the needed bearer tokens, use :mc:`mc admin prometheus generate`. You can also disable metrics endpoint authentication by setting :envvar:`MINIO_PROMETHEUS_AUTH_TYPE` to ``public``. -You can also access metrics using :mc-cmd:`mc admin prometheus metrics` and the metric type for the desired category. -For more information, see the :mc-cmd:`MinIO Admin Client reference `. - MinIO provides the following types and scraping endpoints, relative to the base URL: .. list-table:: @@ -114,6 +111,9 @@ MinIO provides the following types and scraping endpoints, relative to the base For a complete list of metrics for each endpoint, see :ref:`Available Metrics `. +You can also access metrics using :mc-cmd:`mc admin prometheus metrics` and the metric type for the desired category. +For more information, see the :mc-cmd:`MinIO Admin Client reference `. + .. cond:: k8s The MinIO Operator supports deploying a per-tenant Prometheus instance configured to support metrics and visualization. diff --git a/source/operations/monitoring/metrics-v2-deprecated.rst b/source/operations/monitoring/metrics-v2-deprecated.rst index 3f23b655..3d02b941 100644 --- a/source/operations/monitoring/metrics-v2-deprecated.rst +++ b/source/operations/monitoring/metrics-v2-deprecated.rst @@ -14,7 +14,7 @@ Metrics Version 2 .. admonition:: Metrics Version 2 Deprecated :class: note - Starting with MinIO Server :minio-release:`RELEASE.2024-07-15T19-02-30Z` and MinIO Client :mc-release:`RELEASE.2024-07-11T18-01-28Z`, :ref:`metrics version 3 ` replaces the deprecated metrics version 2. + Starting with MinIO Server :minio-release:`RELEASE.2024-07-15T19-02-30Z` and MinIO Client :mc-release:`RELEASE.2024-07-11T18-01-28Z`, metrics :ref:`version 3 (v3) ` replaces the deprecated metrics version 2 (v2). The following sections describe the deprecated version 2 endpoints and metrics. diff --git a/source/reference/minio-mc-admin/mc-admin-prometheus-generate.rst b/source/reference/minio-mc-admin/mc-admin-prometheus-generate.rst index 9c8809ef..a1ce4dad 100644 --- a/source/reference/minio-mc-admin/mc-admin-prometheus-generate.rst +++ b/source/reference/minio-mc-admin/mc-admin-prometheus-generate.rst @@ -10,7 +10,7 @@ .. mc:: mc admin prometheus generate -Starting with MinIO Server :minio-release:`RELEASE.2024-07-15T19-02-30Z` and MinIO Client :mc-release:`RELEASE.2024-07-11T18-01-28Z`, metrics version 3 replaces the deprecated :ref:`metrics version 2 `. +Starting with MinIO Server :minio-release:`RELEASE.2024-07-15T19-02-30Z` and MinIO Client :mc-release:`RELEASE.2024-07-11T18-01-28Z`, metrics :ref:`version 3 (v3) ` replaces the deprecated :ref:`version 2 (v2) `. Description ----------- @@ -51,8 +51,8 @@ For more complete documentation on using MinIO with Prometheus, see :ref:`How to mc [GLOBALFLAGS] admin prometheus generate \ ALIAS \ [TYPE] \ - [--api_version v3] \ - [TYPE --bucket --api_version v3] + [--api_version v3] \ + [TYPE --bucket --api_version v3] .. include:: /includes/common-minio-mc.rst :start-after: start-minio-syntax @@ -67,30 +67,32 @@ Parameters The :mc:`alias ` of a configured MinIO deployment for which the command generates a Prometheus-compatible configuration file. -.. mc-cmd:: --api-version v3 +.. mc-cmd:: --api-version :optional: - Generate a scrape configuration for :ref:`metrics version 3 `. - Omit to generate a :ref:`metrics version 2 ` configuration. + To generate a scrape configuration for :ref:`v3 metrics `, include an ``--api-version v3`` parameter. + ``v3`` is the only accepted value. + + Omit ``--api-version`` to generate a :ref:`v2 metrics ` configuration. .. mc-cmd:: --bucket :optional: For v3 metric types that return bucket-level metrics, specify a bucket name. Use with :mc-cmd:`~mc admin prometheus generate --api-version`. - + ``--bucket`` works for the following v3 metric types: - ``api`` - ``replication`` The following example generates a configuration for API metrics from the bucket ``mybucket``: - + .. code-block:: shell :class: copyable - mc admin prometheus generate play api --bucket mybucket --api-version v3 - + mc admin prometheus generate ALIAS api --bucket mybucket --api-version v3 + .. mc-cmd:: TYPE :optional: @@ -119,7 +121,7 @@ Parameters - ``resource`` If not specified, a ``v2`` command returns cluster metrics. - Cluster metrics also include node metrics. + Cluster metrics also include rollups of certain node metrics. Global Flags ~~~~~~~~~~~~ @@ -135,7 +137,7 @@ Examples Generate a default metrics v3 config ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Use :mc-cmd:`mc admin prometheus generate --api-version v3` to generate a scrape configuration that collects all v3 metrics for a MinIO deployment: +Use :mc-cmd:`mc admin prometheus generate --api-version v3 ` to generate a scrape configuration that collects all v3 metrics for a MinIO deployment: .. code-block:: shell :class: copyable @@ -160,7 +162,7 @@ The output resembles the following: Generate a v3 cluster metrics config ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Use :mc-cmd:`mc admin prometheus generate --api-version v3` to generate a scrape configuration that collects v3 cluster metrics for a MinIO deployment: +Use :mc-cmd:`mc admin prometheus generate --api-version v3 ` to generate a scrape configuration that collects v3 cluster metrics for a MinIO deployment: .. code-block:: shell :class: copyable @@ -181,7 +183,7 @@ The output resembles the following: static_configs: - targets: ['localhost:9000'] -To generate a configuration for a :mc-cmd:`different metric type `, replace ``cluster`` with the desired type. +To generate a configuration for a :mc-cmd:`different metric type `, replace ``cluster`` with the desired type. Generate a v3 bucket replication metrics config @@ -208,9 +210,32 @@ The output resembles the following: static_configs: - targets: [`localhost:9000`] -To generate a configuration for API metrics for a bucket, replace ``replication`` with ``api``. - +Generate a v3 config for bucket API metrics +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The following example generates a scrape configuration for v3 API metrics for bucket ``mybucket``: + +.. code-block:: shell + :class: copyable + + mc admin prometheus generate ALIAS api --bucket mybucket --api-version v3 + +- Replace ``ALIAS`` with the :mc-cmd:`alias ` of the MinIO deployment. + +The output resembles the following: + +.. code-block:: shell + + scrape_configs: + - job_name: minio-job-api + bearer_token: [auth token] + metrics_path: /minio/metrics/v3/bucket/api/mybucket + scheme: https + static_configs: + - targets: [`localhost:9000`] + + Generate a default metrics v2 config ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/reference/minio-mc-admin/mc-admin-prometheus-metrics.rst b/source/reference/minio-mc-admin/mc-admin-prometheus-metrics.rst index eca5c2ee..db957ee7 100644 --- a/source/reference/minio-mc-admin/mc-admin-prometheus-metrics.rst +++ b/source/reference/minio-mc-admin/mc-admin-prometheus-metrics.rst @@ -10,6 +10,8 @@ .. mc:: mc admin prometheus metrics +Starting with MinIO Server :minio-release:`RELEASE.2024-07-15T19-02-30Z` and MinIO Client :mc-release:`RELEASE.2024-07-11T18-01-28Z`, metrics :ref:`version 3 (v3) ` replaces the deprecated :ref:`version 2 (v2) `. + Description ----------- @@ -19,6 +21,8 @@ The :mc:`mc admin prometheus metrics` command prints Prometheus metrics for a cl .. end-mc-admin-prometheus-metrics-desc +The output includes additional information about each metric, such as if its value is a ``counter`` or ``gauge``. + For more complete documentation on using MinIO with Prometheus, see :ref:`How to monitor MinIO server with Prometheus ` .. admonition:: Use ``mc admin`` on MinIO Deployments Only @@ -37,7 +41,7 @@ For more complete documentation on using MinIO with Prometheus, see :ref:`How to .. code-block:: shell :class: copyable - mc admin prometheus metrics myminio cluster + mc admin prometheus metrics play cluster --api-version v3 .. tab-item:: SYNTAX @@ -47,8 +51,10 @@ For more complete documentation on using MinIO with Prometheus, see :ref:`How to :class: copyable mc [GLOBALFLAGS] admin prometheus metrics \ - ALIAS \ - [TYPE] + ALIAS \ + [TYPE] \ + [--api_version v3] \ + [TYPE --bucket --api_version v3] .. include:: /includes/common-minio-mc.rst :start-after: start-minio-syntax @@ -63,25 +69,62 @@ Parameters The :mc:`alias ` of a configured MinIO deployment for which the command prints metrics. +.. mc-cmd:: --api-version + :optional: + + To print :ref:`version 3 (v3) ` metrics, include an ``--api-version v3`` parameter. + ``v3`` is the only accepted value. + + Omit ``--api-version`` to print :ref:`version 2 (v2) ` metrics. + +.. mc-cmd:: --bucket + :optional: + + For v3 metric types that return bucket-level metrics, specify a bucket name. + Use with :mc-cmd:`~mc admin prometheus metrics --api-version`. + + ``--bucket`` works for the following v3 metric types: + + - ``api`` + - ``replication`` + + The following example prints API metrics for the bucket ``mybucket``: + + .. code-block:: shell + :class: copyable + + mc admin prometheus metrics ALIAS api --bucket mybucket --api-version v3 + .. mc-cmd:: TYPE :optional: The type of metrics to print. - .. versionchanged:: RELEASE.2023-10-07T15-07-38Z + Valid values for metrics version 3 are: - ``resource`` metrics added + - ``api`` + - ``audit`` + - ``cluster`` + - ``debug`` + - ``ilm`` + - ``logger`` + - ``notification`` + - ``replication`` + - ``scanner`` + - ``system`` - Valid values are: + If not specified, a ``v3`` command returns all metrics. + + Valid values for metrics version 2 are: - ``bucket`` - ``cluster`` - ``node`` - ``resource`` - If not specified, the command returns cluster metrics. - Cluster metrics include rollups of certain node metrics. - The output includes additional information about each metric, such as if its value is a ``counter`` or ``gauge``. + If not specified, a ``v2`` command returns cluster metrics. + Cluster metrics also include rollups of certain node metrics. + Global Flags ~~~~~~~~~~~~ @@ -94,115 +137,59 @@ Global Flags Example ------- -Print bucket metrics -~~~~~~~~~~~~~~~~~~~~ +Print v3 metrics +~~~~~~~~~~~~~~~~ -Use :mc-cmd:`mc admin prometheus metrics` to print bucket metrics for a MinIO deployment: +Use :mc-cmd:`mc admin prometheus metrics --api-version v3 ` to print all available v3 metrics and their current values for a MinIO deployment: .. code-block:: shell :class: copyable - mc admin prometheus metrics ALIAS bucket + mc admin prometheus metrics ALIAS --api-version v3 - Replace ``ALIAS`` with the :mc-cmd:`alias ` of the MinIO deployment. -The output resembles the following: +To print a specific type of metrics, include the :mc-cmd:`~mc admin prometheus metrics TYPE`. +The following prints all scanner metrics for a deployment: .. code-block:: shell + :class: copyable - # HELP minio_bucket_objects_size_distribution Distribution of object sizes in the bucket, includes label for the bucket name - # TYPE minio_bucket_objects_size_distribution gauge - minio_bucket_objects_size_distribution{bucket="mybucket",range="BETWEEN_1024B_AND_1_MB",server="127.0.0.1:9000"} 0 - minio_bucket_objects_size_distribution{bucket="mybucket",range="BETWEEN_1024_B_AND_64_KB",server="127.0.0.1:9000"} 0 - minio_bucket_objects_size_distribution{bucket="mybucket",range="BETWEEN_10_MB_AND_64_MB",server="127.0.0.1:9000"} 0 - minio_bucket_objects_size_distribution{bucket="mybucket",range="BETWEEN_128_MB_AND_512_MB",server="127.0.0.1:9000"} 0 - minio_bucket_objects_size_distribution{bucket="mybucket",range="BETWEEN_1_MB_AND_10_MB",server="127.0.0.1:9000"} 0 - minio_bucket_objects_size_distribution{bucket="mybucket",range="BETWEEN_256_KB_AND_512_KB",server="127.0.0.1:9000"} 0 - minio_bucket_objects_size_distribution{bucket="mybucket",range="BETWEEN_512_KB_AND_1_MB",server="127.0.0.1:9000"} 0 - minio_bucket_objects_size_distribution{bucket="mybucket",range="BETWEEN_64_KB_AND_256_KB",server="127.0.0.1:9000"} 0 - minio_bucket_objects_size_distribution{bucket="mybucket",range="BETWEEN_64_MB_AND_128_MB",server="127.0.0.1:9000"} 0 - minio_bucket_objects_size_distribution{bucket="mybucket",range="GREATER_THAN_512_MB",server="127.0.0.1:9000"} 0 - minio_bucket_objects_size_distribution{bucket="mybucket",range="LESS_THAN_1024_B",server="127.0.0.1:9000"} 0 - # HELP minio_bucket_objects_version_distribution Distribution of object sizes in the bucket, includes label for the bucket name - # TYPE minio_bucket_objects_version_distribution gauge - minio_bucket_objects_version_distribution{bucket="mybucket",range="BETWEEN_1000_AND_10000",server="127.0.0.1:9000"} 0 - minio_bucket_objects_version_distribution{bucket="mybucket",range="BETWEEN_100_AND_1000",server="127.0.0.1:9000"} 0 - minio_bucket_objects_version_distribution{bucket="mybucket",range="BETWEEN_10_AND_100",server="127.0.0.1:9000"} 0 - minio_bucket_objects_version_distribution{bucket="mybucket",range="BETWEEN_2_AND_10",server="127.0.0.1:9000"} 0 - minio_bucket_objects_version_distribution{bucket="mybucket",range="GREATER_THAN_10000",server="127.0.0.1:9000"} 0 - minio_bucket_objects_version_distribution{bucket="mybucket",range="SINGLE_VERSION",server="127.0.0.1:9000"} 0 - minio_bucket_objects_version_distribution{bucket="mybucket",range="UNVERSIONED",server="127.0.0.1:9000"} 0 - # HELP minio_bucket_replication_proxied_delete_tagging_requests_failures Number of failures in DELETE tagging proxy requests to replication target - # TYPE minio_bucket_replication_proxied_delete_tagging_requests_failures counter - minio_bucket_replication_proxied_delete_tagging_requests_failures{server="127.0.0.1:9000"} 0 - # HELP minio_bucket_replication_proxied_delete_tagging_requests_total Number of DELETE tagging requests proxied to replication target - # TYPE minio_bucket_replication_proxied_delete_tagging_requests_total counter - minio_bucket_replication_proxied_delete_tagging_requests_total{bucket="mybucket",server="127.0.0.1:9000"} 0 - # HELP minio_bucket_replication_proxied_get_requests_failures Number of failures in GET requests proxied to replication target - # TYPE minio_bucket_replication_proxied_get_requests_failures counter - minio_bucket_replication_proxied_get_requests_failures{server="127.0.0.1:9000"} 0 - # HELP minio_bucket_replication_proxied_get_requests_total Number of GET requests proxied to replication target - # TYPE minio_bucket_replication_proxied_get_requests_total counter - minio_bucket_replication_proxied_get_requests_total{bucket="mybucket",server="127.0.0.1:9000"} 0 - # HELP minio_bucket_replication_proxied_get_tagging_requests_failures Number of failures in GET tagging proxy requests to replication target - # TYPE minio_bucket_replication_proxied_get_tagging_requests_failures counter - minio_bucket_replication_proxied_get_tagging_requests_failures{server="127.0.0.1:9000"} 0 - # HELP minio_bucket_replication_proxied_get_tagging_requests_total Number of GET tagging requests proxied to replication target - # TYPE minio_bucket_replication_proxied_get_tagging_requests_total counter - minio_bucket_replication_proxied_get_tagging_requests_total{bucket="mybucket",server="127.0.0.1:9000"} 0 - # HELP minio_bucket_replication_proxied_head_requests_failures Number of failures in HEAD requests proxied to replication target - # TYPE minio_bucket_replication_proxied_head_requests_failures counter - minio_bucket_replication_proxied_head_requests_failures{server="127.0.0.1:9000"} 0 - # HELP minio_bucket_replication_proxied_head_requests_total Number of HEAD requests proxied to replication target - # TYPE minio_bucket_replication_proxied_head_requests_total counter - minio_bucket_replication_proxied_head_requests_total{bucket="mybucket",server="127.0.0.1:9000"} 0 - # HELP minio_bucket_replication_proxied_put_tagging_requests_failures Number of failures in PUT tagging proxy requests to replication target - # TYPE minio_bucket_replication_proxied_put_tagging_requests_failures counter - minio_bucket_replication_proxied_put_tagging_requests_failures{server="127.0.0.1:9000"} 0 - # HELP minio_bucket_replication_proxied_put_tagging_requests_total Number of PUT tagging requests proxied to replication target - # TYPE minio_bucket_replication_proxied_put_tagging_requests_total counter - minio_bucket_replication_proxied_put_tagging_requests_total{bucket="mybucket",server="127.0.0.1:9000"} 0 - # HELP minio_bucket_replication_received_bytes Total number of bytes replicated to this bucket from another source bucket - # TYPE minio_bucket_replication_received_bytes counter - minio_bucket_replication_received_bytes{bucket="mybucket",server="127.0.0.1:9000"} 0 - # HELP minio_bucket_replication_received_count Total number of objects received by this bucket from another source bucket - # TYPE minio_bucket_replication_received_count gauge - minio_bucket_replication_received_count{bucket="mybucket",server="127.0.0.1:9000"} 0 - # HELP minio_bucket_requests_4xx_errors_total Total number of S3 requests with (4xx) errors on a bucket - # TYPE minio_bucket_requests_4xx_errors_total counter - minio_bucket_requests_4xx_errors_total{api="getbucketobjectlockconfig",bucket="mybucket",server="127.0.0.1:9000"} 1 - # HELP minio_bucket_requests_inflight_total Total number of S3 requests currently in flight on a bucket - # TYPE minio_bucket_requests_inflight_total gauge - minio_bucket_requests_inflight_total{api="getbucketlocation",bucket="mybucket",server="127.0.0.1:9000"} 0 - minio_bucket_requests_inflight_total{api="getbucketobjectlockconfig",bucket="mybucket",server="127.0.0.1:9000"} 0 - minio_bucket_requests_inflight_total{api="headbucket",bucket="mybucket",server="127.0.0.1:9000"} 0 - minio_bucket_requests_inflight_total{api="listobjectsv2",bucket="mybucket",server="127.0.0.1:9000"} 0 - minio_bucket_requests_inflight_total{api="putobject",bucket="mybucket",server="127.0.0.1:9000"} 0 - # HELP minio_bucket_requests_total Total number of S3 requests on a bucket - # TYPE minio_bucket_requests_total counter - minio_bucket_requests_total{api="getbucketlocation",bucket="mybucket",server="127.0.0.1:9000"} 2 - minio_bucket_requests_total{api="getbucketobjectlockconfig",bucket="mybucket",server="127.0.0.1:9000"} 1 - minio_bucket_requests_total{api="headbucket",bucket="mybucket",server="127.0.0.1:9000"} 2 - minio_bucket_requests_total{api="listobjectsv2",bucket="mybucket",server="127.0.0.1:9000"} 1 - minio_bucket_requests_total{api="putobject",bucket="mybucket",server="127.0.0.1:9000"} 1 - # HELP minio_bucket_traffic_received_bytes Total number of S3 bytes received for this bucket - # TYPE minio_bucket_traffic_received_bytes gauge - minio_bucket_traffic_received_bytes{bucket="mybucket",server="127.0.0.1:9000"} 178 - # HELP minio_bucket_traffic_sent_bytes Total number of S3 bytes sent for this bucket - # TYPE minio_bucket_traffic_sent_bytes gauge - minio_bucket_traffic_sent_bytes{bucket="mybucket",server="127.0.0.1:9000"} 1232 - # HELP minio_bucket_usage_deletemarker_total Total number of delete markers - # TYPE minio_bucket_usage_deletemarker_total gauge - minio_bucket_usage_deletemarker_total{bucket="mybucket",server="127.0.0.1:9000"} 0 - # HELP minio_bucket_usage_object_total Total number of objects - # TYPE minio_bucket_usage_object_total gauge - minio_bucket_usage_object_total{bucket="mybucket",server="127.0.0.1:9000"} 0 - # HELP minio_bucket_usage_total_bytes Total bucket size in bytes - # TYPE minio_bucket_usage_total_bytes gauge - minio_bucket_usage_total_bytes{bucket="mybucket",server="127.0.0.1:9000"} 0 - # HELP minio_bucket_usage_version_total Total number of versions (includes delete marker) - # TYPE minio_bucket_usage_version_total gauge - minio_bucket_usage_version_total{bucket="mybucket",server="127.0.0.1:9000"} 0 - # HELP minio_usage_last_activity_nano_seconds Time elapsed (in nano seconds) since last scan activity - # TYPE minio_usage_last_activity_nano_seconds gauge - minio_usage_last_activity_nano_seconds{server="127.0.0.1:9000"} 5.6046668864e+10 + mc admin prometheus metrics ALIAS scanner --api-version v3 + + +Print v3 bucket replication metrics +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Certain metric types accept a :mc-cmd:`~mc admin prometheus metrics --bucket` parameter to specify the bucket for which to print metrics. +The following example prints v3 replication metrics for bucket ``mybucket``: + +.. code-block:: shell + :class: copyable + + mc admin prometheus metrics ALIAS replication --bucket mybucket --api-version v3 + +- Replace ``ALIAS`` with the :mc-cmd:`alias ` of the MinIO deployment. + +To print API metrics for a bucket, replace ``replication`` with ``api``. + + +Print v2 metrics +~~~~~~~~~~~~~~~~ + +By default, :mc-cmd:`mc admin prometheus metrics` prints v2 cluster metrics: + +.. code-block:: shell + :class: copyable + + mc admin prometheus metrics ALIAS + +- Replace ``ALIAS`` with the :mc-cmd:`alias ` of the MinIO deployment. + +To print another type of metrics, specify the desired :mc-cmd:`~mc admin prometheus metrics TYPE`. +The following example prints v2 bucket metrics: + +.. code-block:: shell + :class: copyable + + mc admin prometheus metrics ALIAS bucket