From f874cb4ba7794a7331d475cc73764d690bc77860 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Tue, 16 Jan 2024 17:10:58 -0500 Subject: [PATCH 1/2] feat: Deprecate user segment field --- packages/core/src/tracing/dynamicSamplingContext.ts | 1 + packages/types/src/envelope.ts | 3 +++ packages/types/src/user.ts | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/core/src/tracing/dynamicSamplingContext.ts b/packages/core/src/tracing/dynamicSamplingContext.ts index f27052c8cfbc..6e6e8a8aae5f 100644 --- a/packages/core/src/tracing/dynamicSamplingContext.ts +++ b/packages/core/src/tracing/dynamicSamplingContext.ts @@ -19,6 +19,7 @@ export function getDynamicSamplingContextFromClient( const options = client.getOptions(); const { publicKey: public_key } = client.getDsn() || {}; + // TODO(v8): Remove segment from User const { segment: user_segment } = (scope && scope.getUser()) || {}; const dsc = dropUndefinedKeys({ diff --git a/packages/types/src/envelope.ts b/packages/types/src/envelope.ts index c07853c377d9..a33f823ab8f5 100644 --- a/packages/types/src/envelope.ts +++ b/packages/types/src/envelope.ts @@ -20,6 +20,9 @@ export type DynamicSamplingContext = { release?: string; environment?: string; transaction?: string; + /** + * @deprecated Functonality for segment has been removed. + */ user_segment?: string; replay_id?: string; sampled?: string; diff --git a/packages/types/src/user.ts b/packages/types/src/user.ts index 9c48c7f4967f..c9eeac18ce51 100644 --- a/packages/types/src/user.ts +++ b/packages/types/src/user.ts @@ -1,10 +1,15 @@ -/** JSDoc */ +/** + * An interface describing a user of an application or a handled request. + */ export interface User { [key: string]: any; id?: string | number; ip_address?: string; email?: string; username?: string; + /** + * @deprecated Functonality for segment has been removed. Use a custom tag or context instead to capture this information. + */ segment?: string; } From e5fad31ba1dd7144223acda257e536ab2e9308c9 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Wed, 17 Jan 2024 11:21:11 -0500 Subject: [PATCH 2/2] add extra deprecation --- packages/core/src/tracing/dynamicSamplingContext.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/core/src/tracing/dynamicSamplingContext.ts b/packages/core/src/tracing/dynamicSamplingContext.ts index 6e6e8a8aae5f..a51c2362c437 100644 --- a/packages/core/src/tracing/dynamicSamplingContext.ts +++ b/packages/core/src/tracing/dynamicSamplingContext.ts @@ -20,6 +20,7 @@ export function getDynamicSamplingContextFromClient( const { publicKey: public_key } = client.getDsn() || {}; // TODO(v8): Remove segment from User + // eslint-disable-next-line deprecation/deprecation const { segment: user_segment } = (scope && scope.getUser()) || {}; const dsc = dropUndefinedKeys({