create_trace_id in atlanai SDK derives a trace ID from a stable external key. Use it when a run starts from something that already has an ID, such as a webhook, a ticket, or a queue message, so retries and multi-service handling land on one trace. The same seed always gives the same ID in Python and TypeScript.
Before you begin
Before you start, make sure you have:- SDK: atlanai SDK installed with tracing, as in Install atlanai SDK.
- Tracing:
initconfigured and exporting, as in Trace first agent run.
1
Derive trace ID
Pass the external key as the seed.On a runtime without Node crypto, use
- Python
- TypeScript
createTraceIdAsync.2
Start root span with trace ID
Pass the ID in the trace context of the root span.The derivation is Langfuse-compatible, so a run already keyed by seed in Langfuse keeps the same trace ID here.
- Python
- TypeScript
3
Verify trace ID
Run the handler twice with the same key, flush, and open the trace in Agent Registry. Confirm both runs appear under one trace ID instead of two traces.If no trace appears, see
init() disables tracing and no traces are exported.Troubleshooting
If traces do not appear, see Install and setup errors.Next steps
- Add scores: attach evaluation results to the trace.