Commit 51835e1
authored
One http.server span per request: the worker defers to Effect's tracer (#985)
Every API/MCP request produced TWO identical sibling http.server spans:
the worker-boundary span server.ts opens (scope executor-cloud-worker)
AND the one Effect's HttpMiddleware.tracer opens for app-owned paths
(scope executor-cloud) — both joined the caller's traceparent, so the
waterfall showed a childless twin next to the real envelope, and server
span ingest was doubled (visible in Axiom: 39.7k executor-cloud vs
24.9k executor-cloud-worker spans on /mcp alone).
The worker now skips its span for app-owned paths (app-paths.ts: /api/*,
/mcp, /.well-known/*) — Effect's middleware already parses traceparent
and parents the workos/store/db children there. Non-app paths (Start
SSR, marketing proxy, /_astro assets) keep the worker envelope span,
and the flush-on-waitUntil still runs on both branches so batched
exports survive the isolate.
Verified against the suite motel: API scenario + browser scenario runs
now record exactly one http.server per trace (worker scope only on /
and SSR routes), browser→server join intact (executor-web client span
→ executor-cloud server span → workos/user_store/fumadb children);
cloud observability unit tests green.
Found via the prod Axiom dataset right after #981 made browser traces
land — the duplicate was previously invisible without the join.1 parent 2d86581 commit 51835e1
1 file changed
Lines changed: 23 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
56 | 67 | | |
57 | 68 | | |
58 | 69 | | |
| |||
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
81 | 104 | | |
82 | 105 | | |
83 | 106 | | |
| |||
0 commit comments