Skip to content

Commit 613a1aa

Browse files
authored
docs: Fix deprecation message for span data/attributes (#10608)
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!
1 parent 8ac381c commit 613a1aa

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/core/src/tracing/span.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ export class SpanRecorder {
6767
export class Span implements SpanInterface {
6868
/**
6969
* Tags for the span.
70-
* @deprecated Use `getSpanAttributes(span)` instead.
70+
* @deprecated Use `spanToJSON(span).atttributes` instead.
7171
*/
7272
public tags: { [key: string]: Primitive };
7373

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

264264
/**
265265
* Attributes for the span.
266-
* @deprecated Use `getSpanAttributes(span)` instead.
266+
* @deprecated Use `spanToJSON(span).atttributes` instead.
267267
*/
268268
public get attributes(): SpanAttributes {
269269
return this._attributes;

packages/types/src/span.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -226,19 +226,19 @@ export interface Span extends Omit<SpanContext, 'op' | 'status' | 'origin'> {
226226

227227
/**
228228
* Tags for the span.
229-
* @deprecated Use `getSpanAttributes(span)` instead.
229+
* @deprecated Use `spanToJSON(span).atttributes` instead.
230230
*/
231231
tags: { [key: string]: Primitive };
232232

233233
/**
234234
* Data for the span.
235-
* @deprecated Use `getSpanAttributes(span)` instead.
235+
* @deprecated Use `spanToJSON(span).atttributes` instead.
236236
*/
237237
data: { [key: string]: any };
238238

239239
/**
240240
* Attributes for the span.
241-
* @deprecated Use `getSpanAttributes(span)` instead.
241+
* @deprecated Use `spanToJSON(span).atttributes` instead.
242242
*/
243243
attributes: SpanAttributes;
244244

0 commit comments

Comments
 (0)