Repository navigation
Description
What happened
t3 serve exports all of its spans into one trace for the life of the process. That trace has no exported root and never ends. On our server (up since 17 Nov), Tempo saw the trace pass its 50 MB per-trace limit about 20 hours after start. It now holds more than 260 MB and grows by about 20,000 spans per hour. Tempo rejects every new span in it. Opening the trace made two Tempo query pods run out of memory, so our observability team now drops all t3code-server spans.
Diagnosis
Long-lived fibers inherit a span that never ends, so nothing becomes a root.
cli/server.ts:runServerCommandisEffect.fn("server.runServerCommand")and runs the whole server inside it. Its span ends only at shutdown, so it is never exported.- HTTP: Effect's
HttpMiddleware.traceruses thetraceparentheader as parent, else the fiber's current span. MCP clients (claude-code, codex-mcp-client) send none, soGET/POST /mcpandGET /api/preview/tunnelbecome children of that span. scheduling/Scheduler.ts:registerisEffect.fn("Scheduler.register"), capturesEffect.context()once, and runs every tick with it. Each source keeps one parent span forever.serverActivation.ts:forkParkedFiberisEffect.fnand forks inside its own span.ClaudeAdapterV2.ts:runForkWith(yield* Effect.context())is captured at layer build.trackDescendantspolls once a second per Claude session on Linux, all under the server span.- T3 does not read
OTEL_TRACES_SAMPLER, soparentbased_traceidratiodoes not cut the volume.
Suggested: start a root span per HTTP request and per background tick (root: true), or drop the span from runServerCommand, Scheduler.register and forkParkedFiber. Main at 387d1c1 has the same code.
Steps to reproduce
- Start
t3 serve. An OTLP endpoint is optional, the local trace file shows it. - Open a Claude thread, and connect an MCP client.
- After a few minutes, count spans per
traceIdinlogs/server.trace.ndjson. Most spans share one trace ID. - The common
parentSpanIdofGET,POSTandClaudeAgentSdkQueryRunner.trackDescendantsspans is never written to the file. ScheduledTaskService.runDueTaskshas the sameparentSpanIdon every tick, also never written.
Version
0.1.10 (server process, from the runtime versions dir). Triage CLI is also 0.1.10.
Environment
- Linux x64 (kernel 6.18), Node 26.13.1, Effect 4.1.3
t3 serve --tailscale-servestarted withsetsid nohup, not a service- OTLP over http/protobuf to a local Grafana Alloy, then Tempo
- Clients: desktop app on Windows and mobile, over Tailscale. Claude and Codex threads.
Evidence
Tempo: trace 4762b219cc9927eec4eab47fbf4ae16e, no root span. Most spans hang off 18d3efa42a6f8ff0, which is never exported.
Local `server.trace.ndjson`, 11 files, 07:55 to 13:12 UTC on 26 Nov:
- 133,837 of 229,707 spans are in that trace
- 18d3efa42a6f8ff0 is never written. It has 15,653 direct children: 13,656 `ClaudeAgentSdkQueryRunner.trackDescendants`, 504 `tailscale.readTailscaleServeRootHolder`, 483 `GET`, 78 `POST`, 253 `ProcessGroupMetrics.sample`
- `ScheduledTaskService.runDueTasks`, `dispatchPendingWebhooks` and `UsageLimitRecoveryWorker.sweep`: 3,029 spans each, each with one fixed parent (37a3acc095be257f, d66454e1d365d2bd, 124d0ce220dd8f5c) that is never writtenRelated issues
- fix(server): each websocket RPC starts its own trace so Tempo keeps its spans #36863 gave each websocket RPC its own trace. This is the same problem for HTTP and background work.
- fix(server): bound OTLP trace export backlog #40710 bounds the OTLP export backlog
- Server trace log volume makes it Defender's top scanned file on Windows and rotates history out in about two hours #28196 trace log volume
- On macOS every open Claude session runs ps -A once a second, which floods endpoint security with process launches #37582, perf(server): track Claude descendants with the macOS resource monitor #43212 fixed the Claude descendant poll on macOS only
Fix applied or workaround
Set OTEL_TRACES_EXPORTER=none on the t3 serve process and restart. This stops trace export only. A restart alone starts a new trace that hits the limit again in about 20 hours.
Filed by
Claude Opus 5.5 (claude-opus-5-5) in Claude Code, through t3 triage.
Activity