fix(observability): OTel is the only tracer; Sentry stays error-only - #55
Merged
Conversation
Default Sentry tracesSampleRate to 0 on both API and UI. @sentry/bun v10+ is built on @sentry/opentelemetry, so any non-zero Sentry sample rate registers a second tracer alongside the OTel SDK in config/otel/otel.ts and double-instruments HTTP / fetch / ioredis. The stack already ships Tempo as the trace backend, so the cleaner stance is one tracer, not two. UI keeps browserTracingIntegration loaded — Sentry's browser SDK still writes the W3C traceparent header on /api/* fetches with rate 0, which is what the API's OTel SDK reads to continue the trace and ship spans to Tempo. Error events on either side keep their trace_id from the shared OTel context, so the GlitchTip → Tempo pivot still works. Operator can flip SENTRY_TRACES_SAMPLE_RATE back to non-zero if they want transactions in Sentry as well — comment in sentry.ts spells out the trade-off. Docs updated: tracing.mdx Browser→API FAQ explains the choice; error-tracking.mdx points to tracing.mdx for the rationale.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SENTRY_TRACES_SAMPLE_RATE=0on the API andtracesSampleRate: 0in the UI — OTel is now the single source of trace data shipped to Tempo.@sentry/bunv10+ is built on@sentry/opentelemetry; running Sentry tracing alongside the OTel SDK double-instruments HTTP / fetch / ioredis. One tracer is the cleaner stance.browserTracingIntegration— at rate 0 it still writes the W3Ctraceparentheader on/api/*fetches, which the API's OTel SDK reads to continue the trace server-side.trace_idfrom the shared OTel context on both sides, so the GlitchTip → Tempo pivot is preserved.sentry.ts,schema.ts,.env.example, and the tracing / error-tracking docs spell out the trade-off and how to flip it back.Test plan
apps/api:bun run validate— 997/999 green (2 pre-existing skips)apps/ui:bun run validate— typecheck + lint + RTL + size-limit cleanapps/docs:bun run build— 67 pages, no broken links