feat(nestjs): add orchestrion integration#21796
Closed
isaacs wants to merge 18 commits into
Closed
Conversation
11c284e to
7fafc68
Compare
7fafc68 to
3277391
Compare
Contributor
size-limit report 📦
|
df77d10 to
d1299b8
Compare
aa02081 to
f0ed876
Compare
nicohrubec
reviewed
Jul 6, 2026
f0ed876 to
6c8af12
Compare
8c0e65e to
c1a0de0
Compare
46283e9 to
99bea1b
Compare
Contributor
|
👋 @mydea, @JPeer264, @andreiborza — Please review this PR when you get a chance! |
Member
|
@isaacs this is a bit difficult to review and to keep everything in context. Could we maybe split this up into a stacked PR? |
f030443 to
047d579
Compare
Not yet wired into the NestJS SDK, but the initial channels and span creation logic in place.
Port the entire vendored OTel core `instrumentation-nestjs-core` functionality. Still remaining are the 4 Sentry decorator instrumentations and then wiring up the final `experimentalUseDiagnosticsChannelIntegration()` piece with `replacedOtelIntegrationNames: ['Nest']` in the Node SDK, and an E2E test to verify that it matches the OTel functionality.
Port the @Injectable and @catch decorators, so that the entire NestJS OTel instrumentation is ported to Sentry Orchestrion implementation. Not yet wired up into the `experimentalUseDiagnosticsChannelInjection`, so still dormant at this stage. Pieces to come in following commits: - schedule (@Cron/@Interval/@timeout): error capture + isolation scope, no spans created - event (@onevent), bullmq (@processor): all the same astQuery inner-arrow-function pattern. - Final wire-in: add `experimentalUseDiagnosticsChannelInjection` + `replacedOtelIntegrationNames: ['Nest']` + opt-in e2e diffing against the OTel baseline.
Connect the `@Cron`/`@interval`/`@Timeout` (schedule), `@OnEvent` (event), and `@Processor` (bullmq) instrumentations in the orchestrion implementation. At this point, it's still not wired up by default into the SDK, but all of the functionality is there. Next step is the final wire-up and opt-in to swap out the OTel NestJS for this Orchestrion implementation.
Add `'Nest'` to the set of integrations that are implemented using Orchestrion, and which override a prior OTel based integration. The integration swap is moved into the `_init` method in the Node SDK, because the NestJS SDK (and other framework SDKs) will pass in its own defaultIntegrations array, which would bypass the old swap location. Now the swap is uniform for every framework SDK based on Node init, and respects `defaultIntegrations: false`. A new unit test is added that proves the opt-out leaves the defaults untouched, and opt-in replaces the named OTel integration with channel integrations.
…ver-utils Introduce a dependency-injection approach to setting orchestrion configuration from a standalone SDK that is not a part of the "normal" tracing integrations reasonable to put in server-utils. This also allows for better DRY sharing of reusable components between the OTel and Orchestrion implementations of the NestJS integration. The major change is that certain items like the list of Orchestrion instrumentations, need to be fetched on demand with a method, rather than being a static `as const` array. Dependency cycle is still avoided, but all NestJS code is now in packages/nest where it belongs.
93be985 to
9eec1cc
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b34d60e. Configure here.
Member
Author
|
@andreiborza Yeah, that's fair. I'm going to supersede this with a stack of PRs to do the following, more or less the exact reverse of what's going on in this one:
Closing this in favor of that approach. |
auto-merge was automatically disabled
July 8, 2026 23:09
Pull request was closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Add
'Nest'to the set of integrations that are implemented using Orchestrion, and which override a prior OTel based integration.This is a port of the entire vendored OTel NestJS functionality to orchestrion-injected diagnostics channels.
The integration swap is moved into the
_initmethod in the Node SDK, because the NestJS SDK (and other framework SDKs) will pass in its own defaultIntegrations array, which would bypass the old swap location. Now the swap is uniform for every framework SDK based on Node init, and respectsdefaultIntegrations: false.Fix: JS-2519
Fix: #20947