Title: graphqlIntegration: updating Sentry config removes `responseHook` from otel config · Issue #16004 · getsentry/sentry-javascript · GitHub
Open Graph Title: graphqlIntegration: updating Sentry config removes `responseHook` from otel config · Issue #16004 · getsentry/sentry-javascript
X Title: graphqlIntegration: updating Sentry config removes `responseHook` from otel config · Issue #16004 · 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/16004
X: @github
Domain: github.com
IPv4 address: 140.82.112.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"graphqlIntegration: updating Sentry config removes `responseHook` from otel config","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/node\n\n### SDK Version\n\n9.11.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**Important**: I'm using late initialization using the ESM preload, which explains why `setConfig` is called twice.\n\n```typescript\nSentry.init({\n // ...\n integrations: [\n Sentry.graphqlIntegration({\n mergeItems: true, // Passed to otel, not defined in Sentry types\n ignoreResolveSpans: false,\n useOperationNameForRootSpan: true,\n }),\n ],\n})\n```\n\n### Steps to Reproduce\n\nI added the following log line in otel's graphql instrumentation `@opentelemetry/instrumentation-graphql/build/src/instrumentation.js`:\n\n```javascript\nsetConfig(config = {}) {\n super.setConfig(Object.assign(Object.assign({}, DEFAULT_CONFIG), config));\n console.log('>>>setConfig done', this.getConfig())\n}\n```\n\nFirst init (during esm preload) logs:\n\n```\n>>>setConfig done {\n enabled: true,\n mergeItems: false,\n depth: -1,\n allowValues: false,\n ignoreResolveSpans: true,\n ignoreTrivialResolveSpans: true,\n useOperationNameForRootSpan: true,\n responseHook: [Function: responseHook]\n}\n```\n\nSecond init (during late Sentry initialization):\n\n```\n>>>setConfig done {\n enabled: true,\n mergeItems: true,\n depth: -1,\n allowValues: false,\n ignoreResolveSpans: false,\n ignoreTrivialResolveSpans: true,\n useOperationNameForRootSpan: true\n // Note the missing hook\n}\n```\n\n### Expected Result\n\nI would expect sentry to pass the `requestHook` again to `setConfig` so that `useOperationNameForRootSpan` can be applied.\n\n### Actual Result\n\n`responseHook` is not passed","author":{"url":"https://github.com/ldiqual","@type":"Person","name":"ldiqual"},"datePublished":"2025-04-07T17:02:46Z","url":"https://github.com/getsentry/sentry-javascript/issues/16004"}
| 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:6115b637-6346-a1fb-9447-b36413d773b3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B732:7AA06:4178:55DB:6B07453F |
| html-safe-nonce | 293fa6e163ea5db609e4989e8a1e5c0f4eb6f54be9e2db79e30ea5bc3a1bd31d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCNzMyOjdBQTA2OjQxNzg6NTVEQjo2QjA3NDUzRiIsInZpc2l0b3JfaWQiOiIyOTM3MDA1MDAzNjY1NTI0MDMxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 865b3c1b17ec3b451ff3fe5a05e7fcf675805408bbda0425d79eaa284eb4e7b2 |
| hovercard-subject-tag | issue:2977476118 |
| 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/16004/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bc7305825017b921444b32b1b14b0ee4e665524ea18fe272b38cf819942dddac/getsentry/sentry-javascript/issues/16004 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bc7305825017b921444b32b1b14b0ee4e665524ea18fe272b38cf819942dddac/getsentry/sentry-javascript/issues/16004 |
| 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 | ldiqual |
| hostname | github.com |
| expected-hostname | github.com |
| None | e906c59266d83416af9bcc8b61b9a96e70a3a84a066bd24f6671c193dd134a04 |
| 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 | a8418b8cd1f6ecc99bee02e3f7dde540702dd08c |
| 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