You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because we're using the batch provider, and span information is sent
when the span *exits*, if we just let the process exit immediately, we
might lose some tracing data;
The [recommended pattern](open-telemetry/opentelemetry-rust#1961 (comment)) is to hold onto the providers and shut them down manually
as the process exits. This will wait for any spans to finish shipping
and avoid losing data.
Note, that we might want another pass at this in the future:
- integrate it into the panic handler that I added in another branch
- integrate something like [Tokio Graceful Shutdown](https://docs.rs/tokio-graceful-shutdown/latest/tokio_graceful_shutdown/) to intercept ctrl+C and the like
- add a timeout, so that a stalled metrics writer doesn't wait forever
I kept it simple for this PR, but just something we should keep in mind
0 commit comments