Skip to content

Commit

Permalink
docs: Fix deprecation message for span data/attributes (#10608)
Browse files Browse the repository at this point in the history
This was apparently left over from some in-between state, users should
actually use `spanToJSON(span)` there to get attributes.

Backporting this (#10604 ) to v7!
  • Loading branch information
mydea authored Feb 12, 2024
1 parent 8ac381c commit 613a1aa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions packages/core/src/tracing/span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ export class SpanRecorder {
export class Span implements SpanInterface {
/**
* Tags for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/
public tags: { [key: string]: Primitive };

/**
* Data for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any
public data: { [key: string]: any };
Expand Down Expand Up @@ -263,7 +263,7 @@ export class Span implements SpanInterface {

/**
* Attributes for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/
public get attributes(): SpanAttributes {
return this._attributes;
Expand Down
6 changes: 3 additions & 3 deletions packages/types/src/span.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,19 +226,19 @@ export interface Span extends Omit<SpanContext, 'op' | 'status' | 'origin'> {

/**
* Tags for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/
tags: { [key: string]: Primitive };

/**
* Data for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/
data: { [key: string]: any };

/**
* Attributes for the span.
* @deprecated Use `getSpanAttributes(span)` instead.
* @deprecated Use `spanToJSON(span).atttributes` instead.
*/
attributes: SpanAttributes;

Expand Down

0 comments on commit 613a1aa

Please sign in to comment.