Skip to content

fix(deno): Gate tracing integrations on hasSpansEnabled - #24070

Merged
isaacs merged 7 commits into
getsentry:developfrom
JosephDoUrden:fix/deno-tracing-gate
Sep 9, 2026
Merged

fix(deno): Gate tracing integrations on hasSpansEnabled#24070
isaacs merged 7 commits into
getsentry:developfrom
JosephDoUrden:fix/deno-tracing-gate

Conversation

@JosephDoUrden

@JosephDoUrden JosephDoUrden commented Sep 4, 2026

Copy link
Copy Markdown
Contributor
  • If you've added code that should be tested, please add tests.
  • Ensure your code lints and the test suite passes (yarn lint) & (yarn test).

Gates getTracingIntegrations() on hasSpansEnabled(options), same as Node (sdk/index.ts:92) and Bun already do.

On the confirm-first question in the issue: I checked all 22 and the honest answer is five of them do capture errors, firebase (server-utils/src/integrations/firebase/functions.ts:92), vercel-ai (vercel-ai-dc-subscriber.ts:680), and the anthropic, openai and google-genai streaming paths (ai/anthropic-ai/utils.ts:58, ai/openai/streaming.ts:138, ai/google-genai/streaming.ts:39). All five capture inside their span wrappers though, error capture in addition to tracing, which is literally the getErrorIntegrations criterion, so none of them is error capture only and nothing needs to move. Arguably they are misfiled upstream, but Node and Bun already apply this exact gate, so Deno moves onto the shared behaviour rather than away from it, and re-filing would be an upstream-wide call, not something for this PR.

Two things in the diff beyond the gate. getDefaultIntegrations is exported, so getDefaultIntegrations({}) now returns no tracing integrations whatever the init options say, same footgun Node and Bun already have, added a test pinning both directions. And init() no longer writes the computed default set back onto the caller's options object, the set is tracing dependent now so that cache goes stale if the object is reused, Node computes into a local the same way. Test pins the no-mutation contract too.

The snapshot updates are the bug made visible btw, the sdk.integrations list in the event payload drops 22 tracing names once tracing is off. Test updates run wider than one file for the same reason: every defaults assertion that expects a tracing integration now inits with tracing on, which is the redis test plus 20 orchestrion suites and the direct-client scenario in dev-packages/deno-integration-tests. Both suites pass.

Full deno suite passed, oxlint and oxfmt clean.

Closes #23893

Node and Bun both skip getTracingIntegrations() when tracing is
disabled; the Deno SDK spread them unconditionally, so 22 tracing
integrations were added and eagerly subscribed with tracing off.

init() also no longer writes the computed default set back onto the
caller's options object: the set is now tracing-dependent, so caching
it there would pin the first init's result for a reused object. Local
computation matches how the Node SDK handles the same step.

Test updates: default-integration assertions across the Deno suites
now init with tracing enabled, since that is the condition under which
tracing integrations are defaults at all; mod.test.ts snapshots lose
the 22 tracing names (the bug made visible in the event payload); new
tests pin both directions of the gate, the public
getDefaultIntegrations() behaviour, and the no-mutation contract.

Fixes getsentry#23893
@JosephDoUrden
JosephDoUrden requested a review from a team as a code owner September 4, 2026 09:32
@JosephDoUrden
JosephDoUrden requested review from isaacs and mydea and removed request for a team September 4, 2026 09:32
Comment thread packages/deno/src/sdk.ts
# Conflicts:
#	packages/deno/test/__snapshots__/mod.test.ts.snap
… the snapshot

ClientOptions no longer carries defaultIntegrations on develop, so the
object literal failed the type check after the merge. The local still
feeds getIntegrationsToSetup. The snapshot loses the tracing
integrations, which is what the gate is for.
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

👋 @isaacs, @mydea — Please review this PR when you get a chance!

@isaacs isaacs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this!

There are a few changes needed to get this landed, and a rebase onto (or merge from) origin/develop as well.

I'm happy to take that on if you don't get to it in the next few days (commit and changelog will credit you regardless :)

--

UPDATE: I see that you actually landed the fix for the only blocking issue already, so I'll get this landed asap.

Comment thread packages/deno/src/sdk.ts Outdated
Comment thread packages/deno/src/sdk.ts Outdated
Comment thread packages/deno/test/sdk.test.ts Outdated
Comment thread packages/deno/src/sdk.ts Outdated
Comment thread packages/deno/src/sdk.ts
@isaacs
isaacs self-requested a review September 9, 2026 15:31
Co-authored-by: isaacs <i@izs.me>
@isaacs
isaacs enabled auto-merge (squash) September 9, 2026 15:33
@isaacs
isaacs merged commit 1edada7 into getsentry:develop Sep 9, 2026
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

deno: Tracing integrations are added with tracing off

2 participants