Skip to content

Commit 1eac9af

Browse files
author
Luca Forstner
committed
Merge remote-tracking branch 'origin/develop' into lforst-sample-rand
2 parents 0b12615 + a5de993 commit 1eac9af

File tree

7 files changed

+1
-32
lines changed

7 files changed

+1
-32
lines changed

docs/migration/v8-to-v9.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ Since v9, the types have been merged into `@sentry/core`, which removed some of
270270
- The `Request` type has been removed. Use `RequestEventData` type instead.
271271
- The `IntegrationClass` type is no longer exported - it was not used anymore. Instead, use `Integration` or `IntegrationFn`.
272272
- The `samplingContext.request` attribute in the `tracesSampler` has been removed. Use `samplingContext.normalizedRequest` instead. Note that the type of `normalizedRequest` differs from `request`.
273+
- The `samplingContext.transactionContext` object in the `tracesSampler` has been removed. All object attributes are available in the top-level of `samplingContext`.
273274
- `Client` now always expects the `BaseClient` class - there is no more abstract `Client` that can be implemented! Any `Client` class has to extend from `BaseClient`.
274275
- `ReportDialogOptions` now extends `Record<string, unknown>` instead of `Record<string, any>` - this should not affect most users.
275276
- The `RequestDataIntegrationOptions` type has been removed. There is no replacement.

packages/core/src/tracing/trace.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,6 @@ function _startRootSpan(spanArguments: SentrySpanArguments, scope: Scope, parent
414414
name,
415415
parentSampled,
416416
attributes,
417-
transactionContext: {
418-
name,
419-
parentSampled,
420-
},
421417
// parentSampleRate: 'TODO',
422418
},
423419
sampleRand,

packages/core/src/types-hoist/samplingcontext.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,6 @@ export interface CustomSamplingContext {
1515
* Adds default data to data provided by the user. See {@link Hub.startTransaction}
1616
*/
1717
export interface SamplingContext extends CustomSamplingContext {
18-
/**
19-
* Context data with which transaction being sampled was created.
20-
* @deprecated This is duplicate data and will be removed eventually.
21-
*/
22-
transactionContext: {
23-
name: string;
24-
parentSampled?: boolean | undefined;
25-
};
26-
2718
/**
2819
* Sampling decision from the parent transaction, if any.
2920
*/

packages/core/test/lib/tracing/trace.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,6 @@ describe('startSpan', () => {
606606
test2: 'aa',
607607
test3: 'bb',
608608
},
609-
transactionContext: expect.objectContaining({ name: 'outer', parentSampled: undefined }),
610609
});
611610
});
612611

packages/opentelemetry/src/sampler.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,6 @@ export class SentrySampler implements Sampler {
110110
{
111111
name: inferredSpanName,
112112
attributes: mergedAttributes,
113-
transactionContext: {
114-
name: inferredSpanName,
115-
parentSampled,
116-
},
117113
// parentSampleRate: 'TODO',
118114
normalizedRequest: isolationScope?.getScopeData().sdkProcessingMetadata.normalizedRequest,
119115
parentSampled,

packages/opentelemetry/test/trace.test.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1344,7 +1344,6 @@ describe('trace (sampling)', () => {
13441344
parentSampled: undefined,
13451345
name: 'outer',
13461346
attributes: {},
1347-
transactionContext: { name: 'outer', parentSampled: undefined },
13481347
});
13491348

13501349
// Now return `false`, it should not sample
@@ -1364,15 +1363,13 @@ describe('trace (sampling)', () => {
13641363
parentSampled: undefined,
13651364
name: 'outer',
13661365
attributes: {},
1367-
transactionContext: { name: 'outer', parentSampled: undefined },
13681366
}),
13691367
);
13701368
expect(tracesSampler).toHaveBeenCalledWith(
13711369
expect.objectContaining({
13721370
parentSampled: undefined,
13731371
name: 'outer2',
13741372
attributes: {},
1375-
transactionContext: { name: 'outer2', parentSampled: undefined },
13761373
}),
13771374
);
13781375

@@ -1413,7 +1410,6 @@ describe('trace (sampling)', () => {
14131410
attr2: 1,
14141411
'sentry.op': 'test.op',
14151412
},
1416-
transactionContext: { name: 'outer', parentSampled: undefined },
14171413
});
14181414

14191415
// Now return `0`, it should not sample
@@ -1433,7 +1429,6 @@ describe('trace (sampling)', () => {
14331429
parentSampled: undefined,
14341430
name: 'outer2',
14351431
attributes: {},
1436-
transactionContext: { name: 'outer2', parentSampled: undefined },
14371432
}),
14381433
);
14391434

@@ -1456,7 +1451,6 @@ describe('trace (sampling)', () => {
14561451
parentSampled: undefined,
14571452
name: 'outer3',
14581453
attributes: {},
1459-
transactionContext: { name: 'outer3', parentSampled: undefined },
14601454
});
14611455
});
14621456

@@ -1490,10 +1484,6 @@ describe('trace (sampling)', () => {
14901484
parentSampled: true,
14911485
name: 'outer',
14921486
attributes: {},
1493-
transactionContext: {
1494-
name: 'outer',
1495-
parentSampled: true,
1496-
},
14971487
});
14981488
});
14991489

packages/profiling-node/src/spanProfileUtils.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ export function maybeProfileSpan(
4848
profilesSampleRate = profilesSampler({
4949
name: spanName,
5050
attributes: data,
51-
transactionContext: {
52-
name: spanName,
53-
parentSampled,
54-
},
5551
parentSampled,
5652
...customSamplingContext,
5753
});

0 commit comments

Comments
 (0)