Skip to content
Draft
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
8 changes: 7 additions & 1 deletion packages/browser/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import { makeFetchTransport } from './transports/fetch';
import { normalizeStringifyValue } from './normalizeStringifyValue';
import { checkAndWarnIfIsEmbeddedBrowserExtension } from './utils/detectBrowserExtension';

declare const __SENTRY_TRACING__: boolean;

/** Get the default integrations for the browser SDK. */
export function getDefaultIntegrations(_options: Options): Integration[] {
/**
Expand Down Expand Up @@ -116,7 +118,11 @@ export function init(options: BrowserOptions = {}): Client | undefined {
defaultIntegrations,
});

if (options.traceLifecycle !== 'static' && !integrations.some(integration => integration.name === 'SpanStreaming')) {
if (
(typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) &&
options.traceLifecycle !== 'static' &&
!integrations.some(integration => integration.name === 'SpanStreaming')
) {
integrations.push(spanStreamingIntegration());
}

Expand Down
8 changes: 7 additions & 1 deletion packages/core/src/server-runtime-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export interface ServerRuntimeClientOptions extends ClientOptions<BaseTransportO
serverName?: string;
}

declare const __SENTRY_TRACING__: boolean;

/**
* The Sentry Server Runtime Client SDK.
*/
Expand All @@ -43,7 +45,11 @@ export class ServerRuntimeClient<
// When span streaming is enabled (`traceLifecycle: 'stream'`), the `spanStreamingIntegration`
// is required to flush spans. We add it here so the individual server SDKs don't have to.
// A user-provided `spanStreamingIntegration` always takes precedence over the one we add.
if (options.traceLifecycle !== 'static' && !options.integrations.some(i => i.name === 'SpanStreaming')) {
if (
(typeof __SENTRY_TRACING__ === 'undefined' || __SENTRY_TRACING__) &&
options.traceLifecycle !== 'static' &&
!options.integrations.some(i => i.name === 'SpanStreaming')
) {
options.integrations.push(spanStreamingIntegration());
}

Expand Down
Loading