Appearance
Backend OTel bootstrap hotfix — the money path was dark, and nothing said so
2026-07-16
Six of eight backends — game-server, auth-server, both banks, betting-server, observer-gateway — emitted zero telemetry in every deployed environment. Their Dash0 config was correct; they never turned the tracer on. Production runs start, which booted dist/index.js — the file that never calls initTelemetry — while the bootstrap.ts that does was only wired into dev. Every span became a NonRecordingSpan and was dropped at creation: the code ran, the instrumentation ran, nothing left the process. It failed quiet, so nobody noticed for weeks — and it defeated the plans built on top of it (the alert pack was wired to spans that never arrived; a permission refusal carried its context to a span that was thrown away).
Found by telemetry-driven smoke: a hand was played on staging and the agent read stg. No unit test, typecheck, or green CI run could have caught it — the code and the config were both correct. Only "did the span arrive in the deployed environment?" catches this class.
What shipped
- All 8 backends now boot bootstrap-first in production.
buildemits bothdist/bootstrap.js(a second tsup entry) anddist/index.js(theapp-entrypoint.shbuild-at-boot sentinel);startboots the bootstrap, which inits OTel before the dynamic import of the app. - hosted-agent-service was degraded, not healthy — it inited OTel inside
index.ts, after ESM hoisted the app's imports above the call, so auto-instrumentation patched nothing. Now on the same bootstrap convention. assertTracerRecordingmoved to@numero/telemetryand is called in all 8 bootstraps (was game-server-only) — a misconfigured init is now loud at boot in every service, not silent for days.check-otel-bootstrap(wired intopnpm typecheck) makes the dark-service class unrepresentable: a backend whose prod entrypoint could boot without initialising OTel before the app loads fails CI. It found a real gap on day one (tournament-orchestrator's bootstrap lacked the assertion).- A hermetic prod-boot harness (
test/otel-bootstrap/) builds each service, boots its realstartentry against a local OTLP stub, and proves the prod entrypoint initialises OTel + is recording — race-free, no docker, no real config.
The convention: bootstrap-first is the prod entrypoint, not just dev — see the observability guide.