8000 feat: Deprecate user segment field (#10210) · GingerAdonis/sentry-javascript@0477453 · GitHub
[go: up one dir, main page]

Skip to content

Commit 0477453

Browse files
authored
feat: Deprecate user segment field (getsentry#10210)
Segment is no longer supported by the product, so we can remove it in v8.
1 parent 1fa4266 commit 0477453

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

packages/core/src/tracing/dynamicSamplingContext.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ export function getDynamicSamplingContextFromClient(
1919
const options = client.getOptions();
2020

2121
const { publicKey: public_key } = client.getDsn() || {};
22+
// TODO(v8): Remove segment from User
23+
// eslint-disable-next-line deprecation/deprecation
2224
const { segment: user_segment } = (scope && scope.getUser()) || {};
2325

2426
const dsc = dropUndefinedKeys({

packages/types/src/envelope.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ export type DynamicSamplingContext = {
2020
release?: string;
2121
environment?: string;
2222
transaction?: string;
23+
/**
24+
* @deprecated Functonality for segment has been removed.
25+
*/
2326
user_segment?: string;
2427
replay_id?: string;
2528
sampled?: string;

packages/types/src/user.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
/** JSDoc */
1+
/**
2+
* An interface describing a user of an application or a handled request.
3+
*/
24
export interface User {
35
[key: string]: any;
46
id?: string | number;
57
ip_address?: string;
68
email?: string;
79
username?: string;
10+
/**
11+
* @deprecated Functonality for segment has been removed. Use a custom tag or context instead to capture this information.
12+
*/
813
segment?: string;
914
}
1015

0 commit comments

Comments
 (0)
0