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

fix(sdk-metrics): preserve startTime for cumulative ExponentialHistograms #3934

Merged
merged 3 commits into from
Jun 29, 2023

Conversation

aabmass
Copy link
Member

@aabmass aabmass commented Jun 21, 2023

Which problem is this PR solving?

Fixes #3931

Short description of the changes

We were throwing away previous value's startTime. This updates to keep the older (previous) startTime when merging. See similar logic for Histograms: https://github.com/aabmass/opentelemetry-js/blob/b4fde50bb8e9848e70b1c9c2db5d6909741b422c/packages/sdk-metrics/src/aggregator/Histogram.ts#L154

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 a new integration/regression test. Updated the unit tests.

Checklist:

  • Followed the style guidelines of this project
  • Unit tests have been added

@aabmass aabmass force-pushed the starttimebugfix branch 2 times, most recently from 246c4ba to 2852cbf Compare June 21, 2023 21:03
@aabmass aabmass marked this pull request as ready for review June 21, 2023 21:07
@aabmass aabmass requested a review from a team June 21, 2023 21:07
@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Merging #3934 (929a683) into main (10c3e93) will increase coverage by 0.06%.
The diff coverage is 100.00%.

❗ Current head 929a683 differs from pull request most recent head 4c46fd5. Consider uploading reports for the commit 4c46fd5 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3934      +/-   ##
==========================================
+ Coverage   92.90%   92.97%   +0.06%     
==========================================
  Files         297      297              
  Lines        8838     8839       +1     
  Branches     1815     1815              
==========================================
+ Hits         8211     8218       +7     
+ Misses        627      621       -6     
Impacted Files Coverage Δ
...sdk-metrics/src/aggregator/ExponentialHistogram.ts 98.11% <100.00%> (+0.95%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Member

@pichlermarc pichlermarc left a comment

Choose a reason for hiding this comment

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

Looks good, thanks for fixing this 🙂
cc @mwear would you mind taking a look? 🙂

@pichlermarc pichlermarc added release:next-minor-version bug Something isn't working priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect labels Jun 22, 2023
Copy link
Member

@mwear mwear left a comment

Choose a reason for hiding this comment

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

LGTM, this was definitely an oversight. Thanks for finding and fixing @aabmass!

@pichlermarc pichlermarc merged commit e2e291c into open-telemetry:main Jun 29, 2023
@aabmass aabmass deleted the starttimebugfix branch June 29, 2023 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:p2 Bugs and spec inconsistencies which cause telemetry to be incomplete or incorrect
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cumulative ExponentialHistogram resets start time each collection
3 participants