Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
26 lines
867 B
Plaintext
26 lines
867 B
Plaintext
import { withScope, getTraceContextFromScope } from '../currentScopes.js';
|
|
import { getDynamicSamplingContextFromSpan, getDynamicSamplingContextFromScope } from '../tracing/dynamicSamplingContext.js';
|
|
import { getActiveSpan, spanToTraceContext } from './spanUtils.js';
|
|
|
|
/** Extract trace information from scope */
|
|
function _getTraceInfoFromScope(
|
|
client,
|
|
scope,
|
|
) {
|
|
if (!scope) {
|
|
return [undefined, undefined];
|
|
}
|
|
|
|
return withScope(scope, () => {
|
|
const span = getActiveSpan();
|
|
const traceContext = span ? spanToTraceContext(span) : getTraceContextFromScope(scope);
|
|
const dynamicSamplingContext = span
|
|
? getDynamicSamplingContextFromSpan(span)
|
|
: getDynamicSamplingContextFromScope(client, scope);
|
|
return [dynamicSamplingContext, traceContext];
|
|
});
|
|
}
|
|
|
|
export { _getTraceInfoFromScope };
|
|
//# sourceMappingURL=trace-info.js.map
|