upload_atif_trajectories_as_spans converts ATIF JSON files into OpenTelemetry-compatible span trees and uploads them to any Phoenix project, letting you visualize offline agent runs alongside live instrumented traces.
Trace Structure
Each trajectory becomes one trace. The span hierarchy follows the causal model used by real-time instrumentors — TOOL spans are siblings of the LLM spans under the AGENT, not children:subagent_trajectory_ref are linked into a single trace when uploaded together.
Usage
Key Details
- Supported versions: ATIF schema v1.0 through v1.6
- Deterministic IDs: trace and span IDs are derived from
session_idvia SHA-256 — re-uploading the same trajectory is idempotent - Multimodal content (v1.6+): image content parts are stored using the OpenInference
message.contentsarray format - Continuation merging: sessions split across files (
session_idending in-cont-N) are automatically merged into one trace - Attribute mapping: token counts, cost, model name, tool definitions, and reasoning content are mapped to standard OpenInference attributes

