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

Fix max_scale validation of exponential histogram configuration #1452

Merged

Conversation

inahga
Copy link
Contributor

@inahga inahga commented Dec 22, 2023

metrics::Aggregation::validate() has a bug that limits max_scale of a Base2ExponentialHistogram to the interval [10, 20] instead of the expected [-10, 20].

Changes

Fix the double negation so that the function validates correctly. I've also added some tests that exercise the entire validation function.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@inahga inahga requested a review from a team December 22, 2023 01:32
Copy link

linux-foundation-easycla bot commented Dec 22, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

@inahga inahga force-pushed the inahga/fix-aggregation-validation branch from fa1829e to 1b5f419 Compare December 22, 2023 01:36
Copy link

codecov bot commented Dec 22, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7f77ec6) 60.4% compared to head (1b5f419) 60.6%.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #1452     +/-   ##
=======================================
+ Coverage   60.4%   60.6%   +0.2%     
=======================================
  Files        146     146             
  Lines      18991   19066     +75     
=======================================
+ Hits       11483   11573     +90     
+ Misses      7508    7493     -15     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jtescher jtescher left a comment

Choose a reason for hiding this comment

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

Good catch, thanks @inahga

@jtescher jtescher merged commit bd572d5 into open-telemetry:main Dec 22, 2023
15 checks passed
jtescher added a commit that referenced this pull request Jan 4, 2024
guswynn pushed a commit to MaterializeInc/opentelemetry-rust that referenced this pull request Jan 24, 2024
…-telemetry#1452)

`metrics::Aggregation::validate()` has a bug that limits `max_scale` of
a `Base2ExponentialHistogram` to the interval `[10, 20]` instead of the
expected `[-10, 20]`.
guswynn pushed a commit to MaterializeInc/opentelemetry-rust that referenced this pull request Jan 24, 2024
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.

2 participants