Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(node)!: Make dataloader and knex integrations channel-only - #22754

Merged
andreiborza merged 1 commit into
developfrom
ab/dataloader-knex-channel-only
Jul 28, 2026
Merged

feat(node)!: Make dataloader and knex integrations channel-only#22754
andreiborza merged 1 commit into
developfrom
ab/dataloader-knex-channel-only

Conversation

@andreiborza

Copy link
Copy Markdown
Member

What

Removes the vendored OpenTelemetry fallback from the node dataloaderIntegration and knexIntegration. They are now re-exported directly from @sentry/server-utils, matching the other channel-based integrations.

Why

These were the only two integrations still keeping a vendored OTel instrumentation as a runtime fallback (used when diagnostics-channel injection was unavailable). Making them channel-only removes the last vendored DB instrumentation and aligns them with every other integration since channel-based became the default (#22501).

Note: on runtimes without diagnostics-channel injection (e.g. Bun, Deno, older Node, or when injection fails), these integrations no longer produce spans, consistent with the other integrations.

Ref: #22346

Removes the vendored OpenTelemetry fallback from the node `dataloaderIntegration`
and `knexIntegration`, re-exporting the channel-based implementations from
`@sentry/server-utils` directly. Previously these fell back to the vendored OTel
instrumentation on runtimes without diagnostics-channel injection; they are now
channel-only, consistent with the other performance integrations.

Ref: #22346

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@andreiborza
andreiborza requested review from JPeer264 and chargome July 28, 2026 11:17
@andreiborza
andreiborza marked this pull request as ready for review July 28, 2026 11:17
@andreiborza
andreiborza requested a review from a team as a code owner July 28, 2026 11:17
@andreiborza
andreiborza merged commit 8935963 into develop Jul 28, 2026
187 checks passed
@andreiborza
andreiborza deleted the ab/dataloader-knex-channel-only branch July 28, 2026 11:28
mydea added a commit that referenced this pull request Sep 11, 2026
Add `dataloaderIntegration` and `knexIntegration` to `getTracingIntegrations()`
so both are registered by default like every other channel-based integration.

`dataloader` was removed from the defaults in v8 (#13873) due to an upstream
OpenTelemetry bug (#13869) that broke custom DataLoader subclass methods. That
issue is now closed and fixed upstream, and since #22754 the integration is
channel-only — it no longer wraps/replaces the DataLoader class, so the original
breakage mechanism no longer applies. `knex` was never enabled by default.

Drop the now-redundant explicit registration from the node integration-test
instrument files so they exercise the default path.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
mydea added a commit that referenced this pull request Sep 11, 2026
Adds `dataloaderIntegration` and `knexIntegration` to
`getTracingIntegrations()`, so both ship as default tracing integrations
like every other channel-based integration, rather than requiring users
to register them manually.

Both were the only two orchestrion-instrumented integrations that are
publicly exported and have channel definitions but were absent from the
default set. Investigating why surfaced that neither omission is still
justified:

- **`dataloader`** was originally a default (added in #13664) but was
removed in #13873 because of an upstream OpenTelemetry bug (#13869)
where instrumenting DataLoader broke custom subclass methods
(`context.dataloaders.x.loadByInternalId is not a function`). That issue
was fixed upstream
([open-telemetry/opentelemetry-js-contrib#2498](open-telemetry/opentelemetry-js-contrib#2498))
and closed on 2025-08-11, confirmed resolved on v10. On top of that,
since #22754 the integration is channel-only: it instruments via
`diagnostics_channel` and no longer wraps/replaces the `DataLoader`
class, so the mechanism that caused the original breakage no longer
exists. There is no remaining reason to keep it opt-in.
- **`knex`** was never enabled by default — it was introduced (#13526)
purely as an opt-in integration with no accompanying default-list
change. There's no documented reason for it to stay opt-in, and it uses
the same channel mechanism as the other DB integrations that are on by
default.

Users can still disable either via `defaultIntegrations`.

The now-redundant explicit `dataloaderIntegration()` /
`knexIntegration()` registrations are dropped from the node
integration-test instrument files so those suites now exercise the
default-registration path. The dataloader suite passes with no explicit
registration, confirming the default wiring works end-to-end.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants