GeezerVison is showing github.com — fix(server-utils): Instrument @anthropic-ai/sdk 1.x and turn off its own OTel spans by RulaKhaled · Pull Request #25750 · getsentry/sentry-javascript
Conversation
Our Anthropic instrumentation was capped at <1, so @anthropic-ai/sdk 1.x wasn't instrumented. 1.x also emits its own OTel spans, and they reach Sentry wherever we register the global tracer provider (the default in Next.js, SvelteKit and Vercel Edge). Raising the range alone gave two spans per call.
This raises the range to <2 and sets ANTHROPIC_OPEN_TELEMETRY=false unless the user set it, the same way we disable Next.js' own fetch spans with NEXT_OTEL_FETCH_DISABLED.
Follow-up. Tool-runner chat spans don't reach Sentry on 1.x yet.
Fixes #25748
🤖 Generated with Claude Code
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…own OTel spans
Raise the orchestrion range to <2 (Completions stays <1, removed in 1.0) and set
ANTHROPIC_OPEN_TELEMETRY=false unless the user set it, so 1.x's native spans don't
duplicate ours where Sentry registers the global tracer provider.
Fixes #25748
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
size-limit report 📦
Compared: e093eb2 (PR test merge using develop at a57560f)
Against: a57560f (develop) · base run #64960
✅ Baseline matches: this diff contains only this PR's changes.
| Path |
Size |
% Change |
Change |
| @sentry/browser |
30.4 kB |
- |
- |
| @sentry/browser - with treeshaking flags |
28.54 kB |
- |
- |
| @sentry/browser - with treeshaking flags tracing without tracing |
28.43 kB |
- |
- |
| @sentry/browser (incl. Tracing) |
52.72 kB |
- |
- |
| @sentry/browser (incl. Tracing + Span Streaming) |
52.72 kB |
- |
- |
| @sentry/browser (incl. Tracing, Profiling) |
55.69 kB |
- |
- |
| @sentry/browser (incl. Tracing, Replay) |
93.02 kB |
- |
- |
| @sentry/browser (incl. Tracing, Replay) - with treeshaking flags |
81.61 kB |
- |
- |
| @sentry/browser (incl. Tracing, Replay with Canvas) |
97.76 kB |
- |
- |
| @sentry/browser (incl. Tracing, Replay, Feedback) |
110.75 kB |
- |
- |
| @sentry/browser (incl. Feedback) |
47.98 kB |
- |
- |
| @sentry/browser (incl. sendFeedback) |
35.5 kB |
- |
- |
| @sentry/browser (incl. FeedbackAsync) |
40.61 kB |
- |
- |
| @sentry/browser (incl. Metrics) |
31.44 kB |
- |
- |
| @sentry/browser (incl. Logs) |
31.73 kB |
- |
- |
| @sentry/browser (incl. Metrics & Logs) |
32.45 kB |
- |
- |
| @sentry/react |
32.29 kB |
- |
- |
| @sentry/react (incl. Tracing) |
55.09 kB |
- |
- |
| @sentry/vue |
38.67 kB |
- |
- |
| @sentry/vue (incl. Tracing) |
55.73 kB |
- |
- |
| @sentry/svelte |
30.43 kB |
- |
- |
| @sentry/remix (Remix 3 client bundle) |
57.8 kB |
- |
- |
| CDN Bundle |
32.19 kB |
- |
- |
| CDN Bundle (incl. Tracing) |
53.24 kB |
- |
- |
| CDN Bundle (incl. Logs, Metrics) |
34.47 kB |
- |
- |
| CDN Bundle (incl. Tracing, Logs, Metrics) |
55.19 kB |
- |
- |
| CDN Bundle (incl. Replay, Logs, Metrics) |
75.88 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay) |
91.46 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Logs, Metrics) |
93.39 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback) |
97.56 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) |
99.56 kB |
- |
- |
| CDN Bundle - uncompressed |
94.67 kB |
- |
- |
| CDN Bundle (incl. Tracing) - uncompressed |
157.63 kB |
- |
- |
| CDN Bundle (incl. Logs, Metrics) - uncompressed |
101.14 kB |
- |
- |
| CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed |
163.37 kB |
- |
- |
| CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed |
232.71 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay) - uncompressed |
279.32 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed |
285.05 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed |
293.03 kB |
- |
- |
| CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed |
298.74 kB |
- |
- |
| @sentry/nextjs (client) |
58.04 kB |
- |
- |
| @sentry/sveltekit (client) |
53.23 kB |
- |
- |
| @sentry/core/server |
44.25 kB |
- |
- |
| @sentry/core/browser |
13.93 kB |
- |
- |
| @sentry/node |
155.84 kB |
+0.04% |
+55 B 🔺 |
| @sentry/node/import (ESM hook with diagnostics-channel injection) |
82.26 kB |
-0.01% |
-2 B 🔽 |
| @sentry/node - without tracing |
96.89 kB |
+0.02% |
+13 B 🔺 |
| @sentry/node - without channel injection |
136.16 kB |
+0.05% |
+58 B 🔺 |
| @sentry/aws-serverless |
105.11 kB |
+0.02% |
+17 B 🔺 |
| @sentry/cloudflare (withSentry) - minified |
200.67 kB |
- |
- |
| @sentry/cloudflare (withSentry) |
499.05 kB |
- |
- |
| @sentry/nextjs/cloudflare (withSentry) - minified |
221.22 kB |
- |
- |
View base workflow run
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
With ANTHROPIC_OPEN_TELEMETRY=false the client has no tracer and injects no
headers, so propagation is left to our HTTP instrumentation, which its own
suites cover.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Optional E2E tests
Some optional checks were not successful. They do not block the merge. 4 not successful, 51 successful. See the run.
|
Check |
Status |
|
| ❌ |
CI: Optional E2E Tests / E2E nuxt-5 Test (optional) |
Failing after 2m |
Details |
| ❌ |
CI: Optional E2E Tests / E2E cloudflare-pi-durable (latest) Test (optional) |
Failing after 15s |
Details |
| ❌ |
CI: Optional E2E Tests / E2E node-flue (latest) Test (optional) |
Failing after 15s |
Details |
| ❌ |
CI: Optional E2E Tests / E2E nuxt-5 (tunnel-dev) Test (optional) |
Failing after 2m |
Details |
Successful checks
|
Check |
Status |
|
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-workers-send-to-sentry Test (optional) |
Successful in 3m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16 (vinext) Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16 (vinext, bun) Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E gen-ai-libraries (cloudflare) Test (optional) |
Successful in 40s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16 (deno) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E astro-7 Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E astro-7-static Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-think (ai v6) Test (optional) |
Successful in 41s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-eve (latest) Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E gen-ai-libraries (latest) Test (optional) |
Successful in 33s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-agent Test (optional) |
Successful in 18s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E gen-ai-libraries Test (optional) |
Successful in 29s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-express-mcp-v1 Test (optional) |
Successful in 15s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-flue-send-to-sentry Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-openai-decisions Test (optional) |
Successful in 17s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16 (cloudflare, latest) Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E deno (latest) Test (optional) |
Successful in 55s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nuxt-5-sourcemaps Test (optional) |
Successful in 34s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-mastra Test (optional) |
Successful in 48s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nestjs-12 (latest) Test (optional) |
Successful in 34s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-pi-durable Test (optional) |
Successful in 25s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-14 (latest) Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-flue Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-eve Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-mastra Test (optional) |
Successful in 30s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E debug-id-sourcemaps Test (optional) |
Successful in 25s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-eve (orchestrion) Test (optional) |
Successful in 38s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E supabase-nextjs Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E solidstart-2 Test (optional) |
Successful in 39s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-15 (latest) Test (optional) |
Successful in 3m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E cloudflare-think Test (optional) |
Successful in 44s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (client source maps kept) Test (optional) |
Successful in 23s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E tanstackstart-react-sourcemaps Test (optional) |
Successful in 23s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-fastify-6 (tracer provider) Test (optional) |
Successful in 21s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-express-send-to-sentry-static Test (optional) |
Successful in 56s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-express-send-to-sentry Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-fastify-6 Test (optional) |
Successful in 47s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-openai-decisions (latest) Test (optional) |
Successful in 18s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E vue-3 (no Options API) Test (optional) |
Successful in 52s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-15 (turbo) Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-pi-durable Test (optional) |
Successful in 24s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E tanstackstart-react (latest) Test (optional) |
Successful in 1m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-express-mcp-v2 Test (optional) |
Successful in 19s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E tanstackstart-react-cloudflare Test (optional) |
Successful in 22s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-orpc Test (optional) |
Successful in 57s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E react-router-7-framework-instrumentation Test (optional) |
Successful in 2m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-mastra (latest) Test (optional) |
Successful in 59s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nuxt-5-sourcemaps (static / nuxt generate) Test (optional) |
Successful in 20s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E react-send-to-sentry Test (optional) |
Successful in 3m |
Details |
| ✅ |
CI: Optional E2E Tests / E2E node-pi-durable (latest) Test (optional) |
Successful in 33s |
Details |
| ✅ |
CI: Optional E2E Tests / E2E nextjs-16-tunnel (cloudflare) Test (optional) |
Successful in 45s |
Details |
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The tool-runner chat span follow-up is now tracked in #25816. The cause is message threads, added in 1.2.0. The thread awaits request._responseProps() and parses the response itself, so wrapApiPromiseResponse never ends the span. 1.0.0 and 1.1.0 still produce the chat spans.
|
RulaKhaled reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
mydea
added a commit
that referenced
this pull request
Oct 28, 2026
**Why:** Two optional E2E apps fail on `develop`, independent of any PR:
- `node-anthropic-send-to-sentry (latest)` doesn't compile:
`@anthropic-ai/sdk` 1.0 moved to API version `2026-10-21`, which removed
`temperature` from message params. The app source is shared with the
pinned 0.63.0 variant, so it drops `temperature` and the e2e no longer
asserts `gen_ai.request.temperature`. Request params stay covered by
`node-integration-tests`.
- `node-openai-decisions-send-to-sentry` (both variants) still expected
the Vercel AI origin `auto.vercelai.channel` from before #25602 renamed
it to `auto.ai.vercelai`.
**Depends on:** #25750. Our Anthropic instrumentation only matches SDK
versions `<1`, so the latest variant compiles with this PR but still
produces no gen_ai spans until #25750 raises the range.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
The main Anthropic suite now runs on @anthropic-ai/sdk 1.3.0. It passes
unchanged apart from `completions.create`, which 1.0 removed. That call
moves to a new `v0/` suite pinned to 0.133.0, which also runs the
`messages` calls so 0.x keeps a smoke test.
Bun runs neither the `v0/` nor the `v1/` suite, like the other Anthropic
suites: `bun run` does not inject the diagnostics channels.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts:
# pnpm-lock.yaml
cursor
Bot
left a comment
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stale Bugbot comment from a previous run.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The SessionToolRunner entry landed on develop after the other Anthropic
ranges were raised, so it still stopped at `<1`. 1.x ships the same
class at the same path, so its tool runs got no `execute_tool` spans.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
On Deno the mock server's requests get their own span containers, which
can arrive before the one with `main`. The 0.x test and the 1.x session
runner test took whichever came first, so they saw no Anthropic spans.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Once this lands, #25841 can follow up: its gen-ai-libraries (latest) e2e variant pins '@anthropic-ai/sdk@<1' because 1.x isn't instrumented yet. That pin in test:build-latest can then become @anthropic-ai/sdk@latest.
|
RulaKhaled reacted with thumbs up emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
# Conflicts:
# pnpm-lock.yaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 2 potential issues.

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 202fd22. Configure here.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…ment the SDK
Setting `ANTHROPIC_OPEN_TELEMETRY=false` in `setup()` also hit apps
where orchestrion never injects the SDK, so they lost the SDK's spans
and got none from us. It now runs when our channels subscribe.
Also corrects the comment: the SDK traces itself since 0.134, not 1.0,
and adds a changelog entry for the change.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
mydea
added a commit
that referenced
this pull request
Oct 30, 2026
…-libraries (#25841)
**Why:** The test that sends what some ai integrations send to sentry
are not really necessary. most of this is covered elsewhere already.
Streaming is the one case where the real wire format matters, so only
the streamed OpenAI and Anthropic chats are moved to the existing
gen-ai-libraries E2E test, and they now run on Cloudflare too.
In addition, an optional "latest" variant is added for this too to test
all the genai libraries in their latest version.
**How to review:** Start with `tests/chat-stream.test.ts`. The
`[DONE]`-frame workaround in `libraries.ts` comes from the Anthropic
app. Anthropic SDK 0.136+ needs it when going through OpenRouter.
**Unsure about:** `@anthropic-ai/sdk` 1.x isn't instrumented yet (the
orchestrion config covers `<1`), so `(latest)` pins Anthropic to the
newest 0.x and every other SDK uses `@latest`. The pin can go once
#25750 lands.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <[email protected]>
# Conflicts:
# CHANGELOG.md
# pnpm-lock.yaml
# Conflicts:
# CHANGELOG.md
# dev-packages/node-integration-tests/package.json
# pnpm-lock.yaml
Uh oh!
There was an error while loading. Please reload this page.
RulaKhaled
added a commit
that referenced
this pull request
Nov 4, 2026
The 1.x suite from #25750 asserted that session tool spans are children of
the caller's span. They now sit under the session's invoke_agent span.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|