Skip to content

feat(v8): Remove span.toTraceparent method #10698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -25,7 +25,6 @@ import {
spanTimeInputToSeconds,
spanToJSON,
spanToTraceContext,
spanToTraceHeader,
} from '../utils/spanUtils';
import type { SpanStatusType } from './spanstatus';
import { setHttpStatus } from './spanstatus';
Expand Down Expand Up @@ -474,15 +473,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 @@ -338,12 +338,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