Skip to content

fix(cli): isolate server request traces - #37395

Merged
StarpTech merged 3 commits into
v2from
isolate-server-traces
Jul 16, 2026
Merged

fix(cli): isolate server request traces#37395
StarpTech merged 3 commits into
v2from
isolate-server-traces

Conversation

@StarpTech

@StarpTechStarpTech commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • stop long-lived server lifecycle spans from parenting every HTTP request
  • remove the ambient Tracer.ParentSpan when installing the request handler
  • preserve inbound traceparent continuation and downstream propagation

Problem

Effect's Node HTTP server captures the current context when installing its handler. Previously that context contained the server lifecycle parent:

server lifecycle trace
├─ request A
├─ request B
└─ request C

Unrelated requests therefore shared one trace ID.

Fix

Process-lifetime boundaries are untraced, and handler installation explicitly omits Tracer.ParentSpan:

client traceparent (when supplied)
└─ request A
request B root (without client context)

Request tracing remains enabled. Headerless requests receive independent roots, while requests with traceparent continue the client trace.

Testing

  • in-process regression covering two independent roots and inbound context continuation
  • CLI tests: 32 passed
  • server tests: 10 passed
  • CLI, server, and workspace typechecks passed

@StarpTech
StarpTech merged commit 331533d into v2Jul 16, 2026
7 of 9 checks passed
@StarpTech
StarpTech deleted the isolate-server-traces branch July 16, 2026 22:52
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@StarpTech