diff --git a/packages/core/src/hub.ts b/packages/core/src/hub.ts index 0fa6d239a26f..abfb22b612b3 100644 --- a/packages/core/src/hub.ts +++ b/packages/core/src/hub.ts @@ -478,14 +478,6 @@ Sentry.init({...}); return result; } - /** - * @inheritDoc - * @deprecated Use `spanToTraceHeader()` instead. - */ - public traceHeaders(): { [key: string]: string } { - return this._callExtensionMethod<{ [key: string]: string }>('traceHeaders'); - } - /** * @inheritDoc * diff --git a/packages/core/src/tracing/hubextensions.ts b/packages/core/src/tracing/hubextensions.ts index 9d789d2d2620..6172d32b23a7 100644 --- a/packages/core/src/tracing/hubextensions.ts +++ b/packages/core/src/tracing/hubextensions.ts @@ -3,26 +3,11 @@ import { logger } from '@sentry/utils'; import { getMainCarrier } from '../asyncContext'; import { DEBUG_BUILD } from '../debug-build'; -import { spanToTraceHeader } from '../utils/spanUtils'; import { registerErrorInstrumentation } from './errors'; import { IdleTransaction } from './idletransaction'; import { sampleTransaction } from './sampling'; import { Transaction } from './transaction'; -/** Returns all trace headers that are currently on the top scope. */ -function traceHeaders(this: Hub): { [key: string]: string } { - // eslint-disable-next-line deprecation/deprecation - const scope = this.getScope(); - // eslint-disable-next-line deprecation/deprecation - const span = scope.getSpan(); - - return span - ? { - 'sentry-trace': spanToTraceHeader(span), - } - : {}; -} - /** * Creates a new transaction and adds a sampling decision if it doesn't yet have one. * @@ -142,9 +127,6 @@ export function addTracingExtensions(): void { if (!carrier.__SENTRY__.extensions.startTransaction) { carrier.__SENTRY__.extensions.startTransaction = _startTransaction; } - if (!carrier.__SENTRY__.extensions.traceHeaders) { - carrier.__SENTRY__.extensions.traceHeaders = traceHeaders; - } registerErrorInstrumentation(); } diff --git a/packages/node-experimental/src/sdk/hub.ts b/packages/node-experimental/src/sdk/hub.ts index 4de88d4788c7..42a7c8c7ea22 100644 --- a/packages/node-experimental/src/sdk/hub.ts +++ b/packages/node-experimental/src/sdk/hub.ts @@ -26,7 +26,6 @@ import { withScope, } from '@sentry/core'; import { getClient } from './api'; -import { callExtensionMethod } from './globals'; /** * This is for legacy reasons, and returns a proxy object instead of a hub to be used. @@ -77,10 +76,6 @@ export function getCurrentHub(): Hub { return getClient().getIntegration(integration); }, - traceHeaders(): { [key: string]: string } { - return callExtensionMethod<{ [key: string]: string }>(this, 'traceHeaders'); - }, - startTransaction( _context: TransactionContext, _customSamplingContext?: CustomSamplingContext, diff --git a/packages/opentelemetry/src/custom/getCurrentHub.ts b/packages/opentelemetry/src/custom/getCurrentHub.ts index 5df6e1e1d36f..36699561aa99 100644 --- a/packages/opentelemetry/src/custom/getCurrentHub.ts +++ b/packages/opentelemetry/src/custom/getCurrentHub.ts @@ -76,11 +76,6 @@ export function getCurrentHub(): Hub { return getClient()?.getIntegration(integration) || null; }, - traceHeaders(): { [key: string]: string } { - // TODO: Do we need this?? - return {}; - }, - startTransaction( _context: TransactionContext, _customSamplingContext?: CustomSamplingContext, diff --git a/packages/types/src/hub.ts b/packages/types/src/hub.ts index 7eec8d42b91a..e0864d461c72 100644 --- a/packages/types/src/hub.ts +++ b/packages/types/src/hub.ts @@ -204,13 +204,6 @@ export interface Hub { */ getIntegration(integration: IntegrationClass): T | null; - /** - * Returns all trace headers that are currently on the top scope. - * - * @deprecated Use `spanToTraceHeader()` instead. - */ - traceHeaders(): { [key: string]: string }; - /** * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation. *