Skip to content

Commit 3be0687

Browse files
AbhiPrasadcadesalaberry
authored andcommitted
feat(v8/core): Remove getActiveTransaction (getsentry#11280)
ref getsentry#10100 more `getCurrentHub` usages bite the dust.
1 parent c198a5b commit 3be0687

File tree

6 files changed

+2
-27
lines changed

6 files changed

+2
-27
lines changed

MIGRATION.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ To make sure these integrations work properly you'll have to change how you
356356

357357
Removed top-level exports: `tracingOrigins`, `MetricsAggregator`, `metricsAggregatorIntegration`, `Severity`,
358358
`Sentry.configureScope`, `Span`, `spanStatusfromHttpCode`, `makeMain`, `lastEventId`, `pushScope`, `popScope`,
359-
`addGlobalEventProcessor`, `timestampWithMs`, `addExtensionMethods`, `addGlobalEventProcessor`
359+
`addGlobalEventProcessor`, `timestampWithMs`, `addExtensionMethods`, `addGlobalEventProcessor`, `getActiveTransaction`
360360

361361
Removed `@sentry/utils` exports: `timestampWithMs`, `addOrUpdateIntegration`, `tracingContextFromHeaders`, `walk`
362362

packages/browser/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ export {
7070
withActiveSpan,
7171
getSpanDescendants,
7272
setMeasurement,
73-
// eslint-disable-next-line deprecation/deprecation
74-
getActiveTransaction,
7573
getSpanStatusFromHttpCode,
7674
setHttpStatus,
7775
makeMultiplexedTransport,

packages/core/src/tracing/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ export { startIdleSpan, TRACING_DEFAULTS } from './idleSpan';
33
export { SentrySpan } from './sentrySpan';
44
export { SentryNonRecordingSpan } from './sentryNonRecordingSpan';
55
export { Transaction } from './transaction';
6-
// eslint-disable-next-line deprecation/deprecation
7-
export { getActiveTransaction } from './utils';
86
export {
97
setHttpStatus,
108
getSpanStatusFromHttpCode,

packages/core/src/tracing/utils.ts

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,7 @@
1-
import type { Span, Transaction } from '@sentry/types';
1+
import type { Span } from '@sentry/types';
22
import type { Scope } from '@sentry/types';
33
import { addNonEnumerableProperty } from '@sentry/utils';
44

5-
import type { Hub } from '../hub';
6-
import { getCurrentHub } from '../hub';
7-
8-
/**
9-
* Grabs active transaction off scope.
10-
*
11-
* @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.
12-
*/
13-
export function getActiveTransaction<T extends Transaction>(maybeHub?: Hub): T | undefined {
14-
// eslint-disable-next-line deprecation/deprecation
15-
const hub = maybeHub || getCurrentHub();
16-
// eslint-disable-next-line deprecation/deprecation
17-
const scope = hub.getScope();
18-
// eslint-disable-next-line deprecation/deprecation
19-
return scope.getTransaction() as T | undefined;
20-
}
21-
225
// so it can be used in manual instrumentation without necessitating a hard dependency on @sentry/utils
236
export { stripUrlQueryAndFragment } from '@sentry/utils';
247

packages/node/src/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ export {
3131
createTransport,
3232
flush,
3333
// eslint-disable-next-line deprecation/deprecation
34-
getActiveTransaction,
35-
// eslint-disable-next-line deprecation/deprecation
3634
getCurrentHub,
3735
getClient,
3836
isInitialized,

packages/tracing-internal/src/exports/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
export {
2-
// eslint-disable-next-line deprecation/deprecation
3-
getActiveTransaction,
42
hasTracingEnabled,
53
Transaction,
64
} from '@sentry/core';

0 commit comments

Comments
 (0)