-
Notifications
You must be signed in to change notification settings - Fork 825
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): InMemoryMetricExporter
clear metrics after shutdown
#5214
base: next
Are you sure you want to change the base?
fix(sdk-metrics): InMemoryMetricExporter
clear metrics after shutdown
#5214
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## next #5214 +/- ##
==========================================
+ Coverage 94.56% 94.63% +0.06%
==========================================
Files 316 323 +7
Lines 8037 8085 +48
Branches 1628 1643 +15
==========================================
+ Hits 7600 7651 +51
+ Misses 437 434 -3
|
875ec47
to
5ba87cd
Compare
5ba87cd
to
2bf3748
Compare
CHANGELOG.md
Outdated
@@ -12,6 +12,7 @@ For semantic convention package changes, see the [semconv CHANGELOG](packages/se | |||
### :boom: Breaking Change | |||
|
|||
* feat(sdk-metrics): Add support for aggregation cardinality limit with a default limit of 2000. This limit can be customized via views [#5182](https://github.com/open-telemetry/opentelemetry-js/pull/5128) | |||
* fix(InMemoryMetricExporter) clear metrics after shutdown to align with other exporters [#5131](https://github.com/open-telemetry/opentelemetry-js/issues/5131) @paper2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this should be considered breaking. The API remains intact and it's a fix to have the proper behaviour 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your review!! I try to move it 🚀 (Enhancement).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. This is a breaking change for sure. It should go into the 'next' branch, not 'main'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change on CHANGELOG.md has been reverted to breaking change and I have changed target to next
branch.
This PR has much conflicts. Should I make a new PR from next
branch and add same change it?
InMemoryMetricExporter
clear metrics after shutdown
@paper2 I've updated the title to follow the guidelines :) |
bbd9b5f
to
b3c14d5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please re-target the PR to 'next' - it may be breaking for end-users that rely on this behavior in integration tests.
6db79c4
to
be236d7
Compare
be236d7
to
c91f1d7
Compare
…o develop/clear-in-memoery-metrics-exporter-data-post-shutdown
await exporter.shutdown(); | ||
|
||
const otherMetrics = exporter.getMetrics(); | ||
assert.ok(otherMetrics.length === 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert.ok(otherMetrics.length === 0); | |
assert.strictEqual(otherMetrics.length, 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I have fixed it.
use strictEqual function instead of ok
Other assert.ok(xxx === yyy)
expressions exists in this test file. Should I fix them too??
Which problem is this PR solving?
Fixes #5131
Short description of the changes
Type of change
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?
Checklist: