Skip to content

Conversation

@xuan-cao-swi
Copy link
Contributor

Description

  1. added merge logic for exponential histogram when the temporality cumulative
  2. added more test case cover merge logic and when scale/bucket size out of range

Test

Test case are copied from python metrics sdk, and modified based on ruby metrics sdk data structure.

@github-actions
Copy link
Contributor

👋 This pull request has been marked as stale because it has been open with no activity. You can: comment on the issue or remove the stale label to hold stale off for a while, add the keep label to hold stale off permanently, or do nothing. If you do nothing this pull request will be closed eventually by the stale bot

@akahn
Copy link

akahn commented Sep 8, 2025

As an end-user what is the result of not having this fix? If we use exponential histograms, are they not accurate?

@xuan-cao-swi
Copy link
Contributor Author

This pr is for adding merge logic for cumulative aggregation.
If you use delta aggregation, it should be accurate (no merge logic required since data will be dropped each time), but if you use cumulative, then it was expecting user's collector/collection side have the merge logic ; otherwise the result is unexpected.

@akahn
Copy link

akahn commented Sep 18, 2025

expecting user's collector/collection side have the merge logic

We use Alloy as the collector—how do I know whether it is able to handle histogram merges? I'm trying to understand whether I need this patch in order to use exponential histograms with the Ruby SDK today.

@xuan-cao-swi
Copy link
Contributor Author

I believe the alloy does merge the exponential histogram bucket (histogram.go)

Copy link
Contributor

@kaylareopelle kaylareopelle 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 going to take another pass, but two small cleanup points in the meantime

@kaylareopelle
Copy link
Contributor

@xuan-cao-swi - Could you send me a link to the Python implementation you used? I'd like to compare the two.

@xuan-cao-swi
Copy link
Contributor Author

@kaylareopelle - Yes, _merge function and when the merge is required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In progress

Development

Successfully merging this pull request may close these issues.

3 participants