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 method to OpenTelemetrySdk #5086

Closed
jack-berg opened this issue Jan 5, 2023 · 0 comments · Fixed by #5100
Closed

Add shutdown method to OpenTelemetrySdk #5086

jack-berg opened this issue Jan 5, 2023 · 0 comments · Fixed by #5100
Labels
Feature Request Suggest an idea for this project

Comments

@jack-berg
Copy link
Member

To shutdown OpenTelemetry you have to do something like:

    // Configure sdk
    OpenTelemetrySdk sdk = OpenTelemetrySdk.builder()
        ...
        .build();
    // .. run the app
    
    // Shutdown sdk
    sdk.getSdkLoggerProvider().shutdown().join(10, TimeUnit.SECONDS);
    sdk.getSdkTracerProvider().shutdown().join(10, TimeUnit.SECONDS);
    sdk.getSdkMeterProvider().shutdown().join(10, TimeUnit.SECONDS);

It's weird that there isn't a single OpenTelemetrySdk.shutodown() method that calls shutdown() on each of the providers and aggregates the responses.

Not a huge deal, but works against the idea that the SDK is a single thing you configure and instrument an application with. Currently, OpenTelemetrySdk acts as more of a collection of discreet tools.

@jack-berg jack-berg added the Feature Request Suggest an idea for this project label Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Suggest an idea for this project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant