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): do not report empty scopes and metrics #4135

Merged
merged 15 commits into from
Sep 28, 2023

Conversation

pichlermarc
Copy link
Member

Which problem is this PR solving?

This PR changes the behavior of the SDK to not report empty scopes (currently exported when a Meter is created, but never used), or empty metrics (instruments that were created, but never observed).

Fixes #4130
Partially addresses #4096 (now, never observed instruments are not exported).

Type of change

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

How Has This Been Tested?

  • Adapted exisitng Tests

@codecov
Copy link

codecov bot commented Sep 11, 2023

Codecov Report

Merging #4135 (228a8cb) into main (6bf1b78) will increase coverage by 0.02%.
The diff coverage is 94.44%.

❗ Current head 228a8cb differs from pull request most recent head c423a61. Consider uploading reports for the commit c423a61 to get more accurate results

@@            Coverage Diff             @@
##             main    #4135      +/-   ##
==========================================
+ Coverage   92.28%   92.30%   +0.02%     
==========================================
  Files         329      329              
  Lines        9370     9382      +12     
  Branches     1991     1996       +5     
==========================================
+ Hits         8647     8660      +13     
+ Misses        723      722       -1     
Files Coverage Δ
packages/sdk-metrics/src/state/MetricCollector.ts 100.00% <100.00%> (ø)
...s/sdk-metrics/src/state/TemporalMetricProcessor.ts 98.30% <100.00%> (+0.09%) ⬆️
packages/sdk-metrics/src/state/MeterSharedState.ts 96.61% <83.33%> (+0.31%) ⬆️

... and 1 file with indirect coverage changes

@pichlermarc pichlermarc marked this pull request as ready for review September 12, 2023 15:04
@pichlermarc pichlermarc requested a review from a team September 12, 2023 15:04
CHANGELOG.md Outdated Show resolved Hide resolved
@pichlermarc pichlermarc merged commit 52f428a into open-telemetry:main Sep 28, 2023
15 checks passed
@pichlermarc pichlermarc deleted the fix/4130 branch September 28, 2023 12:17
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.

Metrics exported even when metrics or metrics.dataPoints arrays are empty
3 participants