@sentry/core
Version:
Base implementation for all Sentry JavaScript SDKs
16 lines (15 loc) • 788 B
JavaScript
import { getTraceContextFromScope, withScope } from "../currentScopes.js";
import { getDynamicSamplingContextFromScope, getDynamicSamplingContextFromSpan } from "../tracing/dynamicSamplingContext.js";
import { getActiveSpan, spanToTraceContext } from "./spanUtils.js";
// src/utils/trace-info.ts
/** Extract trace information from scope */
function _getTraceInfoFromScope(client, scope) {
if (!scope) return [void 0, void 0];
return withScope(scope, () => {
const span = getActiveSpan();
const traceContext = span ? spanToTraceContext(span) : getTraceContextFromScope(scope);
return [span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromScope(client, scope), traceContext];
});
}
export { _getTraceInfoFromScope };
//# sourceMappingURL=trace-info.js.map