opentelemetry-java
opentelemetry-java copied to clipboard
Add registerShutdownHook to AutoConfigurationCustomizer interface
Is your feature request related to a problem? Please describe.
I'd like to be able to suppress the SDK's shutdown hook and register my own because of shutdown ordering concerns.
Describe the solution you'd like
Expose the registerShutdownHook
on AutoConfigurationCustomizer
Describe alternatives you've considered
Casting the AutoConfigurationCustomizer
to a AutoConfiguredOpenTelemetrySdkBuilder
and calling registerShutdownHook
on that class (which works).
This seems reasonable to me 👍
Hmm - I don't think there was an expected use case for this for the SDK. Registering a shutdown hook or not seems like a concern a framework author wouldn't want to let customization, since they generally control the lifecycle of the SDK. The current customizing is mostly for controlling telemetry behavior in extensions but not lifecycle.
Can anyone think of a framework case where it would be good to be able to customize shutdown downstream? Otherwise does it seem better as a javaagent extension if that is more specific to javaagent distros?
Closing as "wontfix" because sufficient time has passed and there are no additional details.