Skip to content

Commit

Permalink
feat(v8): Remove span.toTraceparent method (#10698)
Browse files Browse the repository at this point in the history
ref #10677
  • Loading branch information
AbhiPrasad authored Feb 21, 2024
1 parent 743c6c4 commit c4acfe9
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
10 changes: 0 additions & 10 deletions packages/core/src/tracing/sentrySpan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import {
spanTimeInputToSeconds,
spanToJSON,
spanToTraceContext,
spanToTraceHeader,
} from '../utils/spanUtils';
import type { SpanStatusType } from './spanstatus';
import { setHttpStatus } from './spanstatus';
Expand Down Expand Up @@ -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
*
Expand Down
11 changes: 1 addition & 10 deletions packages/tracing/test/span.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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(
Expand Down
6 changes: 0 additions & 6 deletions packages/types/src/span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,6 @@ export interface Span extends Omit<SpanContext, 'name' | 'op' | 'status' | 'orig
*/
startChild(spanContext?: Pick<SpanContext, Exclude<keyof SpanContext, 'sampled' | 'traceId' | 'parentSpanId'>>): 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.
Expand Down

0 comments on commit c4acfe9

Please sign in to comment.