opentelemetry-java icon indicating copy to clipboard operation
opentelemetry-java copied to clipboard

Add registerShutdownHook to AutoConfigurationCustomizer interface

Open trask opened this issue 2 years ago • 2 comments

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).

trask avatar May 19 '22 00:05 trask

This seems reasonable to me 👍

jack-berg avatar May 24 '22 20:05 jack-berg

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?

anuraaga avatar May 25 '22 01:05 anuraaga

Closing as "wontfix" because sufficient time has passed and there are no additional details.

jack-berg avatar Nov 30 '23 22:11 jack-berg