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) Don't Export from PeriodicExportingMetricReader with No Metrics #5288

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

JacksonWeber
Copy link
Contributor

@JacksonWeber JacksonWeber commented Dec 19, 2024

Which problem is this PR solving?

We should not attempt to export without metrics to export from the PeriodiicExportingMetricReader.

Fixes #5234

Short description of the changes

Adds a check to ensure that scope metrics are populated and updates related tests.

Type of change

Please delete options that are not relevant.

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

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

  • should not export without populated scope metrics

Checklist:

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

@JacksonWeber JacksonWeber requested a review from a team as a code owner December 19, 2024 21:13
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.62%. Comparing base (90afa28) to head (cd6c29f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5288   +/-   ##
=======================================
  Coverage   94.62%   94.62%           
=======================================
  Files         323      323           
  Lines        8068     8069    +1     
  Branches     1637     1638    +1     
=======================================
+ Hits         7634     7635    +1     
  Misses        434      434           
Files with missing lines Coverage Δ
...etrics/src/export/PeriodicExportingMetricReader.ts 98.24% <100.00%> (+0.03%) ⬆️

Copy link
Contributor

@maryliag maryliag left a comment

Choose a reason for hiding this comment

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

you have a lint error, otherwise LGTM

CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Member

@hectorhdzg hectorhdzg left a comment

Choose a reason for hiding this comment

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

LGTM

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.

PeriodicExportingMetricReader tries to export when there's no data
3 participants