Skip to content

Conversation

@patilsnr
Copy link
Contributor

@patilsnr patilsnr commented Nov 12, 2025

Description
The current sample app that uses shutdown() on Otel components to gracefully shutdown and flush logs does not compile. This change adds a wrapper function around the Otel constructor to return a shutdown handler, which allows more explicit control and ownership of the shutdown handler.

Changes

  • Add Otel::with_shutdown_handle() to return ShutdownHandle
  • Remove redundant shutdown methods, use channel directly
  • Centralize graceful shutdown logic in run() method
  • Update sample app and tests to use tuple return pattern
  • Add target/ directories to .gitignore

Tests
Sample app run and works, integration tests pass.

- Change Otel::new() to return (Otel, mpsc::Sender<()>)
- Remove redundant shutdown methods, use channel directly
- Centralize graceful shutdown logic in run() method
- Update sample app and tests to use tuple return pattern
- Add target/ directories to .gitignore
@patilsnr patilsnr changed the title refactor: return shutdown sender from Otel::new() as tuple Add ShutdownHandle to Otel to gracefully shutdown component while it is running Nov 12, 2025
@danewalton-msft danewalton-msft merged commit 665535f into Azure:main Nov 14, 2025
4 checks passed
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.

3 participants