Skip to content

[exporters] Native Marshallers should always write SUM#8107

Merged
jack-berg merged 1 commit intoopen-telemetry:mainfrom
mosesn:mosesn/fix-sum-bug-exp-marshaler
Feb 25, 2026
Merged

[exporters] Native Marshallers should always write SUM#8107
jack-berg merged 1 commit intoopen-telemetry:mainfrom
mosesn:mosesn/fix-sum-bug-exp-marshaler

Conversation

@mosesn
Copy link
Contributor

@mosesn mosesn commented Feb 19, 2026

Problem

We found that sometimes we would export bad values from otel when the sum was 0 when we were also exporting deltas. My colleague @natasha-aleksandrova found that this was because the native histogram marshalers would omit the sum, since they were using the old serializeDouble method, instead of serializeDoubleOptional.

Solution

Update the marshallers to use serializeDoubleOptional and add a test. I confirmed that the test fails before the change, and passes after the change.

Result

The native marshalers properly export the histogram even when the sum is 0!

@mosesn mosesn requested a review from a team as a code owner February 19, 2026 23:32
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 19, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: mosesn / name: Moses Nakamura (cb1462b)

@mosesn mosesn force-pushed the mosesn/fix-sum-bug-exp-marshaler branch from aafdb80 to cb1462b Compare February 19, 2026 23:34
@codecov
Copy link

codecov bot commented Feb 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.32%. Comparing base (284a64f) to head (cb1462b).
⚠️ Report is 12 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8107   +/-   ##
=========================================
  Coverage     90.32%   90.32%           
  Complexity     7607     7607           
=========================================
  Files           839      839           
  Lines         22888    22888           
  Branches       2283     2283           
=========================================
  Hits          20673    20673           
  Misses         1506     1506           
  Partials        709      709           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jack-berg
Copy link
Member

@mosesn can you sign the CLA? Thanks

@mosesn
Copy link
Contributor Author

mosesn commented Feb 25, 2026

@jack-berg signed, sorry for the delay!

Copy link
Member

@jack-berg jack-berg left a comment

Choose a reason for hiding this comment

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

Thanks!

@jack-berg jack-berg merged commit a96600e into open-telemetry:main Feb 25, 2026
27 checks passed
@otelbot
Copy link
Contributor

otelbot bot commented Feb 25, 2026

Thank you for your contribution @mosesn! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey.

antonio-mazzini added a commit to antonio-mazzini/opentelemetry-java that referenced this pull request Mar 5, 2026
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