fix(sentry): turn tracing off everywhere and stop reporting updater transport errors

Merged
SA
2mo ago
+16-36

Why

The Sentry bill: 262M spans against a 5M quota (5251%), 98% from the api project, plus errors at 774%.

  • The api's tracesSampler (from #6087) was storing a flat 5% of every route — auth and webhooks included, so its route rules never took effect. ~20M requests/day × ~18 spans × 5% ≈ 19M stored spans/day, 115x the monthly quota every day since at least Aug 8. Not a spike: the org rejected everything Sep 1–3, then ingestion resumed at the same rate and became billable.
  • The relay, at tracesSampleRate: 0, was still storing 165k /presence spans/day. In @sentry/core 10.68 hasSpansEnabled is a != null check, so 0 keeps tracing on, and sampleSpan lets a sampled parent override the local rate. The api calls the relay with sampled headers.

What

  • Remove tracesSampleRate / tracesSampler from every Sentry init in the repo (api, web, admin, docs, marketing — server, edge and client; relay, usercontent, host-service, desktop main + renderer, mobile). Omitting the key is the only setting the SDK treats as disabled. Nothing in the repo calls startSpan. Replay rates are untouched.
  • apps/desktop/src/main/lib/auto-updater.ts: the silent network list matches any net::ERR_ message instead of six named ones. The unlisted variants (ERR_TIMED_OUT, ERR_HTTP2_PROTOCOL_ERROR, ERR_NETWORK_IO_SUSPENDED, …) were DESKTOP-1E, 40% of desktop errors, 54k events since January. Chromium transport failures reaching the GitHub feed are not ours to fix and the next check retries.

When traces work is wanted later: a tracesSampler returning ~0.001 for the routes under investigation and 0 elsewhere, time-boxed — never a flat rate.

Verification

  • biome check clean on all changed files.
  • turbo typecheck passes for api, relay, web, admin, docs, marketing, host-service, desktop, usercontent.

https://claude.ai/code/session_01Sjva1Y1dnaKt1Eew3YRPNS


Summary by cubic

Disables Sentry tracing across all apps to stop the 5251% span overage (262M spans against a 5M quota) and silences transient updater network errors in the desktop app.

Sentry tracing

  • Removed tracesSampler/tracesSampleRate from every Sentry init (api, web, admin, docs, marketing, relay, usercontent, host-service, desktop, mobile) — omitting the key is the only setting the SDK treats as disabled.
  • The api was storing a flat 5% of ~20M requests a day because its per-route rules never took effect, ~19M spans a day against the monthly quota.
  • The relay stored 165k /presence spans a day because tracesSampleRate: 0 still enables tracing and inherits an already-sampled parent.
  • Nothing calls startSpan, and replay rates are untouched.

Desktop updater

  • The silent list now matches any net::ERR_* message instead of six named variants, except net::ERR_CERT_*, which stays reported because a broken TLS proxy or certificate is permanent.
  • The unlisted transient variants (timeouts, HTTP/2 resets, suspended machines) were ~800 a day, 40% of desktop error volume — the next check retries.

Summary by CodeRabbit

  • Bug Fixes
    • Desktop update checks now surface certificate-related connection failures as errors instead of silently retrying them.
    • Certificate-related update failures are cleared from cached update state and reported for monitoring.
  • Monitoring
    • Sentry tracing now follows default or inherited sampling behavior across applications and services.
    • Removed explicit trace-sampling limits, including configurations that disabled tracing.
    • API traces no longer use route-specific sampling rules.