MCPcopy Create free account
hub / github.com/getsentry/sentry-javascript / spanToTraceparentHeader

Function spanToTraceparentHeader

packages/core/src/utils/spanUtils.ts:95–99  ·  view source on GitHub ↗
(span: Span)

Source from the content-addressed store, hash-verified

93 * Convert a Span to a W3C traceparent header.
94 */
95export function spanToTraceparentHeader(span: Span): string {
96 const { traceId, spanId } = span.spanContext();
97 const sampled = spanIsSampled(span);
98 return generateTraceparentHeader(traceId, spanId, sampled);
99}
100
101/**
102 * Converts the span links array to a flattened version to be sent within an envelope.

Callers 1

getTraceDataFunction · 0.90

Calls 3

spanIsSampledFunction · 0.85
spanContextMethod · 0.65

Tested by

no test coverage detected