Skip to content
Source
Sign inSign up
pingdotgg/t3code

perf(server): trace logs keep hours of history instead of minutes #5780

Closedt3dotgg(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromt3code/trace-log-churnopened View on GitHub

Showing 17 changed files with 10 additions and 2 deletions (loading 14).

x
0 of 17 viewed, 17 left
2 additions and 1 deletionapps/server/src/cli/config.test.tsModified
View file
@@ -45,7 +45,8 @@
traceTimingEnabled: true,
traceBatchWindowMs: 1_000,
traceMaxBytes: 10 * 1024 * 1024,
- traceMaxFiles: 10,
+ traceMaxFiles: 30,
+ traceKeepAllSpans: false,
otlpTracesUrl: undefined,
otlpMetricsUrl: undefined,
otlpExportIntervalMs: 10_000,
7 additions and 1 deletionapps/server/src/cli/config.tsModified
View file
@@ -84,8 +84,13 @@
Config.map(Option.getOrUndefined),
),
traceMaxBytes: Config.int("T3CODE_TRACE_MAX_BYTES").pipe(Config.withDefault(10 * 1024 * 1024)),
- traceMaxFiles: Config.int("T3CODE_TRACE_MAX_FILES").pipe(Config.withDefault(10)),
+ // Rotated backups are gzip-compressed (~12x on span NDJSON), so a larger
+ // file count buys hours of incident history for tens of megabytes.
+ traceMaxFiles: Config.int("T3CODE_TRACE_MAX_FILES").pipe(Config.withDefault(30)),
traceBatchWindowMs: Config.int("T3CODE_TRACE_BATCH_WINDOW_MS").pipe(Config.withDefault(1_000)),
+ // Escape hatch: persist every sampled span (no tail filtering) when full
+ // fidelity matters more than the retention window.
+ traceKeepAllSpans: Config.boolean("T3CODE_TRACE_KEEP_ALL_SPANS").pipe(Config.withDefault(false)),
otlpTracesUrl: Config.string("T3CODE_OTLP_TRACES_URL").pipe(
Config.option,
Config.map(Option.getOrUndefined),