Title: Manually wrapping Workers AI inside withSentry creates a second span that ignores the options · Issue #26547 · getsentry/sentry-javascript · GitHub
Open Graph Title: Manually wrapping Workers AI inside withSentry creates a second span that ignores the options · Issue #26547 · getsentry/sentry-javascript
X Title: Manually wrapping Workers AI inside withSentry creates a second span that ignores the options · Issue #26547 · getsentry/sentry-javascript
Description: Description Inside withSentry, env.AI is already instrumented with no options (packages/cloudflare/src/instrumentations/worker/instrumentEnv.ts:93). Wrapping it manually to pass options wraps the proxy a second time: const ai = Sentry.in...
Open Graph Description: Description Inside withSentry, env.AI is already instrumented with no options (packages/cloudflare/src/instrumentations/worker/instrumentEnv.ts:93). Wrapping it manually to pass options wraps the p...
X Description: Description Inside withSentry, env.AI is already instrumented with no options (packages/cloudflare/src/instrumentations/worker/instrumentEnv.ts:93). Wrapping it manually to pass options wraps the p...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/26547
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Manually wrapping Workers AI inside withSentry creates a second span that ignores the options","articleBody":"### Description\n\nInside `withSentry`, `env.AI` is already instrumented with no options (`packages/cloudflare/src/instrumentations/worker/instrumentEnv.ts:93`). Wrapping it manually to pass options wraps the proxy a second time:\n\n```js\nconst ai = Sentry.instrumentWorkersAiClient(env.AI, { recordInputs: false });\nawait ai.run('@cf/meta/llama-3.1-8b-instruct', { prompt: 'Hello' });\n```\n\nThis creates two `gen_ai.chat` spans for one call. The outer span follows the options. The inner, automatic span records inputs and outputs with the defaults, so `recordInputs: false` doesn't keep the prompt out.\n\nThis is how the `instrumentWorkersAiClient` JSDoc says to pass custom options, and #26471 uses it in its example for per-call `recordInputs`/`recordOutputs` functions. It also affects booleans on `develop`.\n\nPossible fix: when `instrumentWorkersAiClient` gets a client that is already instrumented, wrap the original binding instead of the proxy.\n","author":{"url":"https://github.com/RulaKhaled","@type":"Person","name":"RulaKhaled"},"datePublished":"2026-11-18T10:44:20Z","url":"https://github.com/getsentry/sentry-javascript/issues/26547"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9ccca767-c5c6-5175-589d-d69baebe80d6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ECFA:346CFE:258476F:312D0DA:6B0424BF |
| html-safe-nonce | 4b99a010997a738e5a4a7e9d9fc59453e8e2d52cd15707ad6fb9408943cbfa9b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQ0ZBOjM0NkNGRToyNTg0NzZGOjMxMkQwREE6NkIwNDI0QkYiLCJ2aXNpdG9yX2lkIjoiNzA2MzA4MjE4OTc0Mjk0MTM3NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7e8d7291d1415cd4edb6b0ef58ae9d6fd172f26efc87c17ca3b5fef17b3384d5 |
| hovercard-subject-tag | issue:6465361483 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/26547/issue_layout |
| twitter:image | https://opengraph.githubassets.com/713c1d4904fa744c625e4a8b2c1c4f8f1da61a8e44b76dfb296ac5edd138cc68/getsentry/sentry-javascript/issues/26547 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/713c1d4904fa744c625e4a8b2c1c4f8f1da61a8e44b76dfb296ac5edd138cc68/getsentry/sentry-javascript/issues/26547 |
| og:image:alt | Description Inside withSentry, env.AI is already instrumented with no options (packages/cloudflare/src/instrumentations/worker/instrumentEnv.ts:93). Wrapping it manually to pass options wraps the p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | RulaKhaled |
| hostname | github.com |
| expected-hostname | github.com |
| None | b7a1d2b9101496921b08579fbee988d014345aef2f5bd660d1f8c7332d81560e |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | c3dd496c3da6ea6b77e69c09279d2b81604654f1 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width