45 lines
1.7 KiB
JavaScript
45 lines
1.7 KiB
JavaScript
// Metro module 6395 (f6396).
|
|
import { getMainCarrier } from "./Module6386";
|
|
import { getAsyncContextStrategy } from "./Module6387";
|
|
import { getGlobalSingleton } from "./Module6369";
|
|
import { Scope } from "./ScopeClass";
|
|
import { dropUndefinedKeys } from "./addNonEnumerableProperty_6374";
|
|
export function getClient() {
|
|
return getAsyncContextStrategy(getMainCarrier()).getCurrentScope().getClient();
|
|
}
|
|
export function getCurrentScope() {
|
|
return getAsyncContextStrategy(getMainCarrier()).getCurrentScope();
|
|
}
|
|
export function getGlobalScope() {
|
|
return getGlobalSingleton("globalScope", () => new Scope());
|
|
}
|
|
export function getIsolationScope() {
|
|
return getAsyncContextStrategy(getMainCarrier()).getIsolationScope();
|
|
}
|
|
export function getTraceContextFromScope(a0) {
|
|
const propagationContext = a0.getPropagationContext();
|
|
return dropUndefinedKeys({
|
|
trace_id: propagationContext.traceId,
|
|
span_id: propagationContext.spanId,
|
|
parent_span_id: propagationContext.parentSpanId
|
|
});
|
|
}
|
|
export function withIsolationScope(...args) {
|
|
const asyncContextStrategy = getAsyncContextStrategy(getMainCarrier());
|
|
if (args.length === 2) {
|
|
const r20 = args[0];
|
|
const r21 = args[1];
|
|
return r20 ? asyncContextStrategy.withSetIsolationScope(r20, r21) : asyncContextStrategy.withIsolationScope(r21);
|
|
}
|
|
return asyncContextStrategy.withIsolationScope(args[0]);
|
|
}
|
|
export function withScope(...args) {
|
|
const asyncContextStrategy = getAsyncContextStrategy(getMainCarrier());
|
|
if (args.length === 2) {
|
|
const r20 = args[0];
|
|
const r21 = args[1];
|
|
return r20 ? asyncContextStrategy.withSetScope(r20, r21) : asyncContextStrategy.withScope(r21);
|
|
}
|
|
return asyncContextStrategy.withScope(args[0]);
|
|
}
|