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 metric collections during PeriodicReader shutdown #1375

Merged
merged 8 commits into from
Nov 16, 2023

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Nov 15, 2023

A nit fix in metric collection during PeriodicReader shutdown.

The PeriodicReader performs a one last collection before shutting down. However, currently, the shutdown flag is set before the message is sent to initiate the collection process asynchronously. This result in situation where collection error's out as the reader is already shutdown:

     Finished dev [unoptimized + debuginfo] target(s) in 6.60s
     Running `/<path-to>/opentelemetry-rust/target/debug/metrics-basic`
     Error: Other("[Other(\"reader is shut down\")]")

The proposed PR resolves this by ensuring that the shutdown flag is only set after the completion of the collection."

Changes

Please provide a brief description of the changes here.

Merge requirement checklist

  • CONTRIBUTING guidelines followed
  • Unit tests added/updated (if applicable)
  • Appropriate CHANGELOG.md files updated for non-trivial, user-facing changes
  • Changes in public API reviewed (if applicable)

@lalitb lalitb requested a review from a team November 15, 2023 23:09
@lalitb lalitb changed the title Fix metric collections during PeridicReader shutdown Fix metric collections during PeriodicReader shutdown Nov 15, 2023
Copy link

codecov bot commented Nov 15, 2023

Codecov Report

Attention: 6 lines in your changes are missing coverage. Please review.

Comparison is base (c06c04b) 55.4% compared to head (9c0cfd0) 55.4%.

Files Patch % Lines
opentelemetry-sdk/src/metrics/periodic_reader.rs 0.0% 6 Missing ⚠️
Additional details and impacted files
@@          Coverage Diff          @@
##            main   #1375   +/-   ##
=====================================
  Coverage   55.4%   55.4%           
=====================================
  Files        147     147           
  Lines      18083   18084    +1     
=====================================
+ Hits       10021   10022    +1     
  Misses      8062    8062           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jtescher jtescher left a comment

Choose a reason for hiding this comment

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

Good call

@jtescher jtescher merged commit 33b5e9b into open-telemetry:main Nov 16, 2023
14 of 15 checks passed
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.

2 participants