@@ -2,6 +2,8 @@ import * as http from 'node:http';
2
2
import * as https from 'node:https' ;
3
3
import { Readable } from 'stream' ;
4
4
import { createGzip } from 'zlib' ;
5
+ import { context } from '@opentelemetry/api' ;
6
+ import { suppressTracing } from '@opentelemetry/core' ;
5
7
import { createTransport } from '@sentry/core' ;
6
8
import type {
7
9
BaseTransportOptions ,
@@ -12,7 +14,6 @@ import type {
12
14
} from '@sentry/types' ;
13
15
import { consoleSandbox } from '@sentry/utils' ;
14
16
import { HttpsProxyAgent } from '../proxy' ;
15
-
16
17
import type { HTTPModule } from './http-module' ;
17
18
18
19
export interface NodeTransportOptions extends BaseTransportOptions {
@@ -80,8 +81,11 @@ export function makeNodeTransport(options: NodeTransportOptions): Transport {
80
81
? ( new HttpsProxyAgent ( proxy ) as http . Agent )
81
82
: new nativeHttpModule . Agent ( { keepAlive, maxSockets : 30 , timeout : 2000 } ) ;
82
83
83
- const requestExecutor = createRequestExecutor ( options , options . httpModule ?? nativeHttpModule , agent ) ;
84
- return createTransport ( options , requestExecutor ) ;
84
+ // This ensures we do not generate any spans in OpenTelemetry for the transport
85
+ return context . with ( suppressTracing ( context . active ( ) ) , ( ) => {
86
+ const requestExecutor = createRequestExecutor ( options , options . httpModule ?? nativeHttpModule , agent ) ;
87
+ return createTransport ( options , requestExecutor ) ;
88
+ } ) ;
85
89
}
86
90
87
91
/**
0 commit comments