diff --git a/packages/core/src/constants.ts b/packages/core/src/constants.ts index 38475b857ace..90a7ad701d1b 100644 --- a/packages/core/src/constants.ts +++ b/packages/core/src/constants.ts @@ -1 +1,3 @@ export const DEFAULT_ENVIRONMENT = 'production'; + +export const SUPPRESS_TRACING_KEY = '__SENTRY_SUPPRESS_TRACING__'; diff --git a/packages/core/src/scope.ts b/packages/core/src/scope.ts index a302e5a14c34..c1c6e205191e 100644 --- a/packages/core/src/scope.ts +++ b/packages/core/src/scope.ts @@ -1,5 +1,6 @@ /* eslint-disable max-lines */ import type { Client } from './client'; +import type { SUPPRESS_TRACING_KEY } from './constants'; import { updateSession } from './session'; import type { Attachment, @@ -54,7 +55,6 @@ export interface ScopeContext { } export interface SdkProcessingMetadata { - [key: string]: unknown; requestSession?: { status: 'ok' | 'errored' | 'crashed'; }; @@ -64,6 +64,10 @@ export interface SdkProcessingMetadata { capturedSpanIsolationScope?: Scope; spanCountBeforeProcessing?: number; ipAddress?: string; + [SUPPRESS_TRACING_KEY]?: boolean; + // Used by profiling integrations. The profiling integrations refine this type to ensure + // type safety (for ex. see `isProfiledTransactionEvent` function in `@sentry/browser`). + profile?: unknown; } /** diff --git a/packages/core/src/tracing/trace.ts b/packages/core/src/tracing/trace.ts index 00e004a80131..fa548c0149c6 100644 --- a/packages/core/src/tracing/trace.ts +++ b/packages/core/src/tracing/trace.ts @@ -32,8 +32,7 @@ import { SentryNonRecordingSpan } from './sentryNonRecordingSpan'; import { SentrySpan } from './sentrySpan'; import { SPAN_STATUS_ERROR } from './spanstatus'; import { setCapturedScopesOnSpan } from './utils'; - -const SUPPRESS_TRACING_KEY = '__SENTRY_SUPPRESS_TRACING__'; +import { SUPPRESS_TRACING_KEY } from '../constants'; /** * Wraps a function with a transaction/span and finishes the span after the function is done.