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

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.56%. Comparing base (6864c2f) to head (b620d49).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5288   +/-   ##
=======================================
  Coverage   94.56%   94.56%           
=======================================
  Files         322      322           
  Lines        8132     8134    +2     
  Branches     1715     1716    +1     
=======================================
+ Hits         7690     7692    +2     
  Misses        442      442           
Files with missing lines Coverage Δ
...etrics/src/export/PeriodicExportingMetricReader.ts 98.27% <100.00%> (+0.06%) ⬆️

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

@pichlermarc pichlermarc added this pull request to the merge queue Jan 10, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 10, 2025
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.

thanks 👍

@pichlermarc pichlermarc added this pull request to the merge queue Jan 13, 2025
Merged via the queue into open-telemetry:main with commit 13e951a Jan 13, 2025
15 checks passed
pichlermarc added a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request Jan 13, 2025
… No Metrics (open-telemetry#5288)

Co-authored-by: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.com>
Co-authored-by: Marc Pichler <marc.pichler@dynatrace.com>
pichlermarc added a commit to dynatrace-oss-contrib/opentelemetry-js that referenced this pull request Jan 13, 2025
pichlermarc added a commit that referenced this pull request Jan 13, 2025
…MetricReader with no metrics (#5288) (#5340)

Co-authored-by: Jackson Weber <47067795+JacksonWeber@users.noreply.github.com>
Co-authored-by: Hector Hernandez <39923391+hectorhdzg@users.noreply.github.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.

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