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

Function spanIsSampled

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

Source from the content-addressed store, hash-verified

310 * So in the case where this distinction is important, use this method.
311 */
312export function spanIsSampled(span: Span): boolean {
313 // We align our trace flags with the ones OpenTelemetry use
314 // So we also check for sampled the same way they do.
315 const { traceFlags } = span.spanContext();
316 return traceFlags === TRACE_FLAG_SAMPLED;
317}
318
319/** Get the status message to use for a JSON representation of a span. */
320export function getStatusMessage(status: SpanStatus | undefined): string | undefined {

Callers 15

maybeProfileSpanFunction · 0.90
spanUtils.test.tsFile · 0.90
trace.test.tsFile · 0.90
setupFunction · 0.90
logSpanStartFunction · 0.90
createChildOrRootSpanFunction · 0.90
_startChildSpanFunction · 0.90
handle.test.tsFile · 0.90
trace.test.tsFile · 0.90

Calls 1

spanContextMethod · 0.65

Tested by

no test coverage detected