agentflight_export_otel
Converts recorded agent cassette spans into W3C TraceContext and OpenTelemetry JSON traces, enabling latency waterfall visualization and distributed tracing in APM platforms.
Instructions
Export recorded AgentFlight cassette spans into W3C TraceContext and OpenTelemetry JSON traces.
Purpose
Converts recorded agent execution spans into OpenTelemetry-compliant trace spans with standard gen_ai semantic conventions, enabling critical-path latency waterfall visualization and distributed tracing in systems like StackPulse, Jaeger, or Datadog.
When to use
Exporting agent trajectories into APM or observability platforms for SLO tracking and latency bottleneck analysis.
Visualizing parent-child relationships and parallel tool execution spans.
When NOT to use
Do NOT use to verify hash chain cryptographic integrity; use
agentflight_verify_cassetteinstead.Do NOT use to compare two trajectories for regressions; use
agentflight_diff_cassettesinstead.
Behavior & Side Effects
If
output_pathis provided, writes the formatted OpenTelemetry JSON to that file; otherwise returns spans in-memory.Idempotent: Successive calls with identical arguments produce identical span outputs.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"cassette_path": "<cassette_path>"
},
"name": "agentflight_export_otel"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| output_path | No | Optional filesystem path where OpenTelemetry trace JSON will be saved. If omitted, spans are returned in payload only. | |
| service_name | No | Optional service name to populate in OpenTelemetry resource attributes. Defaults to cassette agent_id. | |
| cassette_path | Yes | Filesystem path to the input .flight.json or .flight.jsonl cassette file. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| spans | Yes | Array of W3C TraceContext compliant span dictionaries. | |
| span_count | Yes | Total number of OpenTelemetry spans generated. |