Title: Replace requiresParentSpan with onlyIfParent in tracing-channel integrations · Issue #25875 · getsentry/sentry-javascript · GitHub
Open Graph Title: Replace requiresParentSpan with onlyIfParent in tracing-channel integrations · Issue #25875 · getsentry/sentry-javascript
X Title: Replace requiresParentSpan with onlyIfParent in tracing-channel integrations · Issue #25875 · getsentry/sentry-javascript
Description: Remove requiresParentSpan from bindTracingChannelToSpan and use startInactiveSpan({ onlyIfParent: true }) at every affected span factory, including both database and non-database integrations. This ticket standardizes call sites on the e...
Open Graph Description: Remove requiresParentSpan from bindTracingChannelToSpan and use startInactiveSpan({ onlyIfParent: true }) at every affected span factory, including both database and non-database integrations. This...
X Description: Remove requiresParentSpan from bindTracingChannelToSpan and use startInactiveSpan({ onlyIfParent: true }) at every affected span factory, including both database and non-database integrations. This...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/25875
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Replace requiresParentSpan with onlyIfParent in tracing-channel integrations","articleBody":"Remove `requiresParentSpan` from `bindTracingChannelToSpan` and use `startInactiveSpan({ onlyIfParent: true })` at every affected span factory, including both database and non-database integrations.\n\nThis ticket standardizes call sites on the existing `onlyIfParent` API and removes the redundant helper option. Changes to or alignment of `onlyIfParent` behavior are tracked separately.\n\nThe helper currently skips `getSpan` entirely without an active parent, bypassing core's `no_parent_span` client reporting. Reporting directly in the early guard could overcount excluded payloads, such as MongoDB handshakes. Using `onlyIfParent` lets eligibility checks run before core handles parent resolution and reporting. No parent-detection mismatch was identified in current call sites.\n\nThe audit found **17 option assignments across 16 binding sites in 10 integrations**; Postgres has two option branches for one binding. DataLoader already sets `onlyIfParent`. Preserve postgres-js's public `requireParentSpan` option using `onlyIfParent: requireParentSpan !== false`.\n\nScope (paths below are relative to `packages/server-utils/src/integrations/`, except Remix):\n\n- [ ] `postgres.ts`: shared query/connect/pool-connect binding, also covering Neon WebSocket queries.\n- [ ] `postgres-js.ts`: query binding; preserve configurable parent requirement.\n- [ ] `mysql2/index.ts`: Orchestrion query/execute binding.\n- [ ] `mysql2/mysql2-dc-subscriber.ts`: native query/execute and connect/pool-connect bindings.\n- [ ] `mongodb/index.ts`: v4+ command and v3 wire-protocol bindings; add `onlyIfParent` in shared `mongodb/mongodb-span.ts::startMongoSpan`, retaining payload exclusions.\n- [ ] `redis/ioredis-channel-subscriber.ts`: command and connect bindings.\n- [ ] `dataloader.ts`: load and shared simple-operation bindings; remove redundant helper guards.\n- [ ] `prisma/orchestrion.ts`: shared terminal binding, including lazy results.\n- [ ] `neon.ts`: HTTP query binding.\n- [ ] `hono/honoIntegration.ts`: internal-request binding; retain duplicate-instrumentation checks.\n- [ ] `packages/remix/src/server/integrations/tracing-channel.ts`: loader and action bindings; leave request-handler root creation unrestricted.\n- [ ] `packages/server-utils/src/tracing-channel.ts`: remove the option, guard, documentation, unused import, and options forwarding/parameter on `bindSpanToChannelStore`. Its other direct caller, Mastra, passes no options.\n\nWithout a parent, the replacement activates a non-recording placeholder and descendants inherit its unsampled state. Existing unsampled parents already produce non-recording spans on these paths. No call site was found that fundamentally requires retaining the helper option, but review these behavioral changes before making a mechanical replacement:\n\n* **Prisma:** lazy results created without a parent could suppress driver spans when consumed later inside a sampled request, because consumption restores the saved placeholder.\n* **Postgres:** deferred stream handlers attach error listeners on previously skipped operations, potentially changing unhandled-error behavior.\n* **Remix:** action form-data cloning/parsing now runs without a parent, adding work and possible synchronous failures if the body was consumed.\n* **postgres-js:** `requestHook` and settlement wrappers now run for parentless queries.\n* **ioredis:** parentless commands enter deduplication tracking, affecting later offline-queue resends.\n* **Hono:** the manual `patchAppRequest` proxy has a separate no-parent early return; consider parity with the automatic subscriber.\n\nUpdate tests that currently expect `startInactiveSpan` never to be called without a parent, notably Postgres, Neon, Prisma, and Remix. Verify reporting occurs for eligible spans, excluded payloads remain excluded, and non-recording contexts behave as intended.\n\nOriginal addition: getsentry/sentry-javascript#22113.\n\nThe initial audit was read-only; no changes or tests were run during that investigation.","author":{"url":"https://github.com/nicohrubec","@type":"Person","name":"nicohrubec"},"datePublished":"2026-10-29T12:36:55Z","url":"https://github.com/getsentry/sentry-javascript/issues/25875"}
| 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:da8d6c64-9c4a-2491-e77f-c38e318d4fcf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DBBC:279C41:5DE43B:85470C:6B0479FC |
| html-safe-nonce | d5c7f2715359e78668501a1f164602ce764d16715ba233a908279c6d56a791dd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQkJDOjI3OUM0MTo1REU0M0I6ODU0NzBDOjZCMDQ3OUZDIiwidmlzaXRvcl9pZCI6IjE2MzA2MzA2MDk2OTk1MDI1ODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 72e3287ee3c9eda492c4f93dc861ff547971a4f64ad43fbde28e911a4687a99e |
| hovercard-subject-tag | issue:6099781391 |
| 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/25875/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b1c0e02979f5374c55898c891d1c38a0c0b64c17eb7daf3b9ced4dbb5a5cb892/getsentry/sentry-javascript/issues/25875 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b1c0e02979f5374c55898c891d1c38a0c0b64c17eb7daf3b9ced4dbb5a5cb892/getsentry/sentry-javascript/issues/25875 |
| og:image:alt | Remove requiresParentSpan from bindTracingChannelToSpan and use startInactiveSpan({ onlyIfParent: true }) at every affected span factory, including both database and non-database integrations. This... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nicohrubec |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9c099f1b85def81ca352464c276510dfef32deaf3c305404e65b8d270284a58b |
| 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 | cf73f57448d52b3a7b619195e182b33d3b3454ca |
| 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