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 api
How to test this PR?
mc admin prometheus metrics ALIAS cluster|node|bucket|resource
should continue to work as before
should work in same way when --api-version v2 is passed
should fail with Flagbucketis not supported with v2 metrics. when --bucket is passed to the command
mc admin prometheus metrics ALIAS api|system|debug|ilm|audit|logger|replication|notification|scanner
should fail with invalid metric type
mc admin prometheus metrics ALIAS node|bucket|resource --api-version v3
should fail with invalid metric type
mc admin prometheus metrics ALIAS api|system|debug|cluster|ilm|audit|logger|replication|notification|scanner --api-version v3
should work fine and return metrics by invoking the v3 api
mc admin prometheus metrics ALIAS api|replication --api-version v3 --bucket BUCKET
should return corresponding metrics for the given bucket only
mc admin prometheus metrics ALIAS --api-version v3
should return all the metrics
mc admin prometheus metrics ALIAS --api-version v3 --bucket BUCKET
should fail with metric type must be passed with --bucket. valid values are 'api, replication'
mc admin prometheus metrics ALIAS system|debug|cluster|ilm|audit|logger|notification|scanner --api-version v3 --bucket BUCKET
should fail with --bucket is applicable only for metric types 'api, replication'
Types of changes
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Optimization (provides speedup with no functional changes)
[ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist:
[ ] Fixes a regression (If yes, please add commit-id or PR # here)
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 metrics 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 metrics ALIAS api|system|debug|ilm|audit|logger|replication|notification|scanner
invalid metric type
mc admin prometheus metrics ALIAS node|bucket|resource --api-version v3
invalid metric type
mc admin prometheus metrics ALIAS api|system|debug|cluster|ilm|audit|logger|replication|notification|scanner --api-version v3
mc admin prometheus metrics ALIAS api|replication --api-version v3 --bucket BUCKET
mc admin prometheus metrics ALIAS --api-version v3
mc admin prometheus metrics ALIAS --api-version v3 --bucket BUCKET
metric type must be passed with --bucket. valid values are 'api, replication'
mc admin prometheus metrics 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)