11import type {
22 Context ,
33 Contexts ,
4- DynamicSamplingContext ,
54 Hub ,
65 MeasurementUnit ,
76 Measurements ,
@@ -10,15 +9,14 @@ import type {
109 Transaction as TransactionInterface ,
1110 TransactionArguments ,
1211 TransactionEvent ,
13- TransactionMetadata ,
1412 TransactionSource ,
1513} from '@sentry/types' ;
1614import { dropUndefinedKeys , logger } from '@sentry/utils' ;
1715
1816import { DEBUG_BUILD } from '../debug-build' ;
1917import { getCurrentHub } from '../hub' ;
2018import { getMetricSummaryJsonForSpan } from '../metrics/metric-summary' ;
21- import { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE , SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes' ;
19+ import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes' ;
2220import { getSpanDescendants , spanTimeInputToSeconds , spanToJSON , spanToTraceContext } from '../utils/spanUtils' ;
2321import { getDynamicSamplingContextFromSpan } from './dynamicSamplingContext' ;
2422import { SentrySpan } from './sentrySpan' ;
@@ -39,11 +37,6 @@ export class Transaction extends SentrySpan implements TransactionInterface {
3937
4038 private _trimEnd ?: boolean | undefined ;
4139
42- // DO NOT yet remove this property, it is used in a hack for v7 backwards compatibility.
43- private _frozenDynamicSamplingContext : Readonly < Partial < DynamicSamplingContext > > | undefined ;
44-
45- private _metadata : Partial < TransactionMetadata > ;
46-
4740 /**
4841 * This constructor should never be called manually.
4942 * @internal
@@ -62,11 +55,6 @@ export class Transaction extends SentrySpan implements TransactionInterface {
6255
6356 this . _name = transactionContext . name || '' ;
6457
65- this . _metadata = {
66- // eslint-disable-next-line deprecation/deprecation
67- ...transactionContext . metadata ,
68- } ;
69-
7058 this . _trimEnd = transactionContext . trimEnd ;
7159
7260 this . _attributes = {
@@ -78,45 +66,8 @@ export class Transaction extends SentrySpan implements TransactionInterface {
7866 // TODO (v8): Replace this with another way to set the root span
7967 // eslint-disable-next-line deprecation/deprecation
8068 this . transaction = this ;
81-
82- // If Dynamic Sampling Context is provided during the creation of the transaction, we freeze it as it usually means
83- // there is incoming Dynamic Sampling Context. (Either through an incoming request, a baggage meta-tag, or other means)
84- const incomingDynamicSamplingContext = this . _metadata . dynamicSamplingContext ;
85- if ( incomingDynamicSamplingContext ) {
86- // We shallow copy this in case anything writes to the original reference of the passed in `dynamicSamplingContext`
87- this . _frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext } ;
88- }
89- }
90-
91- // This sadly conflicts with the getter/setter ordering :(
92-
93- /**
94- * Get the metadata for this transaction.
95- * @deprecated Use `spanGetMetadata(transaction)` instead.
96- */
97- public get metadata ( ) : TransactionMetadata {
98- // We merge attributes in for backwards compatibility
99- return {
100- // Legacy metadata
101- ...this . _metadata ,
102-
103- // From attributes
104- ...( this . _attributes [ SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE ] && {
105- sampleRate : this . _attributes [ SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE ] as TransactionMetadata [ 'sampleRate' ] ,
106- } ) ,
107- } ;
108- }
109-
110- /**
111- * Update the metadata for this transaction.
112- * @deprecated Use `spanGetMetadata(transaction)` instead.
113- */
114- public set metadata ( metadata : TransactionMetadata ) {
115- this . _metadata = metadata ;
11669 }
11770
118- /* eslint-enable @typescript-eslint/member-ordering */
119-
12071 /** @inheritdoc */
12172 public updateName ( name : string ) : this {
12273 this . _name = name ;
@@ -146,14 +97,6 @@ export class Transaction extends SentrySpan implements TransactionInterface {
14697 this . _measurements [ name ] = { value, unit } ;
14798 }
14899
149- /**
150- * Store metadata on this transaction.
151- * @deprecated Use attributes or store data on the scope instead.
152- */
153- public setMetadata ( newMetadata : Partial < TransactionMetadata > ) : void {
154- this . _metadata = { ...this . _metadata , ...newMetadata } ;
155- }
156-
157100 /**
158101 * @inheritDoc
159102 */
@@ -181,17 +124,6 @@ export class Transaction extends SentrySpan implements TransactionInterface {
181124 } ) ;
182125 }
183126
184- /**
185- * @inheritdoc
186- *
187- * @experimental
188- *
189- * @deprecated Use top-level `getDynamicSamplingContextFromSpan` instead.
190- */
191- public getDynamicSamplingContext ( ) : Readonly < Partial < DynamicSamplingContext > > {
192- return getDynamicSamplingContextFromSpan ( this ) ;
193- }
194-
195127 /**
196128 * Override the current hub with a new one.
197129 * Used if you want another hub to finish the transaction.
@@ -252,9 +184,6 @@ export class Transaction extends SentrySpan implements TransactionInterface {
252184
253185 const { scope : capturedSpanScope , isolationScope : capturedSpanIsolationScope } = getCapturedScopesOnSpan ( this ) ;
254186
255- // eslint-disable-next-line deprecation/deprecation
256- const { metadata } = this ;
257-
258187 const source = this . _attributes [ 'sentry.source' ] as TransactionSource | undefined ;
259188
260189 const transaction : TransactionEvent = {
@@ -269,7 +198,6 @@ export class Transaction extends SentrySpan implements TransactionInterface {
269198 transaction : this . _name ,
270199 type : 'transaction' ,
271200 sdkProcessingMetadata : {
272- ...metadata ,
273201 capturedSpanScope,
274202 capturedSpanIsolationScope,
275203 ...dropUndefinedKeys ( {
0 commit comments