Skip to content

Commit

Permalink
ref(core): Add missing class field deprecations (#10187)
Browse files Browse the repository at this point in the history
Add some `@deprecated` annotations to already deprecated Span
APIs:

* `Span.toTraceParent()`
* `Span.toContext()`
* `Span.updateWithContext()`
* `Span.getTraceContext()`

Co-authored-by: Francesco Novy <francesco.novy@sentry.io>
  • Loading branch information
Lms24 and mydea authored Jan 15, 2024
1 parent 64abebc commit b86652a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/core/src/tracing/span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,13 +444,17 @@ export class Span implements SpanInterface {

/**
* @inheritDoc
*
* @deprecated Use `spanToTraceHeader()` instead.
*/
public toTraceparent(): string {
return spanToTraceHeader(this);
}

/**
* @inheritDoc
*
* @deprecated Use `spanToJSON()` or access the fields directly instead.
*/
public toContext(): SpanContext {
return dropUndefinedKeys({
Expand All @@ -471,6 +475,8 @@ export class Span implements SpanInterface {

/**
* @inheritDoc
*
* @deprecated Update the fields directly instead.
*/
public updateWithContext(spanContext: SpanContext): this {
// eslint-disable-next-line deprecation/deprecation
Expand All @@ -493,6 +499,8 @@ export class Span implements SpanInterface {

/**
* @inheritDoc
*
* @deprecated Use `spanToTraceContext()` util function instead.
*/
public getTraceContext(): TraceContext {
return spanToTraceContext(this);
Expand Down

0 comments on commit b86652a

Please sign in to comment.