Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneeshammz

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 A
  • swamp.cli.bootstrap — parentId undefined, trace B
  • swamp.cli > swamp.workflow.run.command > ... — trace C
  • swamp.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.

02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 7 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

9/29/2026, 3:00:13 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
hammz assigned hammz9/29/2026, 2:34:02 PM

Sign in to post a ripple.