From ca24b190cfacb9632a8d6c59107d257367b89575 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 10 Jan 2024 15:48:36 +0100 Subject: [PATCH 1/2] feat(core): Deprecate `Span.instrumenter` --- packages/core/src/tracing/span.ts | 7 +++++++ packages/types/src/span.ts | 2 ++ 2 files changed, 9 insertions(+) diff --git a/packages/core/src/tracing/span.ts b/packages/core/src/tracing/span.ts index 10a4d97efa08..c3cd71e87699 100644 --- a/packages/core/src/tracing/span.ts +++ b/packages/core/src/tracing/span.ts @@ -110,6 +110,12 @@ export class Span implements SpanInterface { /** * The instrumenter that created this span. + * + * TODO (v8): This can probably be replaced by an `instanceOf` check of the span class. + * the instrumenter can only be sentry or otel so we can check the span instance + * to verify which one it is and remove this field entirely. + * + * @deprecated This field will be removed. */ public instrumenter: Instrumenter; @@ -142,6 +148,7 @@ export class Span implements SpanInterface { // eslint-disable-next-line deprecation/deprecation this.data = spanContext.data ? { ...spanContext.data } : {}; this._attributes = spanContext.attributes ? { ...spanContext.attributes } : {}; + // eslint-disable-next-line deprecation/deprecation this.instrumenter = spanContext.instrumenter || 'sentry'; this.origin = spanContext.origin || 'manual'; // eslint-disable-next-line deprecation/deprecation diff --git a/packages/types/src/span.ts b/packages/types/src/span.ts index 3f54322886bb..662cfb57a155 100644 --- a/packages/types/src/span.ts +++ b/packages/types/src/span.ts @@ -221,6 +221,8 @@ export interface Span extends SpanContext { /** * The instrumenter that created this span. + * + * @deprecated this field will be removed. */ instrumenter: Instrumenter; From d3a8d91bf915d90562de69fcf5ab0648741ce8f7 Mon Sep 17 00:00:00 2001 From: Lukas Stracke Date: Wed, 10 Jan 2024 15:52:33 +0100 Subject: [PATCH 2/2] migration entry --- MIGRATION.md | 1 + 1 file changed, 1 insertion(+) diff --git a/MIGRATION.md b/MIGRATION.md index c1dc5b4415ae..0fb51fd6c4c7 100644 --- a/MIGRATION.md +++ b/MIGRATION.md @@ -151,6 +151,7 @@ In v8, the Span class is heavily reworked. The following properties & methods ar - `span.data`: Use `spanToJSON(span).data` instead. - `span.setTag()`: Use `span.setAttribute()` instead or set tags on the surrounding scope. - `span.setData()`: Use `span.setAttribute()` instead. +- `span.instrumenter` This field was removed and will be replaced internally. - `transaction.setContext()`: Set context on the surrounding scope instead. ## Deprecate `pushScope` & `popScope` in favor of `withScope`