Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: getsentry/sentry-javascript
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f109d92
Choose a base ref
...
head repository: getsentry/sentry-javascript
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ce5009a
Choose a head ref
  • 19 commits
  • 210 files changed
  • 14 contributors

Commits on Aug 31, 2026

  1. Configuration menu
    Copy the full SHA
    dd7b7a6 View commit details
    Browse the repository at this point in the history

Commits on Sep 1, 2026

  1. fix(v10/nextjs): Register Vercel AI span processors on Next.js (#23773)

    - On Next.js, Vercel AI spans arrive unprocessed — raw `ai.generateText`
    / `ai.toolCall`, no `gen_ai` op
    - Next.js bundles `ai`, so it is never patched, and the `Modules`
    fallback misses workspace and transitive deps
    - Registered in `init` rather than on the default integration, which a
    user-supplied `vercelAIIntegration()` would replace
    - No e2e: reproducing needs `ai` hidden from `Modules`, and this gating
    is gone in v11
    - Telemetry still needs per-call `experimental_telemetry: { isEnabled:
    true }`; docs to follow
    
    Ref:
    https://linear.app/getsentry/issue/TET-2891/vercel-ai-sdk-v6-instrumentation-is-broken-on-nextjs
    
    Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
    chargome and claude authored Sep 1, 2026
    Configuration menu
    Copy the full SHA
    171c1fd View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f2d7d10 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2026

  1. fix(v10/core): resolve MCP capture policy per operation (#23796)

    Backport of: #23437
    
    ## Differences to the original PR
    
    - `packages/core/src/integrations/mcp-server/transport.ts`: the
    no-client fallback in `resolveMcpOptions` is `false` for
    `recordInputs`/`recordOutputs`, not `true`. On v10
    `resolveDataCollectionOptions` still routes through the `sendDefaultPii`
    bridge when `dataCollection` is absent, so the old
    `wrapMcpServerWithSentry` code fell back to `false` when no client
    existed. Keeping `true` here would start capturing MCP inputs and
    outputs on a maintenance branch.
    - `packages/core/src/integrations/mcp-server/transport.ts`:
    `startInactiveSpan` is imported from `../../tracing` together with
    `withActiveSpan`; v10 has no separate `../../tracing/trace` import in
    this file.
    -
    `packages/core/test/lib/integrations/mcp-server/capturePolicy.test.ts`:
    the span-config helpers use `sentry.source` instead of
    `sentry.segment.name.source`, and the tool config carries a top-level
    `op: 'mcp.server'`, matching v10's `buildMcpServerSpanConfig`. The
    no-client case asserts that inputs and outputs are omitted, following
    the fallback above.
    - `dev-packages/e2e-tests/test-applications/node-express/src/app.ts`:
    the `dataCollection.genAI` block is not added. On v10 the presence of
    any `dataCollection` key switches the resolution base from the
    `sendDefaultPii` bridge to the permissive spec defaults, which would
    have flipped `userInfo`, `cookies`, `httpHeaders`, `httpBodies` and
    `databaseQueryData` on for every other test in this app. Without the
    block, `genAI` already resolves to `{ inputs: false, outputs: false }`,
    so the new MCP e2e assertions hold unchanged.
    -
    `dev-packages/e2e-tests/test-applications/cloudflare-mcp-agent/src/index.ts`:
    the `genAI` settings are merged into the existing `dataCollection: {
    userInfo: true }` object. v10 already sets `dataCollection` in both
    `Sentry.init` calls, so the original patch would have produced a
    duplicate key and silently dropped `userInfo: true`.
    
    Co-authored-by: Miguel Betegón <[email protected]>
    JPeer264 and betegon authored Sep 2, 2026
    Configuration menu
    Copy the full SHA
    374e76f View commit details
    Browse the repository at this point in the history
  2. fix(v10/nextjs): Fix SDK import crashing under jsdom/happy-dom (#23906)

    Since 10.72.0, importing `@sentry/nextjs` on the server crashes when a
    `document` global exists. jsdom and happy-dom define one while tests run
    in Node (#23789, introduced by #23667).
    
    What went wrong:
    
    1. `@sentry/server-utils` now bundles the code-transformer plugin,
    compiled from ESM to CJS. Rollup replaces `import.meta.url` with a
    snippet that assumes "a `document` global means a browser". This is now
    fixed by always emitting the Node form, since this package only runs in
    Node.
    2. The Next.js server entry re-exports `withSentryConfig`, so just
    importing the SDK ran the bundler plugin's module-scope code. The
    plugins now load lazily when the build config actually runs. Build
    behavior is unchanged (still synchronous, Next.js webpack configs can't
    be async), but importing the SDK no longer touches them. This also
    removes the `WebAssembly.compile()` call behind the Cloudflare
    cold-start errors (reference - but needs to be verified
    [#22794](#22794))
    
    
    Fixes #23789
    s1gr1d authored Sep 2, 2026
    Configuration menu
    Copy the full SHA
    c50fcb8 View commit details
    Browse the repository at this point in the history
  3. test(e2e): Assert Next.js Cloudflare worker bundle stays free of orch…

    …estrion bundler plugins (#23910)
    
    Adds one test to the `nextjs-16-cf-workers` e2e app. After the OpenNext
    build, it scans every script in `.open-next/` (except static assets) and
    fails if the orchestrion bundler plugins show up, naming the offending
    files.
    
    The plugins are build-time-only, but they used to get compiled into the
    worker bundle, where an unawaited `WebAssembly.compile()` crashed every
    cold start. The bundle check is deterministic, unlike waiting for an
    error to not appear.
    
    The below issue is fixed in
    #23906 already, this
    PR is just adding the verification.
    Closes #22794
    s1gr1d authored Sep 2, 2026
    Configuration menu
    Copy the full SHA
    f44df80 View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2026

  1. Configuration menu
    Copy the full SHA
    01c55a8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ef7040e View commit details
    Browse the repository at this point in the history
  3. fix(v10/sveltekit): Read SvelteKit config from the Vite plugin (#23998)

    Backport of: #23678
    
    ## Differences to the original PR
    
    - `src/vite/sentryVitePlugins.ts`: dropped the
    `warnOnRemovedBuildOptions(options,
    ['unstable_sentryVitePluginOptions'])` call. That line is pre-existing
    context on `develop` from #23366, which removed the option in v11 — v10
    still supports it, and `warnOnRemovedBuildOptions` isn't exported from
    v10's `@sentry/core`.
    - `src/vite/sentryVitePlugins.ts` (`generateVitePluginOptions`): kept
    v10's deprecated `sourceMapsUploadOptions` /
    `unstable_sentryVitePluginOptions` merging untouched. Only this PR's
    actual change was applied — `adapter` is now destructured out of the
    options handed to the Vite plugin and the explicit `adapter:
    svelteKitPluginOptions.adapter` was dropped. The placeholder is
    `_filtered5` rather than `_filtered3` because v10 filters two extra
    deprecated options.
    - `test/vite/sentrySvelteKitPlugins.test.ts`: plugin-count expectations
    are v10's counts plus one for the new kit config resolver (8/3/4/7), not
    `develop`'s (9/4/5/8). v10 has no orchestrion Vite plugin — that's
    #22768, v11-only.
    chargome authored Sep 3, 2026
    Configuration menu
    Copy the full SHA
    8d6df44 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2026

  1. fix(server-utils): Include Gemini reasoning tokens in Vercel AI token…

    … usage (#23433)
    
    Gemini reasoning models undercount their output tokens in the Vercel AI
    integration. Gemini reports its reasoning ("thoughts") tokens separately
    from the visible candidate output, so the AI SDK's `outputTokens` covers
    only the answer and exposes the reasoning count through
    `providerMetadata.google.usageMetadata.thoughtsTokenCount`.
    `getProviderMetadataAttributes()` handled OpenAI, Anthropic, Bedrock and
    DeepSeek metadata but never looked at the Google/Vertex block, so the
    reasoning tokens were dropped from `gen_ai.usage.output_tokens` and the
    total was computed as input + candidate-only output.
    
    Per the [gen_ai token usage
    conventions](https://develop.sentry.dev/sdk/telemetry/attributes.md),
    `gen_ai.usage.output_tokens` includes reasoning tokens. The fix reads
    the `google`/`vertex` `usageMetadata`, derives output as
    `candidatesTokenCount + thoughtsTokenCount`, sets the total from the
    real `totalTokenCount` and records the reasoning breakdown under
    `gen_ai.usage.reasoning.output_tokens`. Both the OTel span path and the
    `ai` tracing-channel path go through this shared helper, so both emit
    the corrected shape.
    
    Deriving output from the raw candidate + thoughts counts (rather than
    adding reasoning onto the existing SDK value) is deliberate: it stays
    correct even if a future AI SDK version folds reasoning into
    `outputTokens` itself, so it cannot double count. The change is gated on
    `thoughtsTokenCount > 0`, so non-reasoning Gemini responses are left
    exactly as they were.
    
    ## Root cause
    
    `getProviderMetadataAttributes()` in
    `packages/server-utils/src/ai/vercel-ai/index.ts` had no
    `google`/`vertex` branch. The total is also computed from input + output
    before provider metadata is applied. For a real Gemini reasoning
    response:
    
    ```
    usageMetadata { promptTokenCount: 14, candidatesTokenCount: 1, thoughtsTokenCount: 100, totalTokenCount: 115 }
    ai-sdk result.usage { inputTokens: 14, outputTokens: 1, totalTokens: 115, reasoningTokens: 100 }
    ```
    
    the emitted span attributes were, before the fix:
    
    ```json
    {"gen_ai.usage.output_tokens":1,"gen_ai.usage.input_tokens":14,"gen_ai.usage.total_tokens":15}
    ```
    
    and after the fix:
    
    ```json
    {"gen_ai.usage.output_tokens":101,"gen_ai.usage.input_tokens":14,"gen_ai.usage.total_tokens":115,"gen_ai.usage.reasoning.output_tokens":100}
    ```
    
    A vitest covering the OTel processor path and the shared
    `getProviderMetadataAttributes()` helper (including the v6 `vertex` key
    and a non-reasoning regression case) is added in
    `packages/server-utils/test/ai/lib/tracing/vercel-ai-reasoning-tokens.test.ts`.
    
    ---
    
    - [x] If you've added code that should be tested, please add tests.
    - [x] Ensure your code lints and the test suite passes (`yarn lint`) &
    (`yarn test`).
    - [ ] Link an issue if there is one related to your pull request. If no
    issue is linked, one will be auto-generated and linked.
    
    ---
    
    AI assistance (Claude, Anthropic) was used in developing this change.
    The design, review and verification were done by the author. Verified
    locally before submitting: `yarn test` in `packages/server-utils` (377
    passing, 4 new), `yarn lint` (oxlint, clean), `oxfmt --check` (clean)
    and `yarn build:types` (tsc, clean).
    
    ---------
    
    Co-authored-by: zkasuran <[email protected]>
    Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
    Co-authored-by: RulaKhaled <[email protected]>
    4 people authored Sep 4, 2026
    Configuration menu
    Copy the full SHA
    3e0eccc View commit details
    Browse the repository at this point in the history
  2. fix(v10/nuxt): Windows file:// for import-in-the-middle hook and isAb…

    …solute for C:\ (#24026)
    
    Backport of #23653
    
    ---------
    
    Co-authored-by: halillusion <[email protected]>
    s1gr1d and halillusion authored Sep 4, 2026
    Configuration menu
    Copy the full SHA
    2ce0ea1 View commit details
    Browse the repository at this point in the history

Commits on Sep 7, 2026

  1. feat(v10): Streamline isolation scope handling & reset in isolation s…

    …copes (#24152)
    
    Backport of: #22890
    
    ## Differences to the original PR
    
    - `packages/server-utils/` does not exist on v10. The AsyncLocalStorage
    async context strategy lives in three copies there:
    `packages/node-core/src/light/asyncLocalStorageStrategy.ts`,
    `packages/cloudflare/src/async.ts` and `packages/deno/src/async.ts`. The
    propagation context reset in `withIsolationScope` is applied to all
    three.
    - The cloudflare and deno copies share the current scope by reference in
    `withIsolationScope` on v10 (develop forks it since #22889, which is not
    on v10). The backport forks the current scope in those two
    `withIsolationScope` implementations, otherwise the reset would
    overwrite the caller's propagation context. `withSetIsolationScope` and
    `withSetScope` are left as they are on v10.
    - The `packages/server-utils/test/async-context.test.ts` cases are added
    to `packages/cloudflare/test/async.test.ts` (plus one case for the
    current-scope fork above) and to
    `packages/node-core/test/light/asyncLocalStorageStrategy.test.ts`. There
    is no vitest suite for the deno strategy, so that copy is not covered by
    a unit test.
    - Dropped the
    `packages/vercel-edge/test/middlewareTraceIsolation.test.ts` hunk; that
    file does not exist on v10.
    
    
    Fixes #24118
    
    Before:
    https://sentry-sdks.sentry.io/explore/traces/trace/aeac0f0087dc4636af1c1ea2080dc8be/
    After:
    https://sentry-sdks.sentry.io/explore/traces/trace/94a5f3cc2384449ab8fe0891c69cfc75/
    
    Co-authored-by: Francesco Gringl-Novy <[email protected]>
    JPeer264 and andreiborza authored Sep 7, 2026
    Configuration menu
    Copy the full SHA
    b627037 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    de25dcb View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2026

  1. fix(v10/nextjs): Keep the Pages Router runtime out of App Router clie…

    …nt bundles (#24223)
    
    Backport of: #24188
    
    ## Differences to the original PR
    
    -
    `packages/nextjs/src/client/routing/pagesRouterNavigationInstrumentation.ts`:
    uses v10's
    `SEMANTIC_ATTRIBUTE_SENTRY_OP`/`SEMANTIC_ATTRIBUTE_SENTRY_SOURCE` and
    the plain route/URL span name; v10 has no `@sentry/conventions/op`,
    `SENTRY_SEGMENT_NAME_SOURCE`, or span-streaming name fallback. The
    `__BUILD_MANIFEST`-typed `globalObject` moved here with the route
    matching code.
    -
    `packages/nextjs/src/client/routing/pagesRouterRoutingInstrumentation.ts`:
    keeps v10's pageload code (`browserPerformanceTimeOrigin` start time,
    v10 attribute constants); only the navigation half and the `next/router`
    import were removed.
    -
    `dev-packages/e2e-tests/test-applications/nextjs-16/tests/build-output.test.ts`:
    new file on v10 containing only the bundle assertion; the
    absolute-path-imports test from `develop` depends on a
    `@sentry-internal/test-utils` helper that does not exist on v10.
    chargome authored Sep 9, 2026
    Configuration menu
    Copy the full SHA
    c89f6e6 View commit details
    Browse the repository at this point in the history
  2. fix(v10/cloudflare): Auto-instrument classes re-exported from the wor…

    …ker entry (#24181)
    
    Backport of: #23282
    
    ## Differences to the original PR
    
    - `packages/cloudflare/test/vite/autoInstrument.test.ts`: the three new
    agent re-export expectations include `enableRpcTracePropagation:
    opts?.enableRpcTracePropagation ?? true,` in the generated
    `__SENTRY_OPTIONS__` snippet. v10 still emits that property, develop
    does not, so the strings had to match the v10 output (identical to the
    existing expectation in the same file).
    - `packages/cloudflare/src/durableobject.ts`,
    `packages/cloudflare/src/workflows.ts`: the `InstrumentedClass` +
    `markAsInstrumented` change was applied on top of the v10 generic
    signatures. v10 does not have the `DefaultEnv` / `ResolveEnv` /
    `StrictCloudflareOptions` generics refactor, so those signatures stay as
    they are on v10; the behavior change is the same.
    - `dev-packages/cloudflare-integration-tests/runner.ts`:
    `receivedEnvelopes.push(envelope)` was added next to the v10 wording of
    the surrounding waiter comment.
    
    The behavior of the fix is unchanged, all deviations are adaptations to
    the older code shape.
    JPeer264 authored Sep 9, 2026
    Configuration menu
    Copy the full SHA
    264f990 View commit details
    Browse the repository at this point in the history
  3. fix(v10/browser): Set user_agent.original on all spans for consiste…

    …nt filtering (#24226)
    
    Backport of: #24216
    
    Technically, this removes an attribute and sets another. However, this
    only affects span streaming, which is opt-in and not 100% stable on v10,
    so I think it's fine.
    
    ## Differences to the original PR
    
    - `packages/browser/src/integrations/httpcontext.ts`: kept v10's
    `@sentry/core/browser` import path and its unfiltered `reqData.headers`
    / `reqData.url`. v10 has no `dataCollection` header filtering
    (`_INTERNAL_filterKeyValueData`, `filterCollectedUrl`), so `processSpan`
    takes no `client` argument here.
    - `packages/browser/test/integrations/httpcontext.test.ts`: dropped the
    `dataCollection` suite updates (that suite doesn't exist on v10) and
    added the `USER_AGENT` const the ported assertions reference.
    - Skipped `nextjs-app-dir` / `nextjs-pages-dir` `transactions.test.ts`:
    on v10 these still assert on transaction-event `contexts.trace.data`,
    which carries no user-agent attribute, so there is nothing to rename.
    - The interaction test lives at
    `browserTracingIntegration/interactions-streamed/` on v10 rather than
    `tracing/interactions/spans/`; same content, different path.
    
    The behavioral fix itself is ported in full.
    Lms24 authored Sep 9, 2026
    Configuration menu
    Copy the full SHA
    9f38e48 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    371ed5d View commit details
    Browse the repository at this point in the history
  5. meta(changelog): Update changelog for 10.74.0 (#24252)

    Co-authored-by: Claude Fable 5.1 <[email protected]>
    chargome and claude authored Sep 9, 2026
    Configuration menu
    Copy the full SHA
    4b24ddd View commit details
    Browse the repository at this point in the history
  6. release: 10.74.0

    chargome committed Sep 9, 2026
    Configuration menu
    Copy the full SHA
    ce5009a View commit details
    Browse the repository at this point in the history
Loading