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(InMemoryMetricExporter) clear metrics after shutdown #5214

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

paper2
Copy link
Contributor

@paper2 paper2 commented Nov 27, 2024

Which problem is this PR solving?

Fixes #5131

Short description of the changes

  • make InMemoryMetricExporter reset storing metrics after shutdown

Type of change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

The InMemoryExporter does not directly affect the functionality of this library, but I consider it a minor specification change for the library. In fact, I encountered this issue while using InMemoryExporter in another project. If there are tests that retrieve metrics after shutdown, they will fail.

How Has This Been Tested?

  • should get no metrics after shutdown

Checklist:

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

@paper2 paper2 requested a review from a team as a code owner November 27, 2024 22:08
Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.58%. Comparing base (fd7f2d9) to head (2bf3748).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5214      +/-   ##
==========================================
- Coverage   94.59%   94.58%   -0.02%     
==========================================
  Files         314      314              
  Lines        7993     7994       +1     
  Branches     1611     1611              
==========================================
  Hits         7561     7561              
- Misses        432      433       +1     
Files with missing lines Coverage Δ
...s/sdk-metrics/src/export/InMemoryMetricExporter.ts 91.66% <100.00%> (+0.36%) ⬆️

... and 1 file with indirect coverage changes

@paper2 paper2 marked this pull request as draft November 27, 2024 22:15
@paper2 paper2 force-pushed the develop/clear-in-memoery-metrics-exporter-data-post-shutdown branch 3 times, most recently from 875ec47 to 5ba87cd Compare November 27, 2024 22:24
@paper2 paper2 changed the title Fixes #5131 Clear InMemoryMetricExporter Data Post-Shutdown to Align with Other Exporters fix(InMemoryMetricExporter) clear metrics after shutdown Nov 27, 2024
@paper2 paper2 force-pushed the develop/clear-in-memoery-metrics-exporter-data-post-shutdown branch from 5ba87cd to 2bf3748 Compare November 27, 2024 22:28
@paper2 paper2 marked this pull request as ready for review November 27, 2024 22:41
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.

Proposal: Clear InMemoryMetricExporter Data Post-Shutdown to Align with Other Exporters
1 participant