Title: Sentry creates three traces for a single http request (ESM, custom opentelemetry setup) · Issue #14065 · getsentry/sentry-javascript · GitHub
Open Graph Title: Sentry creates three traces for a single http request (ESM, custom opentelemetry setup) · Issue #14065 · getsentry/sentry-javascript
X Title: Sentry creates three traces for a single http request (ESM, custom opentelemetry setup) · Issue #14065 · 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/14065
X: @github
Domain: github.com
IPv4 address: 140.82.113.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Sentry creates three traces for a single http request (ESM, custom opentelemetry setup)","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\n8.35.0\n\n### Framework Version\n\nhapi 21.3.10\n\n### Link to Sentry event\n\n_No response_\n\n### Reproduction Example/SDK Setup\n\nhttps://github.com/nlochschmidt/sentry-duplicate-tracing-bug\n\n### Steps to Reproduce\n\n1. I've setup Sentry and a custom otel setup as described in [the docs](https://docs.sentry.io/platforms/javascript/guides/node/opentelemetry/custom-setup/) we are not using Sentry for tracing but another service\n2. Running the server I can see from the logs that instrumentations are setup\n3. When I call the server e.g. `curl localhost:3000` I get a `spanId` and `traceId` from inside the handler\n4. The `ConsoleSpanExporter` will print the traces and spans collected after a short time. \n\n### Expected Result\n\nI expect to get a single trace with two spans (one for http and one for hapi).\n\n### Actual Result\n\nWhat actually happens is that there are three traces and only one of them (`traceId: 9dbf48ed9eee5aa66cba36df77eef90b`) has the two spans that are expected, while the other two traces have only a single http root span. \n\nI can see some odd instrumentation scopes `@opentelemetry_sentry-patched/instrumentation-http`, but interestingly the `@opentelemetry/instrumentation-http` is on one of the traces with a single span.\n\nHere is the output cleaned up a bit (full output in the example repo README):\n\n```\n{\n traceId: '9dbf48ed9eee5aa66cba36df77eef90b',\n id: '86279d018d1d20f4',\n parentId: 'bb6216be501f6924',\n instrumentationScope: {\n name: '@opentelemetry/instrumentation-hapi',\n },\n\n name: 'route - /',\n kind: 0,\n attributes: {\n 'sentry.sample_rate': 1\n },\n status: { code: 0 },\n}\n```\n```\n{\n traceId: '04de96dc9304e6376ac87ffa038e53f4',\n id: 'e68a07918c660533',\n parentId: undefined,\n instrumentationScope: {\n name: '@opentelemetry/instrumentation-http',\n },\n name: 'GET',\n kind: 1,\n attributes: {\n 'sentry.sample_rate': 1,\n 'sentry.parentIsRemote': true,\n },\n status: { code: 0 },\n}\n```\n```\n{\n traceId: 'e82eb8fe28439cad4cb409199d1759f3',\n id: '01cf0d4b96a81e61',\n parentId: undefined,\n instrumentationScope: {\n name: '@opentelemetry_sentry-patched/instrumentation-http',\n },\n name: 'GET',\n kind: 1,\n attributes: {\n 'sentry.sample_rate': 1,\n 'sentry.parentIsRemote': true,\n 'sentry.origin': 'auto.http.otel.http',\n },\n status: { code: 0 },\n events: [],\n links: []\n}\n```\n```\n{\n traceId: '9dbf48ed9eee5aa66cba36df77eef90b',\n id: 'bb6216be501f6924',\n parentId: undefined,\n instrumentationScope: {\n name: '@opentelemetry_sentry-patched/instrumentation-http',\n },\n name: 'GET',\n kind: 1,\n attributes: {\n 'sentry.sample_rate': 1,\n 'sentry.parentIsRemote': true,\n 'sentry.origin': 'auto.http.otel.http',\n },\n status: { code: 0 },\n}\n```\n\nIt works as expected when removing Sentry","author":{"url":"https://github.com/nlochschmidt","@type":"Person","name":"nlochschmidt"},"datePublished":"2024-10-23T17:19:23Z","url":"https://github.com/getsentry/sentry-javascript/issues/14065"}
| 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:2e87da1f-c951-82c0-397f-e08b63be00b2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9890:3C1C49:4183FC5:5678699:6B03F4A6 |
| html-safe-nonce | 6f87751d94d971db009318d8f6aff1b0d3e0a9e4ce4ded289ccf629517e2aa2d |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODkwOjNDMUM0OTo0MTgzRkM1OjU2Nzg2OTk6NkIwM0Y0QTYiLCJ2aXNpdG9yX2lkIjoiODY1NTg4NTcxMDcwNjA3ODg4NiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 707864fa7b8a79a105d74355716cd0b04c31ed0035d6bab24bb8c63c53efa93f |
| hovercard-subject-tag | issue:2609315147 |
| 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/14065/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0052d1ebf94dd3e2ed637e2de5180438e3936d1c6830860b5f1dbdbec6b21411/getsentry/sentry-javascript/issues/14065 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0052d1ebf94dd3e2ed637e2de5180438e3936d1c6830860b5f1dbdbec6b21411/getsentry/sentry-javascript/issues/14065 |
| 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 | nlochschmidt |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| 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 | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| 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