Skip to content

remove unnecessary buckets on exponential histograms#3771

Closed
loomis-relativity wants to merge 7 commits intoopen-telemetry:mainfrom
loomis-relativity:issue-3767
Closed

remove unnecessary buckets on exponential histograms#3771
loomis-relativity wants to merge 7 commits intoopen-telemetry:mainfrom
loomis-relativity:issue-3767

Conversation

@loomis-relativity
Copy link
Copy Markdown

@loomis-relativity loomis-relativity commented Mar 11, 2024

Description

Updates the serialization of exponential histogram buckets to remove unnecessary zero buckets. If there are no non-zero buckets, then none are serialized. This matches better the payloads from the JavaScript SDK and avoids ingestion problems with a downstream vendor when an empty negative bucket appears.

Fixes #3767

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Added unit tests to ensure that the truncation of the zero buckets works as expected. Updated the unit test for metric encoding to exercise this functionality.

Does This PR Require a Contrib Repo Change?

Answer the following question based on these examples of changes that would require a Contrib Repo Change:

  • The OTel specification has changed which prompted this PR to update the method interfaces of opentelemetry-api/ or opentelemetry-sdk/

  • The method interfaces of test/util have changed

  • Scripts in scripts/ that were copied over to the Contrib repo have changed

  • Configuration files that were copied over to the Contrib repo have changed (when consistency between repositories is applicable) such as in

    • pyproject.toml
    • isort.cfg
    • .flake8
  • When a new .github/CODEOWNER is added

  • Major changes to project information, such as in:

    • README.md
    • CONTRIBUTING.md
  • Yes. - Link to PR:

  • No.

Checklist:

  • Followed the style guidelines of this project
  • Changelogs have been updated
  • Unit tests have been added
  • [ ] Documentation has been updated

@loomis-relativity loomis-relativity marked this pull request as ready for review March 11, 2024 21:24
@loomis-relativity loomis-relativity requested a review from a team March 11, 2024 21:24
Copy link
Copy Markdown
Contributor

@xrmx xrmx left a comment

Choose a reason for hiding this comment

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

AFAIU for reference the js sdk implements the trimming on the bucket and calls it when merging or diffing exponential histograms:
https://github.com/open-telemetry/opentelemetry-js/blob/main/packages/sdk-metrics/src/aggregator/exponential-histogram/Buckets.ts#L116

@xrmx
Copy link
Copy Markdown
Contributor

xrmx commented Apr 5, 2024

@euroelessar any chance you can take a look at this please?

@euroelessar
Copy link
Copy Markdown
Contributor

unfortunately this PR has to be rebased due to #3798 being merged
@loomis-relativity any chance you can take on it? if not, I probably will be able to prepare a new PR somewhere within a week

@xrmx
Copy link
Copy Markdown
Contributor

xrmx commented Apr 23, 2024

@loomis-relativity any chance you can rebase your changes please?

@loomis-relativity
Copy link
Copy Markdown
Author

@xrmx Merge conflict resolved.

@xrmx
Copy link
Copy Markdown
Contributor

xrmx commented May 15, 2024

@euroelessar hello, do you have time to take a look at it?

@loomis-relativity
Copy link
Copy Markdown
Author

Apologies, the notifications got lost in my inbox. @euroelessar I've refactored the code to remove some duplication. Don't think that it can be moved into the def bucket_counts without changing the code generated from the protobuf definitions.

@ocelotl ocelotl self-assigned this Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

problems with generated exponential histogram

4 participants