opentelemetry-js icon indicating copy to clipboard operation
opentelemetry-js copied to clipboard

feat: exponential histogram - part 2 - the accumulation and aggregator

Open mwear opened this issue 2 years ago • 1 comments

Which problem is this PR solving?

This PR is part 2 in a series of PRs to add exponential histogram support.

Partially Fixes #3324

Short description of the changes

This PR includes ExponentialHistogramAccumulation and ExponentialHistogramAggregator along with extensive unit testing. This is the bulk of the work and uses the mapping functions introduced in part 1.

This code is heavily based on the Golang reference implementation. For other details see:

For the other PRs in this series see:

You can see all 3 PRs combined in the original draft PR

Type of change

Please delete options that are not relevant.

  • [x] New feature (non-breaking change which adds functionality)

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

  • [x] Extensive unit testing
  • [x] End to end test with the 3 PRs from this series adding ExponentialHistogram support

Checklist:

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

mwear avatar Dec 22 '22 01:12 mwear

Codecov Report

Merging #3505 (9434b41) into main (56e6b1b) will increase coverage by 0.16%. The diff coverage is 97.53%.

:exclamation: Current head 9434b41 differs from pull request most recent head 51a1b23. Consider uploading reports for the commit 51a1b23 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3505      +/-   ##
==========================================
+ Coverage   93.56%   93.72%   +0.16%     
==========================================
  Files         275      277       +2     
  Lines        8126     8448     +322     
  Branches     1691     1754      +63     
==========================================
+ Hits         7603     7918     +315     
- Misses        523      530       +7     
Impacted Files Coverage Δ
.../packages/otlp-transformer/src/metrics/internal.ts 97.72% <ø> (ø)
.../aggregator/exponential-histogram/mapping/types.ts 100.00% <ø> (ø)
packages/sdk-metrics/src/export/MetricData.ts 100.00% <ø> (ø)
...sdk-metrics/src/aggregator/ExponentialHistogram.ts 97.15% <97.15%> (ø)
...cs/src/aggregator/exponential-histogram/Buckets.ts 98.01% <98.01%> (ø)
...r/exponential-histogram/mapping/ExponentMapping.ts 100.00% <100.00%> (ø)
.../exponential-histogram/mapping/LogarithmMapping.ts 100.00% <100.00%> (ø)
...trics/src/aggregator/exponential-histogram/util.ts 94.11% <100.00%> (+6.61%) :arrow_up:
packages/sdk-metrics/src/aggregator/types.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

codecov[bot] avatar Dec 22 '22 01:12 codecov[bot]

@open-telemetry/javascript-maintainers would like at least one more set of experienced eyes on this. @legendecas if you have time to look I would really appreciate it since you're the most familiar with the metrics SDK. @pichlermarc you've also done a lot of metrics work so your insight here would also be great.

dyladan avatar Feb 27 '23 17:02 dyladan