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

Inject OTEL provider into command context #53

Closed

Conversation

alecmerdler
Copy link

@alecmerdler alecmerdler commented Feb 22, 2024

The OpenTelemetry library flushes traces asynchronously, so pending traces can be lost when the application terminates. This adds the OTEL provider to the command context so that clients can call provider.Shutdown() and ensure that all traces are flushed before exiting the program.

Addresses #52

The OpenTelemetry library flushes traces asynchronously, so
pending traces can be lost when the application terminates.
This adds the OTEL provider to the command context so that
clients can call 'provider.Shutdown()' and ensure that all
traces are flushed before exiting the program.
@alecmerdler
Copy link
Author

Closing as we can get the provider using otel.GetTracerProvider() and type-cast it to a trace.TracerProvider to call Shutdown().

@alecmerdler alecmerdler deleted the fix-missing-otel-traces branch February 22, 2024 21:42
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.

None yet

1 participant