@@ -22,7 +22,7 @@ If you want a log message to show up in the trace file, emit it inside an active
2222
2323### Traces
2424
25- Completed spans are written as NDJSON records to ` serverTracePath ` (by default, ` ~/.t3 /userdata/logs/server.trace.ndjson ` ).
25+ Completed spans are written as NDJSON records to ` serverTracePath ` (by default, ` ~/.bcode /userdata/logs/server.trace.ndjson ` ).
2626
2727Important fields in each record:
2828
@@ -58,6 +58,11 @@ There are two useful modes:
5858
5959The local trace file is always on. OTLP export is opt-in.
6060
61+ > ** Env var deprecation window (v0.0.19):** All ` BCODE_* ` env vars below are
62+ > also read from their legacy ` T3CODE_* ` names through v0.0.19, with a
63+ > one-time ` [bcode] ` console warning per legacy key. The ` T3CODE_* ` fallback
64+ > is removed in v0.0.20. Examples in this document use the new names.
65+
6166### Option 1: Local Traces Only
6267
6368You do not need any extra env vars. Just run the app normally and inspect ` server.trace.ndjson ` .
@@ -99,16 +104,16 @@ Default Grafana login:
99104#### 2. Export OTLP env vars
100105
101106``` bash
102- export T3CODE_OTLP_TRACES_URL =http://localhost:4318/v1/traces
103- export T3CODE_OTLP_METRICS_URL =http://localhost:4318/v1/metrics
104- export T3CODE_OTLP_SERVICE_NAME =t3-local
107+ export BCODE_OTLP_TRACES_URL =http://localhost:4318/v1/traces
108+ export BCODE_OTLP_METRICS_URL =http://localhost:4318/v1/metrics
109+ export BCODE_OTLP_SERVICE_NAME =t3-local
105110```
106111
107112Optional:
108113
109114``` bash
110- export T3CODE_TRACE_MIN_LEVEL =Info
111- export T3CODE_TRACE_TIMING_ENABLED =true
115+ export BCODE_TRACE_MIN_LEVEL =Info
116+ export BCODE_TRACE_TIMING_ENABLED =true
112117```
113118
114119#### 3. Launch the app from that same shell
@@ -133,23 +138,23 @@ bun dev:desktop
133138
134139Packaged desktop app:
135140
136- Launch the actual app executable from the same shell so the desktop app and embedded backend inherit ` T3CODE_OTLP_ *` .
141+ Launch the actual app executable from the same shell so the desktop app and embedded backend inherit ` BCODE_OTLP_ *` .
137142
138143macOS app bundle example:
139144
140145``` bash
141- T3CODE_OTLP_TRACES_URL =http://localhost:4318/v1/traces \
142- T3CODE_OTLP_METRICS_URL =http://localhost:4318/v1/metrics \
143- T3CODE_OTLP_SERVICE_NAME =t3-desktop \
146+ BCODE_OTLP_TRACES_URL =http://localhost:4318/v1/traces \
147+ BCODE_OTLP_METRICS_URL =http://localhost:4318/v1/metrics \
148+ BCODE_OTLP_SERVICE_NAME =t3-desktop \
144149" /Applications/BCode (Alpha).app/Contents/MacOS/BCode (Alpha)"
145150```
146151
147152Direct binary example:
148153
149154``` bash
150- T3CODE_OTLP_TRACES_URL =http://localhost:4318/v1/traces \
151- T3CODE_OTLP_METRICS_URL =http://localhost:4318/v1/metrics \
152- T3CODE_OTLP_SERVICE_NAME =t3-desktop \
155+ BCODE_OTLP_TRACES_URL =http://localhost:4318/v1/traces \
156+ BCODE_OTLP_METRICS_URL =http://localhost:4318/v1/metrics \
157+ BCODE_OTLP_SERVICE_NAME =t3-desktop \
153158./path/to/your/desktop-app-binary
154159```
155160
@@ -168,7 +173,7 @@ The trace file is the fastest way to inspect raw span data.
168173Tail it:
169174
170175``` bash
171- tail -f " $T3CODE_HOME /userdata/logs/server.trace.ndjson"
176+ tail -f " $BCODE_HOME /userdata/logs/server.trace.ndjson"
172177```
173178
174179In monorepo dev, use:
@@ -185,7 +190,7 @@ jq -c 'select(.exit._tag != "Success") | {
185190 durationMs,
186191 exit,
187192 attributes
188- }' " $T3CODE_HOME /userdata/logs/server.trace.ndjson"
193+ }' " $BCODE_HOME /userdata/logs/server.trace.ndjson"
189194```
190195
191196Show slow spans:
@@ -196,7 +201,7 @@ jq -c 'select(.durationMs > 1000) | {
196201 durationMs,
197202 traceId,
198203 spanId
199- }' " $T3CODE_HOME /userdata/logs/server.trace.ndjson"
204+ }' " $BCODE_HOME /userdata/logs/server.trace.ndjson"
200205```
201206
202207Inspect embedded log events:
@@ -213,7 +218,7 @@ jq -c 'select(any(.events[]?; .attributes["effect.logLevel"] != null)) | {
213218 level: .attributes["effect.logLevel"]
214219 }
215220 ]
216- }' " $T3CODE_HOME /userdata/logs/server.trace.ndjson"
221+ }' " $BCODE_HOME /userdata/logs/server.trace.ndjson"
217222```
218223
219224Follow one trace:
@@ -224,7 +229,7 @@ jq -r 'select(.traceId == "TRACE_ID_HERE") | [
224229 .spanId,
225230 (.parentSpanId // "-"),
226231 .durationMs
227- ] | @tsv' " $T3CODE_HOME /userdata/logs/server.trace.ndjson"
232+ ] | @tsv' " $BCODE_HOME /userdata/logs/server.trace.ndjson"
228233```
229234
230235Filter orchestration commands:
@@ -235,7 +240,7 @@ jq -c 'select(.attributes["orchestration.command_type"] != null) | {
235240 durationMs,
236241 commandType: .attributes["orchestration.command_type"],
237242 aggregateKind: .attributes["orchestration.aggregate_kind"]
238- }' " $T3CODE_HOME /userdata/logs/server.trace.ndjson"
243+ }' " $BCODE_HOME /userdata/logs/server.trace.ndjson"
239244```
240245
241246Filter git activity:
@@ -250,7 +255,7 @@ jq -c 'select(.attributes["git.operation"] != null) | {
250255 .events[]
251256 | select(.name == "git.hook.started" or .name == "git.hook.finished")
252257 ]
253- }' " $T3CODE_HOME /userdata/logs/server.trace.ndjson"
258+ }' " $BCODE_HOME /userdata/logs/server.trace.ndjson"
254259```
255260
256261### Use Tempo When You Need A Real Trace Viewer
@@ -358,7 +363,7 @@ If you need those later, add client-side instrumentation or a dedicated server f
358363
359364Usually one of these is true:
360365
361- - ` T3CODE_OTLP_TRACES_URL ` was not set
366+ - ` BCODE_OTLP_TRACES_URL ` was not set
362367- the app was launched from a different environment than the one where you exported the vars
363368- the app was not fully restarted after changing env
364369- Grafana is looking at the wrong time range or service name
@@ -482,19 +487,19 @@ It provides:
482487
483488Local trace file:
484489
485- - ` T3CODE_TRACE_FILE ` : override trace file path
486- - ` T3CODE_TRACE_MAX_BYTES ` : per-file rotation size, default ` 10485760 `
487- - ` T3CODE_TRACE_MAX_FILES ` : rotated file count, default ` 10 `
488- - ` T3CODE_TRACE_BATCH_WINDOW_MS ` : flush window, default ` 200 `
489- - ` T3CODE_TRACE_MIN_LEVEL ` : minimum trace level, default ` Info `
490- - ` T3CODE_TRACE_TIMING_ENABLED ` : enable timing metadata, default ` true `
490+ - ` BCODE_TRACE_FILE ` : override trace file path
491+ - ` BCODE_TRACE_MAX_BYTES ` : per-file rotation size, default ` 10485760 `
492+ - ` BCODE_TRACE_MAX_FILES ` : rotated file count, default ` 10 `
493+ - ` BCODE_TRACE_BATCH_WINDOW_MS ` : flush window, default ` 200 `
494+ - ` BCODE_TRACE_MIN_LEVEL ` : minimum trace level, default ` Info `
495+ - ` BCODE_TRACE_TIMING_ENABLED ` : enable timing metadata, default ` true `
491496
492497OTLP export:
493498
494- - ` T3CODE_OTLP_TRACES_URL ` : OTLP trace endpoint
495- - ` T3CODE_OTLP_METRICS_URL ` : OTLP metric endpoint
496- - ` T3CODE_OTLP_EXPORT_INTERVAL_MS ` : export interval, default ` 10000 `
497- - ` T3CODE_OTLP_SERVICE_NAME ` : service name, default ` t3-server `
499+ - ` BCODE_OTLP_TRACES_URL ` : OTLP trace endpoint
500+ - ` BCODE_OTLP_METRICS_URL ` : OTLP metric endpoint
501+ - ` BCODE_OTLP_EXPORT_INTERVAL_MS ` : export interval, default ` 10000 `
502+ - ` BCODE_OTLP_SERVICE_NAME ` : service name, default ` t3-server `
498503
499504If the OTLP URLs are unset, local tracing still works and metrics stay in-process only.
500505
0 commit comments