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

Add shutdown / close to OpenTelemetrySdk #5100

Merged
merged 2 commits into from
Jan 10, 2023

Conversation

jack-berg
Copy link
Member

Resolves #5086.

@jack-berg jack-berg requested a review from a team January 6, 2023 21:16
@codecov
Copy link

codecov bot commented Jan 6, 2023

Codecov Report

Base: 91.05% // Head: 91.06% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (e1f8ad0) compared to base (5e74487).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #5100   +/-   ##
=========================================
  Coverage     91.05%   91.06%           
+ Complexity     4889     4888    -1     
=========================================
  Files           553      553           
  Lines         14467    14468    +1     
  Branches       1388     1388           
=========================================
+ Hits          13173    13175    +2     
  Misses          896      896           
+ Partials        398      397    -1     
Impacted Files Coverage Δ
...nfigure/AutoConfiguredOpenTelemetrySdkBuilder.java 97.18% <100.00%> (-0.14%) ⬇️
...in/java/io/opentelemetry/sdk/OpenTelemetrySdk.java 97.50% <100.00%> (+1.07%) ⬆️
.../sdk/autoconfigure/MeterProviderConfiguration.java 100.00% <0.00%> (ø)
...telemetry/sdk/trace/export/BatchSpanProcessor.java 93.10% <0.00%> (+0.68%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@@ -390,6 +375,10 @@ public AutoConfiguredOpenTelemetrySdk build() {
.setPropagators(propagators);

openTelemetrySdk = sdkBuilder.build();

if (registerShutdownHook) {
Runtime.getRuntime().addShutdownHook(new Thread(openTelemetrySdk::shutdown));
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't that be close instead of shutdown?

Suggested change
Runtime.getRuntime().addShutdownHook(new Thread(openTelemetrySdk::shutdown));
Runtime.getRuntime().addShutdownHook(new Thread(openTelemetrySdk::close));

@jack-berg jack-berg merged commit 4df4a0a into open-telemetry:main Jan 10, 2023
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.

Add shutdown method to OpenTelemetrySdk
3 participants