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

[SDK] Support empty histogram buckets #3027

Merged
merged 6 commits into from
Aug 14, 2024

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Aug 14, 2024

Changes

As per the specs, it should be possible to configure the histogram aggregation with empty buckets -

https://github.com/open-telemetry/opentelemetry-specification/blob/3a60fdae9392a57803b9f40325257db8ccba44a1/specification/metrics/data-model.md#histogram

Bucket counts are optional. A Histogram without buckets conveys a population in terms of only the sum and count, and may be interpreted as a histogram with single bucket covering (-Inf, +Inf).

As of now, we default to the standard bucket boundaries. Fixing the code for it.

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

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@lalitb lalitb requested a review from a team August 14, 2024 06:36
@lalitb lalitb marked this pull request as draft August 14, 2024 06:36
@lalitb lalitb marked this pull request as ready for review August 14, 2024 06:41
Copy link

codecov bot commented Aug 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.60%. Comparing base (497eaf4) to head (01d8832).
Report is 116 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3027      +/-   ##
==========================================
+ Coverage   87.12%   87.60%   +0.49%     
==========================================
  Files         200      190      -10     
  Lines        6109     5870     -239     
==========================================
- Hits         5322     5142     -180     
+ Misses        787      728      -59     
Files Coverage Δ
...k/src/metrics/aggregation/histogram_aggregation.cc 88.47% <100.00%> (ø)

... and 122 files with indirect coverage changes

@marcalff marcalff changed the title Support empty histogram buckets [SDK] Support empty histogram buckets Aug 14, 2024
Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

@lalitb lalitb enabled auto-merge (squash) August 14, 2024 17:24
@lalitb lalitb merged commit 1203bcf into open-telemetry:main Aug 14, 2024
50 of 51 checks passed
malkia added a commit to malkia/opentelemetry-cpp that referenced this pull request Aug 14, 2024
[SDK] Support empty histogram buckets (open-telemetry#3027)
msiddhu added a commit to msiddhu/opentelemetry-cpp that referenced this pull request Aug 20, 2024
* [EXPORTER] Ignore exception when create thread in OTLP file exporter. (open-telemetry#3012)

* [BUILD] Update MODULE.bazel (open-telemetry#3015)

* [BUILD] Fix build without vcpkg on Windows when gRPC is disabled (open-telemetry#3016)

* [BUILD] Add abi_version_no bazel flag. (open-telemetry#3020)

* [Code health] Expand iwyu coverage to include unit tests. (open-telemetry#3022)

* [BUILD] Version opentelemetry_proto/proto_grpc shared libraries (open-telemetry#2992)

* [SEMANTIC CONVENTIONS] Upgrade semantic conventions to 1.27.0 (open-telemetry#3023)

* [SDK] Support empty histogram buckets (open-telemetry#3027)

* support empty buckets

* Update histogram_test.cc

* Update histogram_test.cc

* test for negative values

* fix count

* [TEST] Fix sync problems in OTLP File exporter tests. (open-telemetry#3031)

---------

Co-authored-by: WenTao Ou <owentou@tencent.com>
Co-authored-by: Carbo Kuo <BYVoid@users.noreply.github.com>
Co-authored-by: Manuel Bergler <m.bergler@tum.de>
Co-authored-by: Marc Alff <marc.alff@oracle.com>
Co-authored-by: Troels Hoffmeyer <Troels.d.hoffmeyer@gmail.com>
Co-authored-by: Lalit Kumar Bhasin <lalit_fin@yahoo.com>
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.

3 participants