From c4acfe9e2fc134174f4c14bf41f6f51ba651536f Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Wed, 21 Feb 2024 12:36:24 -0500 Subject: [PATCH] feat(v8): Remove span.toTraceparent method (#10698) ref https://github.com/getsentry/sentry-javascript/issues/10677 --- .../debug-id-sourcemaps/package.json | 2 +- packages/core/src/tracing/sentrySpan.ts | 10 ---------- packages/tracing/test/span.test.ts | 11 +---------- packages/types/src/span.ts | 6 ------ 4 files changed, 2 insertions(+), 27 deletions(-) diff --git a/dev-packages/e2e-tests/test-applications/debug-id-sourcemaps/package.json b/dev-packages/e2e-tests/test-applications/debug-id-sourcemaps/package.json index ec6eeba0066c..3a656ff4f784 100644 --- a/dev-packages/e2e-tests/test-applications/debug-id-sourcemaps/package.json +++ b/dev-packages/e2e-tests/test-applications/debug-id-sourcemaps/package.json @@ -15,7 +15,7 @@ "devDependencies": { "rollup": "^4.0.2", "vitest": "^0.34.6", - "@sentry/rollup-plugin": "2.8.0" + "@sentry/rollup-plugin": "2.14.2" }, "pnpm": { "overrides": { diff --git a/packages/core/src/tracing/sentrySpan.ts b/packages/core/src/tracing/sentrySpan.ts index 904136d3d04d..2f1fa54c5306 100644 --- a/packages/core/src/tracing/sentrySpan.ts +++ b/packages/core/src/tracing/sentrySpan.ts @@ -24,7 +24,6 @@ import { spanTimeInputToSeconds, spanToJSON, spanToTraceContext, - spanToTraceHeader, } from '../utils/spanUtils'; import type { SpanStatusType } from './spanstatus'; import { setHttpStatus } from './spanstatus'; @@ -454,15 +453,6 @@ export class SentrySpan implements SpanInterface { this._endTime = spanTimeInputToSeconds(endTimestamp); } - /** - * @inheritDoc - * - * @deprecated Use `spanToTraceHeader()` instead. - */ - public toTraceparent(): string { - return spanToTraceHeader(this); - } - /** * @inheritDoc * diff --git a/packages/tracing/test/span.test.ts b/packages/tracing/test/span.test.ts index 483cc5cb3987..3fc72e58e6d4 100644 --- a/packages/tracing/test/span.test.ts +++ b/packages/tracing/test/span.test.ts @@ -14,7 +14,7 @@ import { } from '@sentry/core'; import type { BaseTransportOptions, ClientOptions } from '@sentry/types'; -import { TRACEPARENT_REGEXP, Transaction } from '../src'; +import { Transaction } from '../src'; import { getDefaultBrowserClientOptions } from './testutils'; describe('SentrySpan', () => { @@ -125,15 +125,6 @@ describe('SentrySpan', () => { }); }); - describe('toTraceparent', () => { - test('simple', () => { - expect(new SentrySpan().toTraceparent()).toMatch(TRACEPARENT_REGEXP); - }); - test('with sample', () => { - expect(new SentrySpan({ sampled: true }).toTraceparent()).toMatch(TRACEPARENT_REGEXP); - }); - }); - describe('toJSON', () => { test('simple', () => { const span = JSON.parse( diff --git a/packages/types/src/span.ts b/packages/types/src/span.ts index bb4a97dea860..5cfb5abdad1d 100644 --- a/packages/types/src/span.ts +++ b/packages/types/src/span.ts @@ -330,12 +330,6 @@ export interface Span extends Omit>): Span; - /** - * Return a traceparent compatible header string. - * @deprecated Use `spanToTraceHeader()` instead. - */ - toTraceparent(): string; - /** * Returns the current span properties as a `SpanContext`. * @deprecated Use `toJSON()` or access the fields directly instead.