How do I gracefully shutdown the SDK? #1357
Replies: 3 comments 2 replies
-
We discussed this in SIG on August 2. IIRC — we did not decide that this functionality should definitely exist in the SDK, but rather that if we want to provide this functionality, it would be in the SDK. Am I remembering that right @mwear @robertlaurin @arielvalentin @ericmustin? |
Beta Was this translation helpful? Give feedback.
-
The SDK provides the functions to call for graceful shutdown, but it cannot and should not anticipate every environment it might run in. Graceful shutdown is an application and/or application framework concern. IIRC we have a complicated set of Unicorn lifecycle hooks at Shopify, for example, and using It is reasonable for Sidekiq instrumentation, for example, to optionally register job worker shutdown hooks that call the SDK's |
Beta Was this translation helpful? Give feedback.
-
It depends a lot on their environment and application framework. E.g. a Lambda style environment will probably want to Without the lifecycle hooks, relying on
No. Not least because the order of initialization will be somewhat unpredictable.
For one-off scripts, |
Beta Was this translation helpful? Give feedback.
-
This discussion came out of a pull request for Rake instrumentation that registered an
at_exit
hook to shutdown the SDK however:Originally posted by @arielvalentin in open-telemetry/opentelemetry-ruby-contrib#80 (comment)
What is the best way for users to gracefully shutdown the SDK?
Should the SDK register
at_exit
hooks automatically?Should this be left to end users? How do minimize friction for new users who want to see traces for one-off scripts?
Beta Was this translation helpful? Give feedback.
All reactions