11import type {
22 Contexts ,
3- DynamicSamplingContext ,
43 Hub ,
54 MeasurementUnit ,
65 Measurements ,
@@ -9,15 +8,14 @@ import type {
98 Transaction as TransactionInterface ,
109 TransactionArguments ,
1110 TransactionEvent ,
12- TransactionMetadata ,
1311 TransactionSource ,
1412} from '@sentry/types' ;
1513import { dropUndefinedKeys , logger } from '@sentry/utils' ;
1614
1715import { DEBUG_BUILD } from '../debug-build' ;
1816import { getCurrentHub } from '../hub' ;
1917import { getMetricSummaryJsonForSpan } from '../metrics/metric-summary' ;
20- import { SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE , SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes' ;
18+ import { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '../semanticAttributes' ;
2119import { getSpanDescendants , spanTimeInputToSeconds , spanToJSON , spanToTraceContext } from '../utils/spanUtils' ;
2220import { getDynamicSamplingContextFromSpan } from './dynamicSamplingContext' ;
2321import { SentrySpan } from './sentrySpan' ;
@@ -38,11 +36,6 @@ export class Transaction extends SentrySpan implements TransactionInterface {
3836
3937 private _trimEnd ?: boolean | undefined ;
4038
41- // DO NOT yet remove this property, it is used in a hack for v7 backwards compatibility.
42- private _frozenDynamicSamplingContext : Readonly < Partial < DynamicSamplingContext > > | undefined ;
43-
44- private _metadata : Partial < TransactionMetadata > ;
45-
4639 /**
4740 * This constructor should never be called manually.
4841 * @internal
@@ -61,56 +54,14 @@ export class Transaction extends SentrySpan implements TransactionInterface {
6154
6255 this . _name = transactionContext . name || '' ;
6356
64- this . _metadata = {
65- // eslint-disable-next-line deprecation/deprecation
66- ...transactionContext . metadata ,
67- } ;
68-
6957 this . _trimEnd = transactionContext . trimEnd ;
7058
7159 this . _attributes = {
7260 [ SEMANTIC_ATTRIBUTE_SENTRY_SOURCE ] : 'custom' ,
7361 ...this . _attributes ,
7462 } ;
75-
76- // If Dynamic Sampling Context is provided during the creation of the transaction, we freeze it as it usually means
77- // there is incoming Dynamic Sampling Context. (Either through an incoming request, a baggage meta-tag, or other means)
78- const incomingDynamicSamplingContext = this . _metadata . dynamicSamplingContext ;
79- if ( incomingDynamicSamplingContext ) {
80- // We shallow copy this in case anything writes to the original reference of the passed in `dynamicSamplingContext`
81- this . _frozenDynamicSamplingContext = { ...incomingDynamicSamplingContext } ;
82- }
83- }
84-
85- // This sadly conflicts with the getter/setter ordering :(
86-
87- /**
88- * Get the metadata for this transaction.
89- * @deprecated Use `spanGetMetadata(transaction)` instead.
90- */
91- public get metadata ( ) : TransactionMetadata {
92- // We merge attributes in for backwards compatibility
93- return {
94- // Legacy metadata
95- ...this . _metadata ,
96-
97- // From attributes
98- ...( this . _attributes [ SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE ] && {
99- sampleRate : this . _attributes [ SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE ] as TransactionMetadata [ 'sampleRate' ] ,
100- } ) ,
101- } ;
102- }
103-
104- /**
105- * Update the metadata for this transaction.
106- * @deprecated Use `spanGetMetadata(transaction)` instead.
107- */
108- public set metadata ( metadata : TransactionMetadata ) {
109- this . _metadata = metadata ;
11063 }
11164
112- /* eslint-enable @typescript-eslint/member-ordering */
113-
11465 /** @inheritdoc */
11566 public updateName ( name : string ) : this {
11667 this . _name = name ;
@@ -127,14 +78,6 @@ export class Transaction extends SentrySpan implements TransactionInterface {
12778 this . _measurements [ name ] = { value, unit } ;
12879 }
12980
130- /**
131- * Store metadata on this transaction.
132- * @deprecated Use attributes or store data on the scope instead.
133- */
134- public setMetadata ( newMetadata : Partial < TransactionMetadata > ) : void {
135- this . _metadata = { ...this . _metadata , ...newMetadata } ;
136- }
137-
13881 /**
13982 * @inheritDoc
14083 */
@@ -198,9 +141,6 @@ export class Transaction extends SentrySpan implements TransactionInterface {
198141
199142 const { scope : capturedSpanScope , isolationScope : capturedSpanIsolationScope } = getCapturedScopesOnSpan ( this ) ;
200143
201- // eslint-disable-next-line deprecation/deprecation
202- const { metadata } = this ;
203-
204144 const source = this . _attributes [ 'sentry.source' ] as TransactionSource | undefined ;
205145
206146 const transaction : TransactionEvent = {
@@ -215,7 +155,6 @@ export class Transaction extends SentrySpan implements TransactionInterface {
215155 transaction : this . _name ,
216156 type : 'transaction' ,
217157 sdkProcessingMetadata : {
218- ...metadata ,
219158 capturedSpanScope,
220159 capturedSpanIsolationScope,
221160 ...dropUndefinedKeys ( {
0 commit comments