Refactor shared tracing queue to isolate tenant routing state
Open
project#dify
- Dominant language
- TypeScript
- Stars
- 156k
- Forks
- 24.6k
- Avg merge
- 22h 9m
- Merged PRs (30d)
- 610
Description
## Problem
The tracing pipeline uses a process-wide queue, while `TraceQueueManager` is request-scoped and carries `app_id`, `user_id`, provider, and Flask lifecycle state. The fix merged in #41403 preserves the originating `app_id` on each task, but the underlying design still couples a global work stream to stateful manager/timer instances.
This makes tenant routing correctness depend on mutable task state and leaves timer ownership, queue draining, and failure isolation difficult to reason about.
Contributor guide
Assessment
This issue has not been assessed yet.