We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fc18e22 commit 2c7a20aCopy full SHA for 2c7a20a
1 file changed
packages/core/src/utils/spanUtils.ts
@@ -222,9 +222,8 @@ export function spanToJSON(span: Span): SpanJSON {
222
* Convert a span to the intermediate {@link StreamedSpanJSON} representation.
223
*/
224
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();
+ if (spanIsSentrySpan(span)) {
+ return span.getStreamedSpanJSON();
228
}
229
230
const { spanId: span_id, traceId: trace_id } = span.spanContext();
0 commit comments