Title: Sentry breaking OpenAI STREAMING · Issue #18962 · getsentry/sentry-javascript · GitHub
Open Graph Title: Sentry breaking OpenAI STREAMING · Issue #18962 · getsentry/sentry-javascript
X Title: Sentry breaking OpenAI STREAMING · Issue #18962 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/18962
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sentry breaking OpenAI STREAMING","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues [https://github.com/getsentry/sentry-javascript/issues](\u003chttps://github.com/getsentry/sentry-javascript/issues>)\n- [X] I have reviewed the documentation [https://docs.sentry.io/](\u003chttps://docs.sentry.io/>)\n- [X] I am using the latest SDK release [https://github.com/getsentry/sentry-javascript/releases](\u003chttps://github.com/getsentry/sentry-javascript/releases>)\n\n### How do you use Sentry?\n\nSentry Saas ([sentry.io](\u003chttp://sentry.io>))\n\n### Which SDK are you using?\n\n@sentry/nestjs\n\n### SDK Version\n\nlatest 10+\n\n### Framework Version\n\n*No response*\n\n### Link to Sentry event\n\n*No response*\n\n### Reproduction Example/SDK Setup\n\n*No response*\n\n### Steps to Reproduce\n\nImporting instrument.ts breaks OpenAI streaming capabilities (only last full response is coming through).\u003cbr>I am using OpenAI with Langchain wrapper if it matters.\u003cbr>I've lost few hours until I discovered that this is Sentry causing my streaming not to work.\n\n```typescript\nimport * as Sentry from '@sentry/nestjs';\n\nimport { isSentryTracingEnabled } from './common/utils/sentry-tracing';\n\n// DSN is safe to hardcode - it only allows sending data TO Sentry\n// Can be overridden via SENTRY_DSN env var for per-environment routing\nconst DEFAULT_DSN =\n 'xxx;\n\nconst dsn = process.env.SENTRY_DSN ?? DEFAULT_DSN;\n// Use SENTRY_ENVIRONMENT if set, otherwise infer from NODE_ENV\nconst environment =\n process.env.SENTRY_ENVIRONMENT ??\n (process.env.NODE_ENV === 'production' ? 'production' : 'local');\nconst release = process.env.RELEASE_TAG ?? 'local';\nconst tracingEnabled = isSentryTracingEnabled();\nconst normalizedEnvironment = environment.toLowerCase();\nconst isLocalEnvironment = normalizedEnvironment === 'local';\nconst isProductionEnvironment = normalizedEnvironment === 'production';\ntype LogLevel = 'info' | 'warn' | 'error' | 'fatal';\nconst logLevels: LogLevel[] = isProductionEnvironment\n ? ['warn', 'error', 'fatal']\n : ['info', 'warn', 'error', 'fatal'];\n\n// Only initialize Sentry if DSN is provided and not in local development\nif (dsn) {\n // && environment !== 'local') {\n Sentry.init({\n dsn,\n environment,\n release,\n sendDefaultPii: true,\n tracesSampleRate:\n tracingEnabled && environment === 'production'\n ? 1.0\n : tracingEnabled\n ? 1.0\n : 0,\n // Enable logs to be sent to Sentry\n enableLogs: !isLocalEnvironment,\n integrations: (integrations) => {\n const filtered = integrations.filter((integration) => {\n const name = integration?.name ?? '';\n const normalized = name.toLowerCase();\n // Filter out Redis (noisy) and OpenAI (breaks streaming)\n return !(\n normalized.includes('redis') ||\n normalized.includes('ioredis') ||\n normalized.includes('openai')\n );\n });\n\n return [\n // Automatically capture Pino logs\n Sentry.pinoIntegration({\n log: {\n levels: logLevels,\n },\n error: {\n levels: ['error', 'fatal'],\n },\n }),\n ...filtered,\n ];\n },\n // Scrub sensitive data from events before sending to Sentry\n beforeSend(event) {\n // Remove sensitive headers (Pino redaction doesn't cover Sentry's request context)\n if (event.request?.headers) {\n const sensitiveHeaders = [\n 'authorization',\n 'cookie',\n 'x-api-key',\n 'x-auth-token',\n 'x-access-token',\n ];\n for (const header of sensitiveHeaders) {\n if (event.request.headers[header]) {\n event.request.headers[header] = '[REDACTED]';\n }\n }\n }\n\n // Remove sensitive user data if present\n if (event.user) {\n // Keep user.id but remove other PII\n const userId = event.user.id;\n event.user = userId ? { id: userId } : undefined;\n }\n\n // Remove sensitive tags/context\n if (event.tags) {\n delete event.tags.password;\n delete event.tags.token;\n delete event.tags.secret;\n }\n\n // Scrub sensitive data from extra context\n if (event.contexts) {\n const sensitiveKeys = ['password', 'token', 'secret', 'apiKey', 'auth'];\n for (const key of sensitiveKeys) {\n if (key in event.contexts) {\n delete event.contexts[key as keyof typeof event.contexts];\n }\n }\n }\n\n return event;\n },\n // Filter logs: keep info+ and drop trace/debug noise\n beforeSendLog(log) {\n if (isLocalEnvironment) {\n return null;\n }\n if (log.level === 'trace' || log.level === 'debug') {\n return null;\n }\n if (isProductionEnvironment && log.level === 'info') {\n return null;\n }\n return log;\n },\n });\n}\n```\n\n### Expected Result\n\nOpenAI / Langchain streaming to work.\n\n### Actual Result\n\nStreaming is broken.\n\nNo matter if I added filtering of integrations, `process.env.OTEL_NODE_DISABLED_INSTRUMENTATIONS = 'openai';` as per [JS-770](https://linear.app/getsentry/issue/JS-770/openai-integration-is-breaking-openai-calls-even-when-the-integration) and many more - only completely removing instrument.ts import allows streaming to work.\n\n### Additional Context\n\nI can live without openai instrumentation working until this is fixed, but please give me/us some workaround.\n\n### Priority\n\nReact with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.","author":{"url":"https://github.com/murbanowicz","@type":"Person","name":"murbanowicz"},"datePublished":"2026-01-23T16:16:30Z","url":"https://github.com/getsentry/sentry-javascript/issues/18962"}
| 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:7281b2d6-2575-b7a5-54b0-280f6fb8be01 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 97D4:72378:BD0286:F65CFA:6B04DC34 |
| html-safe-nonce | 2f641298f1c53ce8845bcf05da6057f25a7a9bad30fd5abb8bb1b4bdad2ce9ab |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5N0Q0OjcyMzc4OkJEMDI4NjpGNjVDRkE6NkIwNERDMzQiLCJ2aXNpdG9yX2lkIjoiNTY0MzMzNzEwMDI5NzU1OTA5MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9bf8fe7a68d8a89255dfa5839116df94aed7536936789cb3dc686ae1c610f55c |
| hovercard-subject-tag | issue:3848145216 |
| 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/18962/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e6784251a0caa22cbacc6cc1638bf3c6d0aa54508eb98a3fd0a481fc295cfb4e/getsentry/sentry-javascript/issues/18962 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e6784251a0caa22cbacc6cc1638bf3c6d0aa54508eb98a3fd0a481fc295cfb4e/getsentry/sentry-javascript/issues/18962 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | murbanowicz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 194dacb8acfd3e4d3ffb2704e0b1f10327f0dad690a7142acc7b0e0a2d073965 |
| 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 | 6c35540a0a2991ee20bd053ba2601cce33f72cb1 |
| ui-target | full |
| 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