Skip to content

Commit 2c7a20a

Browse files
committed
remove unnecessary guard and clear up spanv2json confusion
1 parent fc18e22 commit 2c7a20a

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

packages/core/src/utils/spanUtils.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,8 @@ export function spanToJSON(span: Span): SpanJSON {
222222
* Convert a span to the intermediate {@link StreamedSpanJSON} representation.
223223
*/
224224
export function spanToStreamedSpanJSON(span: Span): StreamedSpanJSON {
225-
// Check if the span has a getSpanV2JSON method (added in SentrySpan in later PRs)
226-
if (typeof (span as SentrySpan & { getSpanV2JSON?: () => SerializedSpan }).getStreamedSpanJSON === 'function') {
227-
return (span as SentrySpan & { getSpanV2JSON: () => SerializedSpan }).getStreamedSpanJSON();
225+
if (spanIsSentrySpan(span)) {
226+
return span.getStreamedSpanJSON();
228227
}
229228

230229
const { spanId: span_id, traceId: trace_id } = span.spanContext();

0 commit comments

Comments
 (0)