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

Function parseSentrySpanArguments

packages/core/src/tracing/trace.ts:460–475  ·  view source on GitHub ↗

* This converts StartSpanOptions to SentrySpanArguments. * For the most part (for now) we accept the same options, * but some of them need to be transformed.

(options: StartSpanOptions)

Source from the content-addressed store, hash-verified

458 * but some of them need to be transformed.
459 */
460function parseSentrySpanArguments(options: StartSpanOptions): SentrySpanArguments {
461 const exp = options.experimental || {};
462 const initialCtx: SentrySpanArguments = {
463 isStandalone: exp.standalone,
464 ...options,
465 };
466
467 if (options.startTime) {
468 const ctx: SentrySpanArguments & { startTime?: SpanTimeInput } = { ...initialCtx };
469 ctx.startTimestamp = spanTimeInputToSeconds(options.startTime);
470 delete ctx.startTime;
471 return ctx;
472 }
473
474 return initialCtx;
475}
476
477function getAcs(): AsyncContextStrategy {
478 const carrier = getMainCarrier();

Callers 3

startSpanFunction · 0.85
startSpanManualFunction · 0.85
startInactiveSpanFunction · 0.85

Calls 1

spanTimeInputToSecondsFunction · 0.90

Tested by

no test coverage detected