Shutdown methods should wait on the channels to shutdown
- Dominant language
- TypeScript
- Stars
- 188
- Forks
- 8
- PR merge metrics
- No merged PRs in 30d
Description
The shutdown methods (e.g. https://github.com/dylibso/observe-sdk/blob/main/rust/src/adapter/otelstdout.rs#L97 ) should wait on the runtime instance to close it's side of the event channel. This does get tricky because we don't have a way to tell the runtime instance it needs to stop sending events. So the parts of this issue will be:
1. the `Collector` needs to signal the `InstrumentationContext` that we're shutting down even collection
2. A way for the `InstrumentationContext` to know that we are no longer collecting events, all future calls from the module should be noops (e.g. https://github.com/dylibso/observe-sdk/blob/main/rust/src/lib.rs#L135 )
3. The `InstrumentationContext` needs to close `events_tx`
4. When the `Collector` sees the channel is closed it needs to call `shutdown` on the adapter ( https://github.com/dylibso/observe-sdk/blob/main/rust/src/adapter/mod.rs#LL30C37-L30C48 )
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.