MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / getStreamedSpanLinks

Function getStreamedSpanLinks

packages/core/src/utils/spanUtils.ts:125–138  ·  view source on GitHub ↗
(
  links?: SpanLink[],
)

Source from the content-addressed store, hash-verified

123 * If the links array is empty, it returns `undefined` so the empty value can be dropped before it's sent.
124 */
125export function getStreamedSpanLinks(
126 links?: SpanLink[],
127): SpanLinkJSON<RawAttributes<Record<string, unknown>>>[] | undefined {
128 if (links?.length) {
129 return links.map(({ context: { spanId, traceId, traceFlags }, attributes }) => ({
130 span_id: spanId,
131 trace_id: traceId,
132 sampled: traceFlags === TRACE_FLAG_SAMPLED,
133 attributes,
134 }));
135 } else {
136 return undefined;
137 }
138}
139
140/**
141 * Convert a span time input into a timestamp in seconds.

Callers 2

getStreamedSpanJSONMethod · 0.90
spanToStreamedSpanJSONFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected