Support metrics-v3 api in admin prometheus generate
#4985
Merged
+124
−96
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Community Contribution License
All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.
Description
Add a flag --api-version with possible values of v2 and v3, with default being v2.
So when this flag is not passed, the command will work exactly as it did before.
When using v3, there is a different set of metric types supported. It also supports a new flag:
bucket: the bucket for which the metrics are to be fetched. it is applicable only for the metric types that are available at bucket level, which currently are 'api' and 'replication'
Motivation and Context
Support newly introduced
metrics-v3
apiHow to test this PR?
mc admin prometheus generate ALIAS cluster|node|bucket|resource
--api-version v2
is passedFlag
bucketis not supported with v2 metrics.
when--bucket
is passed to the commandmc admin prometheus generate ALIAS api|system|debug|ilm|audit|logger|replication|notification|scanner
invalid metric type
mc admin prometheus generate ALIAS node|bucket|resource --api-version v3
invalid metric type
mc admin prometheus generate ALIAS api|system|debug|cluster|ilm|audit|logger|replication|notification|scanner --api-version v3
mc admin prometheus generate ALIAS api|replication --api-version v3 --bucket BUCKET
mc admin prometheus generate ALIAS --api-version v3
/minio/metrics/v3
) in the generated scrape configmc admin prometheus generate ALIAS --api-version v3 --bucket BUCKET
metric type must be passed with --bucket. valid values are 'api, replication'
mc admin prometheus generate ALIAS system|debug|cluster|ilm|audit|logger|notification|scanner --api-version v3 --bucket BUCKET
--bucket is applicable only for metric types 'api, replication'
Types of changes
Checklist:
commit-id
orPR #
here)