Land emits telemetry through two parallel pipes that share one trace_id:
| Pipe | Sink | Strength | Cost |
|---|---|---|---|
| PostHog | https://eu.i.posthog.com |
Aggregations, dashboards, retention | One event per millisecond cap |
| OTLP | 127.0.0.1:4318 (Jaeger) |
Per-request waterfall, parent/child | Local-only, requires collector |
Joining the pipes: every PostHog event carries $trace_id and $span_id
properties; every Jaeger span carries posthog.event / posthog.distinct_id
attributes. A HogQL JOIN against Jaeger’s trace export - or a manual
click-through from a PostHog event into the Jaeger UI - reconstructs the full
causal chain.
Layout
| Layer | File / Module | Pipe(s) |
|---|---|---|
| Build.sh | Maintain/Script/PostHogCapture.sh |
PostHog + OTLP |
| Mountain | Element/Mountain/Source/Binary/Build/PostHogPlugin/* |
PostHog |
| Mountain | Element/Mountain/Source/IPC/DevLog/EmitOTLPSpan.rs |
OTLP |
| Mountain | Element/Mountain/Source/Telemetry/* |
OTLP (tracing) |
| Cocoon | Element/Cocoon/Source/Telemetry/PostHogBridge.ts |
PostHog |
| Cocoon | Element/Cocoon/Source/Telemetry/OTLPBridge.ts |
OTLP |
| Wind | Element/Wind/Source/Telemetry/Bridge.ts |
both |
| Sky | Element/Sky/Source/Function/Telemetry/Bridge.ts |
both |
| Output | Element/Output/Source/Telemetry/* |
both |
| Sidecars | re-export Mountain’s macros via the tracing crate |
OTLP |
Event-name convention
Every Land-emitted event uses the prefix land:<element>:<action>:
land:build:start,land:build:phase:complete,land:build:complete,land:build:errorland:mountain:session:start,land:mountain:ipc:invoke,land:mountain:handler:complete,land:mountain:errorland:cocoon:session:start,land:cocoon:entry:load,land:cocoon:entry:loaded,land:cocoon:handler:complete,land:cocoon:stub:active,land:cocoon:errorland:wind:layer:ready,land:wind:command:invokeland:sky:build:complete,land:sky:resource:error,land:sky:throttle-droppedland:output:build:completeland:session:start,land:session:end- Sky-emitted aggregatesland:boot:timing- workbench boot percentile telemetryland:ipc:marks,land:vscode:marks,land:extension-host:marks,land:all:marks- performance mark batches
PostHog’s $exception autocapture stays as-is; treat it like a PostHog-special
name.
Configuration - .env.Land.PostHog
Single source of truth for both pipes. Read at boot by every layer.
| Var | Default | Effect |
|---|---|---|
Authorize |
phc_… |
PostHog project key |
Beam |
https://eu.i.posthog.com |
PostHog endpoint |
Report |
true |
Master toggle for the PostHog pipe |
OTLPEndpoint |
http://127.0.0.1:4318 |
OTLP collector |
OTLPEnabled |
true |
Master toggle for the OTLP pipe |
Capture |
true |
Master telemetry kill - short-circuits both |
Trace |
all |
RUST_LOG-like span filter |
Record |
0 |
Mirror every payload to a per-session NDJSON |
Brand |
(empty - per-process) | distinct_id seed |
Throttle |
5 |
posthog-js client-side rate-limit |
Buffer |
3000 |
Cocoon batch window (ms) |
Batch |
20 |
Cocoon batch size |
Cap |
7 |
Sky $exception/10 s |
Replay |
false |
posthog-js session recording |
Ask |
false |
posthog-js surveys |
Production = zero bytes
Every layer compiles the telemetry stack out of release builds:
- Rust (
Mountain,Air,Echo,Rest,Grove,Mist) - capture paths gate oncfg!(debug_assertions). LLVM dead-codes them in--release. - TypeScript - bridges import lazily through
if (process.env.NODE_ENV !== "production") { … }so esbuild’sdefinecollapses the conditional and tree-shakes the SDK. - Astro - bundle config check
if (import.meta.env.DEV)drops the posthog-js + OTLP SDK paths fromastro build.
Plus the runtime kill switches: Capture=false short-circuits all pipes
regardless of build mode; Report=false / OTLPEnabled=false flip a single
pipe. (Capture is the telemetry switch; the unrelated Disable in
.env.Land.Diagnostics controls polyfill / shim loading.)
Bring-up sequence
# Once - bring up the local Jaeger collector.
sh Land/Container/Up.sh
# Every dev session - env vars feed every layer.
export Trace=all Record=1 Capture=true
sh Land/Maintain/Debug/Build.sh --profile debug-electron-bundled
# Run the binary; Mountain initialises both pipes from `.env.Land.PostHog`.
export Trace=all
./Element/Mountain/Target/debug/<binary>
# Inspect:
# PostHog dashboards: https://eu.posthog.com/project/151871
# Jaeger UI: http://127.0.0.1:16686
See Effect-OTel.md for the Effect-TS integration pattern Wind / Cocoon use,
and Tree-Shaking.md for the production-zero contract.
The rest of this family 📑
This page is the map of the telemetry layer. Three focused pages take one part of it each, and each answers a question this overview does not:
| Page | The question it answers |
|---|---|
Effect-TS + OpenTelemetry |
How Wind and Cocoon create spans through @effect/opentelemetry, and how one span reaches two sinks. |
Sidecar Telemetry |
How every Rust sidecar and the Worker service worker join the same land:<tier>:* namespace. |
Tree-Shaking Telemetry |
What a release build must contain - zero bytes of SDK code, no endpoint string - and how to check it. |