Skip to main content
The ax spans commands let you export span data from your Arize projects.

ax spans export

Export spans to a JSON file. Filter by trace ID, span ID, or session ID (mutually exclusive), and optionally combine with --filter for additional narrowing. Without any ID flag, all spans matching the time window are exported.
ax spans export <project> [--trace-id <id>] [--span-id <id>] [--session-id <id>] [--filter <expr>] [--days <n>] [--start-time <time>] [--end-time <time>] [--limit <n>] [--output-dir <path>] [--stdout] [--all]
OptionDescription
projectProject name or ID (required, positional argument)
--trace-idFilter to spans belonging to a specific trace
--span-idFilter to a specific span
--session-idFilter to spans in a specific session
--filterAdditional filter expression (e.g. "status_code = 'ERROR'", "latency_ms > 1000")
--spaceSpace name or ID (required when using --all)
--daysLookback window in days (default: 30)
--start-timeOverride start of time window (ISO 8601)
--end-timeOverride end of time window (ISO 8601)
--limitMaximum number of spans to export (default: 100, ignored with --all)
--output-dirDirectory to write the output file (default: current directory)
--stdoutPrint JSON to stdout instead of saving to a file
--allUse Arrow Flight for bulk export — streams all matching spans, ignores --limit
--trace-id, --span-id, and --session-id are mutually exclusive. Only one may be provided per invocation.
Examples:
# Export the last 30 days of spans for a project
ax spans export proj_abc123

# Export spans for a specific trace
ax spans export proj_abc123 --trace-id abc123def456

# Export error spans with a filter
ax spans export proj_abc123 --filter "status_code = 'ERROR'" --limit 200

# Export spans for a specific session
ax spans export my-project --session-id sess_xyz --space sp_abc123

# Bulk export via Arrow Flight (all spans, no limit)
ax spans export my-project --all --space sp_abc123

# Print to stdout for use in a pipeline
ax spans export proj_abc123 --stdout | jq '.[0]'