Skip to content

Commit 288d9e9

Browse files
authored
feat(v8): Remove deprecated traceHeaders method (#10776)
1 parent 40300ea commit 288d9e9

File tree

5 files changed

+0
-43
lines changed

5 files changed

+0
-43
lines changed

packages/core/src/hub.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -478,14 +478,6 @@ Sentry.init({...});
478478
return result;
479479
}
480480

481-
/**
482-
* @inheritDoc
483-
* @deprecated Use `spanToTraceHeader()` instead.
484-
*/
485-
public traceHeaders(): { [key: string]: string } {
486-
return this._callExtensionMethod<{ [key: string]: string }>('traceHeaders');
487-
}
488-
489481
/**
490482
* @inheritDoc
491483
*

packages/core/src/tracing/hubextensions.ts

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,11 @@ import { logger } from '@sentry/utils';
33
import { getMainCarrier } from '../asyncContext';
44

55
import { DEBUG_BUILD } from '../debug-build';
6-
import { spanToTraceHeader } from '../utils/spanUtils';
76
import { registerErrorInstrumentation } from './errors';
87
import { IdleTransaction } from './idletransaction';
98
import { sampleTransaction } from './sampling';
109
import { Transaction } from './transaction';
1110

12-
/** Returns all trace headers that are currently on the top scope. */
13-
function traceHeaders(this: Hub): { [key: string]: string } {
14-
// eslint-disable-next-line deprecation/deprecation
15-
const scope = this.getScope();
16-
// eslint-disable-next-line deprecation/deprecation
17-
const span = scope.getSpan();
18-
19-
return span
20-
? {
21-
'sentry-trace': spanToTraceHeader(span),
22-
}
23-
: {};
24-
}
25-
2611
/**
2712
* Creates a new transaction and adds a sampling decision if it doesn't yet have one.
2813
*
@@ -142,9 +127,6 @@ export function addTracingExtensions(): void {
142127
if (!carrier.__SENTRY__.extensions.startTransaction) {
143128
carrier.__SENTRY__.extensions.startTransaction = _startTransaction;
144129
}
145-
if (!carrier.__SENTRY__.extensions.traceHeaders) {
146-
carrier.__SENTRY__.extensions.traceHeaders = traceHeaders;
147-
}
148130

149131
registerErrorInstrumentation();
150132
}

packages/node-experimental/src/sdk/hub.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626
withScope,
2727
} from '@sentry/core';
2828
import { getClient } from './api';
29-
import { callExtensionMethod } from './globals';
3029

3130
/**
3231
* 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 {
7776
return getClient().getIntegration(integration);
7877
},
7978

80-
traceHeaders(): { [key: string]: string } {
81-
return callExtensionMethod<{ [key: string]: string }>(this, 'traceHeaders');
82-
},
83-
8479
startTransaction(
8580
_context: TransactionContext,
8681
_customSamplingContext?: CustomSamplingContext,

packages/opentelemetry/src/custom/getCurrentHub.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,6 @@ export function getCurrentHub(): Hub {
7676
return getClient()?.getIntegration(integration) || null;
7777
},
7878

79-
traceHeaders(): { [key: string]: string } {
80-
// TODO: Do we need this??
81-
return {};
82-
},
83-
8479
startTransaction(
8580
_context: TransactionContext,
8681
_customSamplingContext?: CustomSamplingContext,

packages/types/src/hub.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,6 @@ export interface Hub {
204204
*/
205205
getIntegration<T extends Integration>(integration: IntegrationClass<T>): T | null;
206206

207-
/**
208-
* Returns all trace headers that are currently on the top scope.
209-
*
210-
* @deprecated Use `spanToTraceHeader()` instead.
211-
*/
212-
traceHeaders(): { [key: string]: string };
213-
214207
/**
215208
* Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.
216209
*

0 commit comments

Comments
 (0)