Skip to content
Merged
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
10 changes: 7 additions & 3 deletions packages/node-experimental/src/transports/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import * as http from 'node:http';
import * as https from 'node:https';
import { Readable } from 'stream';
import { createGzip } from 'zlib';
import { context } from '@opentelemetry/api';
import { suppressTracing } from '@opentelemetry/core';
import { createTransport } from '@sentry/core';
import type {
BaseTransportOptions,
Expand All @@ -12,7 +14,6 @@ import type {
} from '@sentry/types';
import { consoleSandbox } from '@sentry/utils';
import { HttpsProxyAgent } from '../proxy';

import type { HTTPModule } from './http-module';

export interface NodeTransportOptions extends BaseTransportOptions {
Expand Down Expand Up @@ -80,8 +81,11 @@ export function makeNodeTransport(options: NodeTransportOptions): Transport {
? (new HttpsProxyAgent(proxy) as http.Agent)
: new nativeHttpModule.Agent({ keepAlive, maxSockets: 30, timeout: 2000 });

const requestExecutor = createRequestExecutor(options, options.httpModule ?? nativeHttpModule, agent);
return createTransport(options, requestExecutor);
// This ensures we do not generate any spans in OpenTelemetry for the transport
return context.with(suppressTracing(context.active()), () => {
const requestExecutor = createRequestExecutor(options, options.httpModule ?? nativeHttpModule, agent);
return createTransport(options, requestExecutor);
});
}

/**
Expand Down