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

Global error handler cleanup - MeterProvider #2237

Merged
merged 7 commits into from
Oct 24, 2024

Conversation

lalitb
Copy link
Member

@lalitb lalitb commented Oct 24, 2024

Fixes #
Design discussion issue (if applicable) #

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 as a code owner October 24, 2024 05:06
Copy link

codecov bot commented Oct 24, 2024

Codecov Report

Attention: Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.

Project coverage is 79.5%. Comparing base (0202299) to head (c68bbb7).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
opentelemetry-sdk/src/metrics/meter_provider.rs 25.0% 6 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            main   #2237     +/-   ##
=======================================
- Coverage   79.5%   79.5%   -0.1%     
=======================================
  Files        121     121             
  Lines      21113   21117      +4     
=======================================
+ Hits       16803   16805      +2     
- Misses      4310    4312      +2     

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

message = "Meter provider was already shut down; drop will not attempt shutdown again."
);
} else if let Err(err) = self.shutdown() {
otel_debug!(
Copy link
Contributor

Choose a reason for hiding this comment

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

This one is a better fit for otel_error, I guess? It's helpful to know if the metrics were not flushed out during the app/meter provider shutdown.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, deciding between otel_error and otel_debug is challenging in this case—since not all failure errors may be actionable by the user. We can make it more granular later to capture different types of errors and log them separately based on the error type. For now, it’s best to use otel_error, as it's a one-time error during shutdown, and no harm in user knowing even if they can't do anything.

@lalitb lalitb merged commit d3b1c47 into open-telemetry:main Oct 24, 2024
23 of 25 checks passed
if self.is_shutdown.load(Ordering::Relaxed) {
otel_debug!(
name: "MeterProvider.AlreadyShutdown",
message = "Meter provider was already shut down; drop will not attempt shutdown again."
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: change semicolon to comma?

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.

3 participants