Use `AppCleanup` rather than shutdown hook for flushing traces.