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
Copy file name to clipboardExpand all lines: docs/tracing.md
+51Lines changed: 51 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,6 +44,57 @@ By default, the trace is named "Agent workflow". You can set this name if you us
44
44
45
45
In addition, you can set up [custom trace processors](#custom-tracing-processors) to push traces to other destinations (as a replacement, or secondary destination).
46
46
47
+
## Long-running workers and immediate exports
48
+
49
+
The default [`BatchTraceProcessor`][agents.tracing.processors.BatchTraceProcessor] exports traces
50
+
in the background every few seconds, or sooner when the in-memory queue reaches its size trigger,
51
+
and also performs a final flush when the process exits. In long-running workers such as Celery,
52
+
RQ, Dramatiq, or FastAPI background tasks, this means traces are usually exported automatically
53
+
without any extra code, but they may not appear in the Traces dashboard immediately after each job
54
+
finishes.
55
+
56
+
If you need an immediate delivery guarantee at the end of a unit of work, call
57
+
[`flush_traces()`][agents.tracing.flush_traces] after the trace context exits.
0 commit comments