Skip to content

Commit 338d17c

Browse files
committed
avoid filter out tracing
1 parent 6c01021 commit 338d17c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/node-core/src/integrations/http/incoming-requests.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ import { DEBUG_BUILD } from '../../debug-build';
3636
import type { NodeClient } from '../../sdk/client';
3737
import { INSTRUMENTATION_NAME, MAX_BODY_BYTE_LENGTH } from './constants';
3838

39+
// Tree-shakable guard to remove all code related to tracing
40+
declare const __SENTRY_TRACING__: boolean;
41+
3942
type ServerEmit = typeof Server.prototype.emit;
4043

4144
const HTTP_SERVER_INSTRUMENTED_KEY = createContextKey('sentry_http_server_instrumented');
@@ -164,6 +167,7 @@ export function instrumentServer(
164167
return context.with(ctx, () => {
165168
// if opting out of span creation, we can end here
166169
if (
170+
(typeof __SENTRY_TRACING__ !== 'undefined' && !__SENTRY_TRACING__) ||
167171
!spans ||
168172
!client ||
169173
shouldIgnoreSpansForIncomingRequest(request, {

0 commit comments

Comments
 (0)