8000 ref(core): Add missing class field deprecations (#10187) · getsentry/sentry-javascript@b86652a · GitHub
[go: up one dir, main page]

Skip to content

Commit b86652a

Browse files
Lms24mydea
andauthored
ref(core): Add missing class field deprecations (#10187)
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>
1 parent 64abebc commit b86652a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

packages/core/src/tracing/span.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,17 @@ export class Span implements SpanInterface {
444444

445445
/**
446446
* @inheritDoc
447+
*
448+
* @deprecated Use `spanToTraceHeader()` instead.
447449
*/
448450
public toTraceparent(): string {
449451
return spanToTraceHeader(this);
450452
}
451453

452454
/**
453455
* @inheritDoc
456+
*
457+
* @deprecated Use `spanToJSON()` or access the fields directly instead.
454458
*/
455459
public toContext(): SpanContext {
456460
return dropUndefinedKeys({
@@ -471,6 +475,8 @@ export class Span implements SpanInterface {
471475

472476
/**
473477
* @inheritDoc
478+
*
479+
* @deprecated Update the fields directly instead.
474480
*/
475481
public updateWithContext(spanContext: SpanContext): this {
476482
// eslint-disable-next-line deprecation/deprecation
@@ -493,6 +499,8 @@ export class Span implements SpanInterface {
493499

494500
/**
495501
* @inheritDoc
502+
*
503+
* @deprecated Use `spanToTraceContext()` util function instead.
496504
*/
497505
public getTraceContext(): TraceContext {
498506
return spanToTraceContext(this);

0 commit comments

Comments
 (0)
0