feat(nestjs)!: Remove import-in-the-middle instrumentation - #22805
Open
andreiborza wants to merge 6 commits into
Open
feat(nestjs)!: Remove import-in-the-middle instrumentation#22805andreiborza wants to merge 6 commits into
andreiborza wants to merge 6 commits into
Conversation
Migrate `@sentry/nestjs` fully to channel-based instrumentation and drop the OpenTelemetry `InstrumentationBase` module patchers, so the package no longer relies on the import-in-the-middle ESM loader hook. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
andreiborza
commented
Jul 29, 2026
Comment on lines
+73
to
+91
| const base = 'auto.middleware.orchestrion.nestjs'; | ||
| return componentType ? `${base}.${componentType}` : base; | ||
| } | ||
|
|
||
| /** | ||
| * Origin for the app-creation / request-context / request-handler HTTP spans. | ||
| */ | ||
| export function httpOrigin(): string { | ||
| return isOrchestrionInjected() ? 'auto.http.orchestrion.nestjs' : 'auto.http.otel.nestjs'; | ||
| return 'auto.http.orchestrion.nestjs'; | ||
| } | ||
|
|
||
| /** Origin for `@OnEvent` spans. */ | ||
| function eventOrigin(): string { | ||
| return isOrchestrionInjected() ? 'auto.event.orchestrion.nestjs' : 'auto.event.nestjs'; | ||
| return 'auto.event.orchestrion.nestjs'; | ||
| } | ||
|
|
||
| /** Origin for BullMQ `@Processor` `process` spans. */ | ||
| function bullmqOrigin(): string { | ||
| return isOrchestrionInjected() ? 'auto.queue.orchestrion.nestjs.bullmq' : 'auto.queue.nestjs.bullmq'; | ||
| return 'auto.queue.orchestrion.nestjs.bullmq'; |
Member
Author
There was a problem hiding this comment.
I left them as .orchestrion. because Isaac's PR is removing these.
Member
Author
|
batman begin |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit c88c430. Configure here.
andreiborza
marked this pull request as ready for review
July 29, 2026 10:25
andreiborza
requested review from
JPeer264,
nicohrubec and
s1gr1d
and removed request for
a team and
s1gr1d
July 29, 2026 10:25
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.
What
Migrate
@sentry/nestjsfully to channel-based instrumentation.nestIntegration, removing the OpenTelemetryInstrumentationBasefallback.SentryNest*Instrumentationclasses.wrap-route.ts) and drop the now-emptyvendored/tree.@opentelemetry/instrumentationand@opentelemetry/apidependencies.Why
Channel-based instrumentation is the default in v11 and node no longer registers the import-in-the-middle ESM loader hook. The OTel path in NestJS was already unreachable at runtime, so removing it drops dead code and two unused OpenTelemetry dependencies.
Closes: #22773