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

feat: support metrics scrape #2344

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

jiuker
Copy link
Contributor

@jiuker jiuker commented Oct 18, 2024

feat: support metrics scrape
fix #2327
we just support /minio/v2/metrics/cluster before
now we can do more type for this
like

prometheusOperatorScrapeMetricsPath:
- /minio/v2/metrics/cluster
- /minio/metrics/v3/api
- /minio/v2/metrics/bucket

default is /minio/v2/metrics/cluster

@harshavardhana
Copy link
Member

We should add a way to scrape v3 metrics as well

@jiuker jiuker requested a review from shtripat October 18, 2024 07:43
@jiuker jiuker self-assigned this Oct 21, 2024
@cesnietor
Copy link
Contributor

@jiuker is there a way we can create tests for this? since this is a new feature? like an integration test? Thanks.

@pjuarezd pjuarezd force-pushed the feat-support-metrics-scrope branch from b38e1b6 to 982f5d4 Compare December 9, 2024 19:51
pjuarezd
pjuarezd previously approved these changes Dec 9, 2024
@jiuker
Copy link
Contributor Author

jiuker commented Feb 5, 2025

Will take a look

@jiuker jiuker force-pushed the feat-support-metrics-scrope branch from 40012a7 to 732b95c Compare February 6, 2025 03:52

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@allanrogerr
Copy link
Contributor

@jiuker PTAL - pkg:golang/golang.org/x/[email protected] vulnerability

}

for index, scrape := range t.Spec.PrometheusOperatorScrapeMetricsPath {
promConfig.ScrapeConfigs = append(promConfig.ScrapeConfigs, ScrapeConfig{
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider the following tenant yaml section; note that v3 cluster metrics is scraped using /minio/v3/metrics/cluster/ (see https://github.com/minio/minio/blob/master/docs/metrics/v3.md):

  prometheusOperator: true
  prometheusOperatorScrapeMetricsPath:
  - /minio/v2/metrics/bucket
  - /minio/v2/metrics/cluster
  - /minio/v2/metrics/node
  - /minio/v2/metrics/resource
  - /minio/v3/metrics/cluster/

v3 metrics scraping is failing with server returned HTTP status 403 Forbidden. Please try and check this.

Copy link
Contributor Author

@jiuker jiuker Mar 11, 2025

Choose a reason for hiding this comment

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

Yesh. Should be like /minio/metrics/v3/*, but that can be set with this strings slice field.

@jiuker jiuker requested a review from allanrogerr March 11, 2025 07:36
Copy link
Contributor

@ramondeklein ramondeklein left a comment

Choose a reason for hiding this comment

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

I'm no expert on Prometheus metrics and MinIO, but I think this code doesn't work correctly. Please make these changes to AIStor operator and implement proper integration tests.

jiuker added 2 commits March 12, 2025 13:16
refactor
refactor
UT
UT
@jiuker jiuker requested a review from ramondeklein March 12, 2025 05:25
ut
ut
jiuker and others added 2 commits March 12, 2025 13:33
lint
lint

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
apply suggestion
@jiuker jiuker requested a review from ramondeklein March 14, 2025 01:27
Copy link
Contributor

@ramondeklein ramondeklein left a comment

Choose a reason for hiding this comment

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

The code looks fine, but we do need an integration test to verify the functionality. It's a major change and it needs proper testing.

UT
UT
jiuker added 3 commits March 17, 2025 16:58
lint
lint
remove env
rename
rename
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.

Feature: expose more Prometheus metrics than just /minio/v2/metrics/cluster
8 participants