Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support metrics-v3 api in admin prometheus generate #4985

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

anjalshireesh
Copy link
Contributor

@anjalshireesh anjalshireesh commented Jul 11, 2024

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 api

How to test this PR?

  • mc admin prometheus generate 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 Flag bucket is not supported with v2 metrics. when --bucket is passed to the command
  • mc admin prometheus generate ALIAS api|system|debug|ilm|audit|logger|replication|notification|scanner

    • should fail with invalid metric type
  • mc admin prometheus generate ALIAS node|bucket|resource --api-version v3

    • should fail with invalid metric type
  • mc admin prometheus generate ALIAS api|system|debug|cluster|ilm|audit|logger|replication|notification|scanner --api-version v3

    • should work fine and put the v3 api endpoint in the generated scrape config
  • mc admin prometheus generate ALIAS api|replication --api-version v3 --bucket BUCKET

    • should put the bucket specific v3 api endpoint in the generated scrape config
  • mc admin prometheus generate ALIAS --api-version v3

    • should put the base path (/minio/metrics/v3) in the generated scrape config
  • mc admin prometheus generate ALIAS --api-version v3 --bucket BUCKET

    • should fail with 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

    • should fail with --bucket is applicable only for metric types 'api, replication'

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • 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)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

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'
Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Verified.

@harshavardhana harshavardhana merged commit ddfd44c into minio:master Jul 11, 2024
6 checks passed
@anjalshireesh anjalshireesh deleted the metrics-v3 branch July 12, 2024 05:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants