-
Notifications
You must be signed in to change notification settings - Fork 525
Add global::meter_provider_shutdown #1623
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
Changes from 3 commits
b3b1f23
1198515
cd9c072
3b0d183
f00638a
d5f3ed3
045b440
9fe2585
46c5267
f8d30a1
7a6f7c9
140a7d8
c14325c
9dc65e5
df0943b
46f41d5
7d8bcf3
4b4fdbe
1fdb432
aefbaaf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ use std::{ | |
}; | ||
|
||
use opentelemetry::{ | ||
global, | ||
metrics::{noop::NoopMeterCore, Meter, MeterProvider, MetricsError, Result}, | ||
KeyValue, | ||
}; | ||
|
@@ -113,6 +114,16 @@ impl SdkMeterProvider { | |
} | ||
} | ||
|
||
impl Drop for SdkMeterProvider { | ||
lalitb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
fn drop(&mut self) { | ||
if self.is_shutdown.load(Ordering::Relaxed) { | ||
return; | ||
} | ||
if let Err(err) = self.shutdown() { | ||
cijothomas marked this conversation as resolved.
Show resolved
Hide resolved
|
||
global::handle_error(err); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this might cause false alarms.. it is normal for users to call shutdown of their own, and then drop will call it again, causing the global error handler to print a message. It is unactionable for users, and they haven't anything wrong either.... Might need to revisit. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's even worse because this is bugged because |
||
} | ||
} | ||
} | ||
impl MeterProvider for SdkMeterProvider { | ||
fn versioned_meter( | ||
&self, | ||
|
Uh oh!
There was an error while loading. Please reload this page.