Title: graphqlIntegration does not rename the root span with the operation name in AWS Lambda · Issue #15699 · getsentry/sentry-javascript · GitHub
Open Graph Title: graphqlIntegration does not rename the root span with the operation name in AWS Lambda · Issue #15699 · getsentry/sentry-javascript
X Title: graphqlIntegration does not rename the root span with the operation name in AWS Lambda · Issue #15699 · 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/15699
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"graphqlIntegration does not rename the root span with the operation name in AWS Lambda","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/aws-serverless\n\n### SDK Version\n\n9.5.0\n\n### Framework Version\n\n_No response_\n\n### Link to Sentry event\n\nhttps://bilderit.sentry.io/traces/trace/dc6845bb99a44bb69609a74dc394258f/?environment=pr1687&node=span-91982ffd2de5504c&node=txn-304389edaa5e4227be7f3f1424d1ac0d&pageEnd&pageStart&project=5263245&source=traces&statsPeriod=1h&table=trace×tamp=1742149537.396\n\n### Reproduction Example/SDK Setup\n\n```javascript\nSentry.init({\n dsn: 'YOUR_SENTRY_DSN',\n release: 'YOUR_SENTRY_RELEASE',\n environment: 'YOUR_SENTRY_ENVIRONMENT',\n tracesSampleRate: 0.1,\n profilesSampleRate: 0.1,\n maxValueLength: 2000,\n integrations: [\n Sentry.rewriteFramesIntegration({ root: process.cwd() }),\n Sentry.graphqlIntegration({\n ignoreResolveSpans: false,\n useOperationNameForRootSpan: true,\n }),\n Sentry.knexIntegration(),\n Sentry.postgresIntegration(),\n nodeProfilingIntegration(),\n ],\n _experiments: {\n maxSpans: 'YOUR_SENTRY_RELEASE' !== 'prod' ? 10000 : 1000,\n },\n});\n```\n\n### Steps to Reproduce\n\nI'm using `Sentry.graphqlIntegration({ useOperationNameForRootSpan: true }) `in an AWS Lambda with Apollo Server. According to the documentation, this should rename the root http.server span with the GraphQL operation name.\n\n\n```javascript\n// instrumentation.ts\n\nSentry.init({\n dsn: 'YOUR_SENTRY_DSN',\n release: 'YOUR_SENTRY_RELEASE',\n environment: 'YOUR_SENTRY_ENVIRONMENT',\n tracesSampleRate: 0.1,\n profilesSampleRate: 0.1,\n maxValueLength: 2000,\n integrations: [\n Sentry.rewriteFramesIntegration({ root: process.cwd() }),\n Sentry.graphqlIntegration({\n ignoreResolveSpans: false,\n useOperationNameForRootSpan: true,\n }),\n Sentry.knexIntegration(),\n Sentry.postgresIntegration(),\n nodeProfilingIntegration(),\n ],\n _experiments: {\n maxSpans: 'YOUR_SENTRY_RELEASE' !== 'prod' ? 10000 : 1000,\n },\n});\n```\nLambda handler:\n\n```javascript\nimport './instrumentation';\n\nexport const handleHttp = Sentry.wrapHandler(\n async (event: APIGatewayEvent, context: Context) => {\n const server = await getServer();\n return await server.createHttpHandler({\n cors: {\n origin: '*',\n allowedHeaders: ['sentry-trace', 'baggage'],\n credentials: true,\n },\n })(event, context);\n }\n);\n```\n\n\nThe issue is that in AWS Lambda, the root span is not `http.server` but `function.aws.lambda`, so graphqlIntegration never renames it.\n\n\n\n\n### Expected Result\n\n- The root span should be http.server and renamed to include the GraphQL operation name (e.g., POST /graphql (query operationName)).\n\n- The trace should correctly reflect the operation name in the root span, instead of the default lambda function name.\n\n### Actual Result\n\n- There is no op: http.server span, only function.aws.lambda.\n\n- graphqlIntegration does not rename the root span name with the graphql operation name. The name of the root operation is the name of the Lambda Function.","author":{"url":"https://github.com/nickygb","@type":"Person","name":"nickygb"},"datePublished":"2025-03-16T19:01:09Z","url":"https://github.com/getsentry/sentry-javascript/issues/15699"}
| 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:061e48d8-9c49-3ac6-6194-19644d9d73b9 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C806:1199FD:481A5:61B30:6B07553E |
| html-safe-nonce | e8853f56af0d7618acd83a689c1ea630dd0c81f2d7bb6b5add811407b6fcd306 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDODA2OjExOTlGRDo0ODFBNTo2MUIzMDo2QjA3NTUzRSIsInZpc2l0b3JfaWQiOiI1MzY4NzU1OTkyNzczNzQzOTM0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 546e36ad80a1dd50271030db7b511d8ee6b3881e6dc40e64f1799cc15dbddadf |
| hovercard-subject-tag | issue:2923249038 |
| 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/15699/issue_layout |
| twitter:image | https://opengraph.githubassets.com/efddd472166ddb5187a50cea9efce9e98b3af42db2fe0c725321bfcb8444b790/getsentry/sentry-javascript/issues/15699 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/efddd472166ddb5187a50cea9efce9e98b3af42db2fe0c725321bfcb8444b790/getsentry/sentry-javascript/issues/15699 |
| 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 | nickygb |
| hostname | github.com |
| expected-hostname | github.com |
| None | 663b1a69a41309856ffd9403fa5b764f6c0f78a39a0a8f75fb2c205c96a947be |
| 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 | effa2c0a160a75bd95d9ffcc6320197d7aea0d83 |
| 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