Relationships
#2617 swamp.cli.bootstrap, configure_extension_loaders and teardown spans each start their own trace
Opened by hammz · 9/28/2026· Shipped 9/29/2026
Problem
With tracing enabled, one CLI invocation produces four separate traces instead of one. swamp.cli.bootstrap (src/cli/mod.ts around line 1878), swamp.cli.configure_extension_loaders (around line 1940) and swamp.cli.teardown (around line 2219) are started with getTracer().startSpan(...) outside the swamp.cli span (withSpan around line 2201). With no active context each one becomes a root span with its own trace ID, and configure_extension_loaders is not a child of bootstrap either.
Reproduction
OTEL_TRACES_EXPORTER=console swamp workflow run <any workflow> prints:
swamp.cli.configure_extension_loaders— parentId undefined, trace Aswamp.cli.bootstrap— parentId undefined, trace Bswamp.cli>swamp.workflow.run.command> ... — trace Cswamp.cli.teardown— parentId undefined, trace D
Expected
Bootstrap and teardown time appears in the same trace as the command, so a backend shows the full invocation, including startup and shutdown cost, as one trace. That could mean a root span covering bootstrap, command and teardown, or making configure_extension_loaders a child of bootstrap and parenting both phases to the command's root. If the split is intentional (for example, bootstrap runs before --traceparent is parsed), document why in the OpenTelemetry reference.
Notes
Found while reproducing swamp-club#2589.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.