Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@john-morales
Copy link
Contributor

@john-morales john-morales commented Nov 17, 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

Addresses two issues with MetricV2 histograms
1.) Fixes casing of the api label for the le='+Inf' bucket, based on the toLowerAPILabels argument

2.) Fixes a separate issue uncovered while writing unit tests where the value of the +Inf bucket was always zero instead of the total count.

Motivation and Context

Correcting these issues should fix an issue that prevented usage of the prometheus histogram_quantile() function on minio bucket histograms.

Further detail available in issue #20655

How to test this PR?

  • New unit tests were added for verifying +Inf bucket value and api labels.
  • Locally verified from a development build in my existing environment that originally observed the issue:
$ curl -H 'Authorization: Bearer ...' -v http://localhost:9000/minio/v2/metrics/bucket
...
# HELP minio_bucket_requests_ttfb_seconds_distribution Distribution of time to first byte across API calls per bucket
# TYPE minio_bucket_requests_ttfb_seconds_distribution gauge
minio_bucket_requests_ttfb_seconds_distribution{api="completemultipartupload",bucket="grafana-tempo-traces",le="+Inf",server="127.0.0.1:9000"} 1
minio_bucket_requests_ttfb_seconds_distribution{api="completemultipartupload",bucket="grafana-tempo-traces",le="0.050",server="127.0.0.1:9000"} 1
minio_bucket_requests_ttfb_seconds_distribution{api="completemultipartupload",bucket="grafana-tempo-traces",le="0.100",server="127.0.0.1:9000"} 1
minio_bucket_requests_ttfb_seconds_distribution{api="completemultipartupload",bucket="grafana-tempo-traces",le="0.250",server="127.0.0.1:9000"} 1
minio_bucket_requests_ttfb_seconds_distribution{api="completemultipartupload",bucket="grafana-tempo-traces",le="0.500",server="127.0.0.1:9000"} 1
minio_bucket_requests_ttfb_seconds_distribution{api="completemultipartupload",bucket="grafana-tempo-traces",le="1.000",server="127.0.0.1:9000"} 1
minio_bucket_requests_ttfb_seconds_distribution{api="completemultipartupload",bucket="grafana-tempo-traces",le="10.000",server="127.0.0.1:9000"} 1
minio_bucket_requests_ttfb_seconds_distribution{api="completemultipartupload",bucket="grafana-tempo-traces",le="2.500",server="127.0.0.1:9000"} 1
minio_bucket_requests_ttfb_seconds_distribution{api="completemultipartupload",bucket="grafana-tempo-traces",le="5.000",server="127.0.0.1:9000"} 1
minio_bucket_requests_ttfb_seconds_distribution{api="copyobject",bucket="grafana-tempo-traces",le="+Inf",server="127.0.0.1:9000"} 2
minio_bucket_requests_ttfb_seconds_distribution{api="copyobject",bucket="grafana-tempo-traces",le="0.050",server="127.0.0.1:9000"} 2
minio_bucket_requests_ttfb_seconds_distribution{api="copyobject",bucket="grafana-tempo-traces",le="0.100",server="127.0.0.1:9000"} 2
minio_bucket_requests_ttfb_seconds_distribution{api="copyobject",bucket="grafana-tempo-traces",le="0.250",server="127.0.0.1:9000"} 2
minio_bucket_requests_ttfb_seconds_distribution{api="copyobject",bucket="grafana-tempo-traces",le="0.500",server="127.0.0.1:9000"} 2
minio_bucket_requests_ttfb_seconds_distribution{api="copyobject",bucket="grafana-tempo-traces",le="1.000",server="127.0.0.1:9000"} 2
minio_bucket_requests_ttfb_seconds_distribution{api="copyobject",bucket="grafana-tempo-traces",le="10.000",server="127.0.0.1:9000"} 2
minio_bucket_requests_ttfb_seconds_distribution{api="copyobject",bucket="grafana-tempo-traces",le="2.500",server="127.0.0.1:9000"} 2
minio_bucket_requests_ttfb_seconds_distribution{api="copyobject",bucket="grafana-tempo-traces",le="5.000",server="127.0.0.1:9000"} 2
...

Two histogram_quantile()-based charts in grafana began working after deploying the development build:
image

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: described in issue #20655
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

@harshavardhana harshavardhana merged commit 485d833 into minio:master Nov 18, 2024
21 checks passed
@john-morales john-morales deleted the issue20655 branch November 19, 2024 15:49
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.

4 participants