diff --git a/packages/remix/src/index.server.ts b/packages/remix/src/index.server.ts index 7ab6efb15827..18789d6bc86b 100644 --- a/packages/remix/src/index.server.ts +++ b/packages/remix/src/index.server.ts @@ -6,7 +6,6 @@ import { logger } from '@sentry/utils'; import { DEBUG_BUILD } from './utils/debug-build'; import { instrumentServer } from './utils/instrumentServer'; -import { httpIntegration } from './utils/integrations/http'; import { remixIntegration } from './utils/integrations/opentelemetry'; import type { RemixOptions } from './utils/remixOptions'; @@ -153,8 +152,7 @@ export type { SentryMetaArgs } from './utils/types'; */ export function getRemixDefaultIntegrations(options: RemixOptions): Integration[] { return [ - ...getDefaultNodeIntegrations(options as NodeOptions).filter(integration => integration.name !== 'Http'), - httpIntegration(), + ...getDefaultNodeIntegrations(options as NodeOptions), options.autoInstrumentRemix ? remixIntegration() : undefined, ].filter(int => int) as Integration[]; } diff --git a/packages/remix/src/utils/integrations/http.ts b/packages/remix/src/utils/integrations/http.ts deleted file mode 100644 index d3a7ae03e351..000000000000 --- a/packages/remix/src/utils/integrations/http.ts +++ /dev/null @@ -1,30 +0,0 @@ -// This integration is ported from the Next.JS SDK. -import { HttpInstrumentation } from '@opentelemetry/instrumentation-http'; -import { httpIntegration as originalHttpIntegration } from '@sentry/node'; -import type { IntegrationFn } from '@sentry/types'; - -class RemixHttpIntegration extends HttpInstrumentation { - // Instead of the default behavior, we just don't do any wrapping for incoming requests - protected _getPatchIncomingRequestFunction(_component: 'http' | 'https') { - return ( - original: (event: string, ...args: unknown[]) => boolean, - ): ((this: unknown, event: string, ...args: unknown[]) => boolean) => { - return function incomingRequest(this: unknown, event: string, ...args: unknown[]): boolean { - return original.apply(this, [event, ...args]); - }; - }; - } -} - -type HttpOptions = Parameters[0]; - -/** - * The http integration instruments Node's internal http and https modules. - * It creates breadcrumbs and spans for outgoing HTTP requests which will be attached to the currently active span. - */ -export const httpIntegration = ((options: HttpOptions = {}) => { - return originalHttpIntegration({ - ...options, - _instrumentation: RemixHttpIntegration, - }); -}) satisfies IntegrationFn;