Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Work in this release was contributed by @psh4607, @trinitiwowka, @nehaprasad-dev
- `DenoMongoose` => `Mongoose`
- `DenoMysql` => `Mysql`
- `DenoPostgres` => `Postgres`
- feat(node)!: Remove `import-in-the-middle`-based instrumentations from `@sentry/node`. All performance integrations are now channel-based via `@sentry/server-utils`. As part of this:
- The `registerEsmLoaderHooks` option was removed from `NodeOptions`. The SDK no longer registers `import-in-the-middle` ESM loader hooks, and `import-in-the-middle` is no longer a dependency.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing migration note for option

Medium Severity

Removing the public registerEsmLoaderHooks option from NodeOptions is a breaking API change. It is called out in the changelog, but MIGRATION.md’s @sentry/node removals section does not mention it, unlike other public removals in that guide. Flagged because the review rules require proper notices for public API removals.

Fix in Cursor Fix in Web

Triggered by project rule: PR Review Guidelines for Cursor Bot

Reviewed by Cursor Bugbot for commit b988ec5. Configure here.

- `knexIntegration` and `dataloaderIntegration` are now channel-only and no longer fall back to OpenTelemetry instrumentation on runtimes without diagnostics-channel injection.
- Support for Fastify `<3.21.0` was dropped.

## 10.67.0

Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 1 addition & 2 deletions packages/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@
"@sentry/core": "10.67.0",
"@sentry/opentelemetry": "10.67.0",
"@sentry/server-utils": "10.67.0",
"@sentry/bundler-plugins": "10.67.0",
"import-in-the-middle": "^3.0.0"
"@sentry/bundler-plugins": "10.67.0"
},
"devDependencies": {
"@types/node": "^18.19.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ export { fastifyIntegration, setupFastifyErrorHandler } from './integrations/tra
export {
amqplibIntegration,
anthropicIntegration as anthropicAIIntegration,
dataloaderIntegration,
expressIntegration,
firebaseIntegration,
genericPoolIntegration,
googleGenAIIntegration,
graphqlDiagnosticsIntegration as graphqlIntegration,
hapiIntegration,
kafkajsIntegration as kafkaIntegration,
knexIntegration,
koaIntegration,
langChainIntegration,
langGraphIntegration,
Expand All @@ -31,8 +33,6 @@ export { redisIntegration } from './integrations/tracing/redis';
export { prismaIntegration } from '@sentry/server-utils';
export { setupHapiErrorHandler } from './integrations/tracing/hapi';
export { setupKoaErrorHandler } from './integrations/tracing/koa';
export { knexIntegration } from './integrations/tracing/knex';
export { dataloaderIntegration } from './integrations/tracing/dataloader';
export {
launchDarklyIntegration,
buildLaunchDarklyFlagUsedHandler,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@ import type { ChannelListener } from 'node:diagnostics_channel';
import { subscribe, unsubscribe } from 'node:diagnostics_channel';
import { context, trace } from '@opentelemetry/api';
import type { InstrumentationConfig } from '@opentelemetry/instrumentation';
import { InstrumentationBase } from '@opentelemetry/instrumentation';
import type { ClientRequest, IncomingMessage, ServerResponse } from 'node:http';
import type { HttpClientRequest, HttpIncomingMessage, HttpInstrumentationOptions, Span } from '@sentry/core';
import {
getHttpClientSubscriptions,
patchHttpModuleClient,
SDK_VERSION,
getRequestOptions,
isTracingSuppressed,
} from '@sentry/core';
import { INSTRUMENTATION_NAME } from './constants';
import { HTTP_ON_CLIENT_REQUEST } from '@sentry/core';
import { NODE_VERSION } from '../../nodeVersion';
import { errorMonitor } from 'node:events';
Expand Down Expand Up @@ -224,32 +221,3 @@ function instrumentHttpOutgoingRequestsViaMonkeyPatching(options: HttpInstrument
// Patching http also patches https, as this uses the same underlying object
patchHttpModuleClient(http, options);
}

/**
* This custom HTTP instrumentation handles outgoing HTTP requests.
*
* It provides:
* - Breadcrumbs for all outgoing requests
* - Trace propagation headers (when enabled)
* - Span creation for outgoing requests (when createSpansForOutgoingRequests is enabled)
*
* Span creation requires Node 22+ and uses diagnostic channels to avoid monkey-patching.
* By default, this is only enabled in the node SDK, not in other runtime SDKs that reuse this instrumentation.
*
* Important note: Contrary to other OTEL instrumentation, this one cannot be unwrapped.
*
* This is heavily inspired & adapted from:
* https://github.com/open-telemetry/opentelemetry-js/blob/f8ab5592ddea5cba0a3b33bf8d74f27872c0367f/experimental/packages/opentelemetry-instrumentation-http/src/http.ts
*
* @deprecated This will be removed in v11. Use instrumentHttpOutgoingRequests() instead.
*/
export class SentryHttpInstrumentation extends InstrumentationBase<SentryHttpInstrumentationOptions> {
public constructor(config: SentryHttpInstrumentationOptions = {}) {
super(INSTRUMENTATION_NAME, SDK_VERSION, config);
}

/** @inheritdoc */
public init(): void {
instrumentHttpOutgoingRequests(this.getConfig());
}
}
1 change: 0 additions & 1 deletion packages/node/src/integrations/http/constants.ts

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions packages/node/src/integrations/tracing/amqplib/index.ts

This file was deleted.

Loading
Loading