Skip to content
Merged
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
3 changes: 2 additions & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,8 @@ Sentry.init({
- The deprecated `honoIntegration` was removed. Use the [`@sentry/hono`](https://www.npmjs.com/package/@sentry/hono) SDK to instrument Hono.
- The `connect` instrumentation was removed.
- The deprecated `prismaInstrumentation` option was removed. It was no longer used, as Prisma works out of the box.
- The deprecated `SentryHttpInstrumentation` export was removed. Use `instrumentHttpOutgoingRequests()` instead.
- The `registerEsmLoaderHooks` option was removed. All instrumentation is now channel-based (via `@sentry/server-utils`), so the SDK no longer registers `import-in-the-middle` ESM loader hooks and the option no longer had any effect.
- The deprecated `SentryHttpInstrumentation` and `SentryNodeFetchInstrumentation` exports were removed. Use `instrumentHttpOutgoingRequests()` and the `nativeNodeFetchIntegration` respectively.
- (Fastify) The deprecated `setShouldHandleError` method was removed.
- (AWS Lambda) The deprecated `disableAwsContextPropagation` option was removed. It no longer had any effect.
- (AWS Lambda) The deprecated `startTrace` option was removed. It no longer had any effect; to disable tracing, set `tracesSampleRate` to `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"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Image

"@sentry/bundler-plugins": "10.67.0"
},
"devDependencies": {
"@types/node": "^18.19.1"
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 @@ -222,32 +219,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.

30 changes: 0 additions & 30 deletions packages/node/src/sdk/esmLoader.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/node/src/sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ import { getEntryPointType } from '../utils/entry-point';
import { getSpotlightConfig } from '../utils/spotlight';
import { defaultStackParser, getSentryRelease } from './api';
import { NodeClient } from './client';
import { initializeEsmLoader } from './esmLoader';
import { initOpenTelemetry } from './initOtel';

/**
Expand Down Expand Up @@ -176,10 +175,6 @@ function _init(

const clientOptions = getClientOptions({ ...options, defaultIntegrations }, getDefaultIntegrationsImpl);

if (clientOptions.registerEsmLoaderHooks !== false) {
Comment thread
andreiborza marked this conversation as resolved.
initializeEsmLoader();
}

setOpenTelemetryContextAsyncContextStrategy(clientOptions);

const scope = getCurrentScope();
Expand Down
Loading
Loading