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

Function generateTraceparentHeader

packages/core/src/utils/tracing.ts:109–115  ·  view source on GitHub ↗
(
  traceId: string | undefined = generateTraceId(),
  spanId: string | undefined = generateSpanId(),
  sampled?: boolean,
)

Source from the content-addressed store, hash-verified

107 * Creates a W3C traceparent header from the given trace and span ids.
108 */
109export function generateTraceparentHeader(
110 traceId: string | undefined = generateTraceId(),
111 spanId: string | undefined = generateSpanId(),
112 sampled?: boolean,
113): string {
114 return `00-${traceId}-${spanId}-${sampled ? '01' : '00'}`;
115}
116
117/**
118 * Given any combination of an incoming trace, generate a sample rand based on its defined semantics.

Callers 5

tracing.test.tsFile · 0.90
scopeToTraceparentHeaderFunction · 0.90
spanToTraceparentHeaderFunction · 0.90
injectMethod · 0.90
getTraceDataFunction · 0.90

Calls 2

generateTraceIdFunction · 0.90
generateSpanIdFunction · 0.90

Tested by

no test coverage detected