Title: None of the AI auto-instrumentations work with Sentry Bun · Issue #19696 · getsentry/sentry-javascript · GitHub
Open Graph Title: None of the AI auto-instrumentations work with Sentry Bun · Issue #19696 · getsentry/sentry-javascript
X Title: None of the AI auto-instrumentations work with Sentry Bun · Issue #19696 · 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/19696
X: @github
Domain: github.com
IPv4 address: 140.82.112.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"None of the AI auto-instrumentations work with Sentry Bun","articleBody":"### Is there an existing issue for this?\n\n- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [x] I have reviewed the documentation https://docs.sentry.io/\n- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which SDK are you using?\n\n@sentry/bun\n\n### SDK Version\n\n10.42.0\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`instrumentation.ts`\n```typescript\nimport * as Sentry from '@sentry/bun';\n\nif (!process.env.SENTRY_URL) {\n throw new Error('SENTRY_URL environment variable is not set');\n}\n\nSentry.init({\n dsn: process.env.SENTRY_URL,\n // Send structured logs to Sentry\n enableLogs: true,\n // Tracing\n tracesSampleRate: 1.0, // Capture 100% of the transactions\n debug: true,\n integrations: [\n // Sentry.googleGenAIIntegration(),\n // Sentry.langChainIntegration(),\n // Sentry.langGraphIntegration(),\n ]\n});\n\n// This works so SENTRY_URL and project are setup correctly\n// Sentry.logger.info(\"Sentry instrumentation initialized\");\n```\n\n`test.ts`\n```typescript\n/**\n * Minimal @google/genai test script for validating Sentry Google_GenAI instrumentation.\n *\n * Run via: bun run sentry:test\n *\n * Uses the same model as the general agent. Does NOT go through LangChain,\n * so a successful trace in Sentry means the issue is LangChain-specific.\n */\n// import '../../src/infrastructure/instrumentation/sentry/instrumentation.ts';\nimport { GoogleGenAI } from \"@google/genai\";\nimport * as Sentry from \"@sentry/bun\";\n\nif (!process.env.GOOGLE_API_KEY) {\n throw new Error(\"GOOGLE_API_KEY is not set\");\n}\n\nconst genai = new GoogleGenAI({ apiKey: process.env.GOOGLE_API_KEY });\n\nconsole.log(\"Sending generateContent request...\");\n\nconst response = await genai.models.generateContent({\n model: \"gemini-3-flash-preview\",\n contents: \"Reply with exactly one word: hello\",\n});\n\nconsole.log(\"Response:\", response.text);\n\n// Flush Sentry before the process exits so traces/spans are not dropped.\nconsole.log(\"Flushing Sentry...\");\nawait Sentry.flush(5000);\nconsole.log(\"Done.\");\n```\n\n### Steps to Reproduce\n\n`bun run --preload instrumentation.ts test.ts`\nOr you can uncomment the `instrumentation.ts` import in `test.ts` and just do `bun run test.ts`\n\n### Expected Result\n\nGenAI Traces should appear in the dashboard.\nI also tried with Langchain and Langgraph, also didn't get picked up in my project.\n\n### Actual Result\n\n```\n$ bun --preload ./src/infrastructure/instrumentation/sentry/instrumentation.ts scripts/dev/sentry-genai-test.ts\nSentry Logger [log]: Initializing Sentry: process: 156874, thread: main.\nSentry Logger [log]: Cleared AI provider skip registrations\nSentry Logger [log]: Integration installed: InboundFilters\nSentry Logger [log]: Integration installed: FunctionToString\nSentry Logger [log]: Integration installed: LinkedErrors\nSentry Logger [log]: Integration installed: RequestData\nSentry Logger [log]: Integration installed: Console\nSentry Logger [log]: Integration installed: Http\nSentry Logger [log]: Integration installed: NodeFetch\nSentry Logger [log]: Integration installed: OnUncaughtException\nSentry Logger [log]: Integration installed: OnUnhandledRejection\nSentry Logger [log]: Integration installed: ContextLines\nSentry Logger [log]: Integration installed: Context\nSentry Logger [log]: Integration installed: Modules\nSentry Logger [log]: Integration installed: ProcessSession\nSentry Logger [log]: Integration installed: BunServer\nSentry Logger [log]: Integration installed: Express\nSentry Logger [log]: Integration installed: Fastify\nSentry Logger [log]: Integration installed: Graphql\nSentry Logger [log]: Integration installed: Hono\nSentry Logger [log]: Integration installed: Mongo\nSentry Logger [log]: Integration installed: Mongoose\nSentry Logger [log]: Integration installed: Mysql\nSentry Logger [log]: Integration installed: Mysql2\nSentry Logger [log]: Integration installed: Redis\nSentry Logger [log]: Integration installed: Postgres\nSentry Logger [log]: Integration installed: Prisma\nSentry Logger [log]: Integration installed: Hapi\nSentry Logger [log]: Integration installed: Koa\nSentry Logger [log]: Integration installed: Connect\nSentry Logger [log]: Integration installed: Tedious\nSentry Logger [log]: Integration installed: GenericPool\nSentry Logger [log]: Integration installed: Kafka\nSentry Logger [log]: Integration installed: Amqplib\nSentry Logger [log]: Integration installed: LruMemoizer\nSentry Logger [log]: Integration installed: LangChain\nSentry Logger [log]: Integration installed: LangGraph\nSentry Logger [log]: Integration installed: VercelAI\nSentry Logger [log]: Integration installed: OpenAI\nSentry Logger [log]: Integration installed: Anthropic_AI\nSentry Logger [log]: Integration installed: Google_GenAI\nSentry Logger [log]: Integration installed: PostgresJs\nSentry Logger [log]: Integration installed: Firebase\nSentry Logger [log]: SDK initialized from ESM\nSentry Logger [log]: @opentelemetry/api: Registered a global for diag v1.9.0.\nSentry Logger [log]: @opentelemetry/api: Registered a global for trace v1.9.0.\nSentry Logger [log]: @opentelemetry/api: Registered a global for propagation v1.9.0.\nSentry Logger [log]: @opentelemetry/api: Registered a global for context v1.9.0.\nSentry Logger [log]: @sentry/instrumentation-http Applying instrumentation patch for nodejs core module on require hook {\n module: \"https\",\n}\nSentry Logger [log]: @opentelemetry_sentry-patched/instrumentation-http Applying instrumentation patch for nodejs core module on require hook {\n module: \"https\",\n}\nSending generateContent request...\nResponse: Hello\nFlushing Sentry...\nSentry Logger [log]: SpanExporter exported 0 spans, 0 spans are waiting for their parent spans to finish\nSentry Logger [log]: Flushing outcomes...\nSentry Logger [log]: No outcomes to send\nDone.\nSentry Logger [log]: Flushing outcomes...\nSentry Logger [log]: No outcomes to send\n```\n\nNothing is emitted.\n\n### Additional Context\n\nLibrary version:\n`@google/genai@1.44.0`\n`@langchain/core@1.1.30`\n`@langchain/google@0.1.5`\n`@langchain/langgraph@1.2.0`\n\nBun version: `1.3.10`\nSystem: `Ubuntu 25.10 (Linux 6.17.0-14-generic)`\n\nVery old maybe unrelated issue:\nhttps://github.com/getsentry/sentry-javascript/issues/14202\n\n### Priority\n\n\u003csub>React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding `+1` or `me too`, to help us triage it.\u003c/sub>","author":{"url":"https://github.com/vjancik","@type":"Person","name":"vjancik"},"datePublished":"2026-03-08T16:33:59Z","url":"https://github.com/getsentry/sentry-javascript/issues/19696"}
| 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:f5181967-5584-ec00-9c9c-10084680465e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9BCC:D405E:35A6A56:462BDEE:6B043911 |
| html-safe-nonce | b5c7e4e8a984d58d53c0fb6a8e5943f6746a18d7d04781a612d4ab5930353986 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkNDOkQ0MDVFOjM1QTZBNTY6NDYyQkRFRTo2QjA0MzkxMSIsInZpc2l0b3JfaWQiOiI5MzAxNzgzNTEwMTc2Mzg1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 15db3180d6f730e0217fde652e460dd860ac1f106ff9e3c5b5cb7c86e96b8c48 |
| hovercard-subject-tag | issue:4041656069 |
| 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/19696/issue_layout |
| twitter:image | https://opengraph.githubassets.com/dbab6f375d7bd947af817c3bc6a55253c7f51d6a2a075af2354132686d12330b/getsentry/sentry-javascript/issues/19696 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/dbab6f375d7bd947af817c3bc6a55253c7f51d6a2a075af2354132686d12330b/getsentry/sentry-javascript/issues/19696 |
| 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 | vjancik |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64 |
| 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 | 06dc448a76fe4751ac1db26524aefa3aa3e889a8 |
| 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