Dashboardopencode-loreSentry telemetry, tracing, and test-iso…

Sentry telemetry, tracing, and test-isolation invariants

Category: architecture
Confidence: 1.00
ID: 01a0a519-f169-7501-a1ca-7a152b8d509f
Project ID: 6f4be9ff-ed84-4cca-a9e7-732a0b0b8677
Cross-project: No
Recalled in other projects: 0
Source session: 1d7dk9QRrUbltPYLG
Created: 2026-08-25 16:33:41
Updated: 2026-09-15 12:45:35

Content

Treat NODE_ENV === "test" as an unconditional Sentry hard-off checked before all enablement logic, even SENTRY_ENABLED=1. Tests must never initialize transports or worker threads: Sentry uses globalThis.fetch, so initialization races mocked fetches, inflates call counts, and clobbers captured state. Outside tests, label production builds "production" and explicitly enabled development builds "development". Keep one tracing owner: use httpServerSpansIntegration without also installing the superseded httpIntegration, preventing duplicate events and overlapping instrumentation.

Move to: