pingdotgg / pingdotgg/t3code

[Bug]: Effect span exporter writes to disk unconditionally with no way to disable it

Open
#8,764 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
23k
Forks
5.9k
Avg merge
11h 14m
Merged PRs (30d)
357

Description

Before submitting
  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.
Area

apps/server

Steps to reproduce
  1. Start the server with t3 serve.
  2. Run an interactive session that produces terminal output.
  3. Inspect ~/.t3/userdata/logs/server.trace.ndjson and its rotated siblings.
Expected behavior

Span export to disk is off by default in a long-running server, or can be disabled through a documented flag or environment variable.

Actual behavior

The server writes Effect tracing spans to ~/.t3/userdata/logs/server.trace.ndjson for the whole life of the process. The file rotates through 11 files of 10 MB, a new one roughly every 12 minutes under ordinary use, indefinitely.

Records are marked "sampled":true with no sampling reduction, and spans are emitted per terminal event, so the volume tracks terminal output rather than anything the operator configures.

There is no supported way to turn it off:

  • T3CODE_TRACE_FILE changes the path but does not disable the exporter, and the directory creation for it runs unconditionally.
  • T3CODE_LOG_LEVEL defaults to Info and governs the logger, not this file.
  • t3 serve --help exposes no tracing or verbosity control.
Impact

Major degradation or frequent failure

Version or commit

0.0.34 and 0.0.36

Environment

Platform-independent; reproduced on Linux with the published npm releases.

Logs or stack traces
{"type":"effect-span","name":"terminal.queuePersist","sampled":true,...}
{"type":"effect-span","name":"terminal.drainProcessEvents","sampled":true,...}
Workaround

Point T3CODE_TRACE_FILE at a path on a tmpfs, so the writes never reach persistent storage.

Related
  • #7991 overlaps: the spans above come from the terminal persistence path it describes. That issue is about the terminal history file growing and being rewritten; this one is about the span exporter being unconditional, which stands regardless of how history persistence is bounded.
  • #8345 is the same theme of unbounded disk growth from a different cause.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in apps/server by locating the Effect span exporter and the setup driven by T3CODE_TRACE_FILE, then check how t3 serve exposes configuration in its help output. Verify whether tracing can be disabled by default or through a documented flag or environment variable, and reproduce the server session to confirm that span files are no longer written when disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend, observability
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.