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

[SDK] Metrics ObservableRegistry Cleanup #2376

Merged
merged 3 commits into from
Oct 18, 2023

Conversation

perhapsmaple
Copy link
Contributor

Fixes #2373, #2081

Changes

Added a function called CleanupCallbacks to ObservableRegistry that is called from the destructor of ObservableInstrument to remove back pointers from the registry.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

@perhapsmaple perhapsmaple requested a review from a team October 18, 2023 16:45
Copy link
Member

@lalitb lalitb left a comment

Choose a reason for hiding this comment

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

Thanks.

@codecov
Copy link

codecov bot commented Oct 18, 2023

Codecov Report

Merging #2376 (55cb77d) into main (e918960) will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2376      +/-   ##
==========================================
+ Coverage   87.41%   87.43%   +0.03%     
==========================================
  Files         199      199              
  Lines        6018     6028      +10     
==========================================
+ Hits         5260     5270      +10     
  Misses        758      758              
Files Coverage Δ
sdk/src/metrics/async_instruments.cc 100.00% <100.00%> (ø)
sdk/src/metrics/state/observable_registry.cc 83.34% <100.00%> (+3.34%) ⬆️

@marcalff marcalff changed the title ObservableRegistry Cleanup [SDK] Metrics ObservableRegistry Cleanup Oct 18, 2023
Copy link
Member

@marcalff marcalff left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix.

@marcalff marcalff merged commit 231ca4a into open-telemetry:main Oct 18, 2023
44 checks passed
@perhapsmaple perhapsmaple deleted the cleanup_registry branch October 28, 2023 10:07
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.

Error during observe.The metric storage is invalid on removing callbacks
3 participants