propagate_attributes in atlanai SDK stamps association attributes onto every span started in its scope, including spans from third-party instrumentation you do not control. Use it to group traces into one session in Agent Registry and to attach a user, tags, or display name. To set the trace ID itself, use Set deterministic trace ID.
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
Wrap run in propagation scope
Run the agent inside the scope. Python arguments are keyword-only.
- Python
- TypeScript
session_id groups traces into one session. trace_name overrides the trace display name, which helps when the root span name is generic but the run has a meaningful external label. visitor_id attaches a visitor identity. Use a stable pseudonymous ID for user_id, not an email address.2
Verify attributes
Flush, then open the trace in Agent Registry. Confirm every span, including framework spans, carries the session, user, and tags, and that the run appears under the session.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
- Set deterministic trace ID: make retries converge on one trace.