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

[Exporter.Geneva] Fix overflow bucket value serialization for Histogram #805

Merged

Conversation

utpilla
Copy link
Contributor

@utpilla utpilla commented Dec 7, 2022

The values for overflow buckets should be serialized as the value-count pair: LastBucketValue + 1,count

For eg. for a Histogram with the boundaries: [25,50,100], if the value recorded is 150, it should be serialized as the following value-count pair: (101, 1)

Changes

  • Fix the serialization for overflow bucket

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • Appropriate CHANGELOG.md updated for non-trivial changes

@utpilla utpilla added the comp:exporter.geneva Things related to OpenTelemetry.Exporter.Geneva label Dec 7, 2022
@utpilla utpilla requested a review from a team as a code owner December 7, 2022 03:18
@utpilla utpilla changed the title [Exporter.Geneva] Fix Histogram serialization [Exporter.Geneva] Fix overflow bucket value serialization for Histogram Dec 7, 2022
@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Merging #805 (bb84104) into main (4a0cda8) will not change coverage.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #805   +/-   ##
=======================================
  Coverage   77.97%   77.97%           
=======================================
  Files         176      176           
  Lines        5313     5313           
=======================================
  Hits         4143     4143           
  Misses       1170     1170           
Impacted Files Coverage Δ
...ry.Exporter.Geneva/Metrics/GenevaMetricExporter.cs 58.09% <100.00%> (ø)

Copy link
Member

@CodeBlanch CodeBlanch left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -780,6 +779,8 @@ private void CheckSerializationForSingleMetricPoint(Metric metric, GenevaMetricE
listIterator++;
bucketsWithPositiveCount++;
}

lastExplicitBound = bucket.ExplicitBound;
Copy link
Member

Choose a reason for hiding this comment

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

Something about this test design seems off. I was expecting to see a test case being added in the spirit of: "Given buckets x, y, & z expect last bucket to be z + 1." Maybe it is too dynamic for its own good? 😄

Anyway doesn't need to be fixed as part of this, just musing.

Copy link
Contributor Author

@utpilla utpilla Dec 7, 2022

Choose a reason for hiding this comment

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

Haha you're right! It was too dynamic to even catch that issue in the first place 😀

I'll work on fixing this later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:exporter.geneva Things related to OpenTelemetry.Exporter.Geneva
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants