Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
475 lines
19 KiB
JavaScript
475 lines
19 KiB
JavaScript
// Module ID: 12960
|
|
// Function ID: 12961
|
|
// Dependencies: [32, 12953, 12959, 12948, 12961, 12931, 12943, 12944, 12945, 12938, 12936, 12954, 12926, 12958, 12962, 12964, 12955, 12965, 12967, 12941]
|
|
// Exports: continueTrace, startInactiveSpan, startNewTrace, startSpan, startSpanManual, suppressTracing, withActiveSpan
|
|
|
|
// Module 12960
|
|
import generatePropagationContext from "generatePropagationContext" /* 12936 */;
|
|
import _mod12938 from "module_12938" /* 12938 */;
|
|
import _mod12941 from "module_12941" /* 12941 */;
|
|
import _mod12944 from "module_12944" /* 12944 */;
|
|
import _mod12945 from "module_12945" /* 12945 */;
|
|
import _mod12948 from "module_12948" /* 12948 */;
|
|
import _mod12953 from "module_12953" /* 12953 */;
|
|
import _mod12954 from "module_12954" /* 12954 */;
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
function createChildOrRootSpan(forceTransaction) {
|
|
({ parentSpan, spanArguments, scope } = forceTransaction);
|
|
if (obj.hasTracingEnabled()) {
|
|
const isolationScope = tmp(12953).getIsolationScope();
|
|
if (parentSpan) {
|
|
if (!forceTransaction.forceTransaction) {
|
|
({ traceId, spanId } = parentSpan.spanContext());
|
|
const tmp9 = scope.getScopeData().sdkProcessingMetadata[__SENTRY_SUPPRESS_TRACING__];
|
|
let spanIsSampledResult = !tmp9;
|
|
if (!tmp9) {
|
|
spanIsSampledResult = tmp(12931).spanIsSampled(parentSpan);
|
|
const tmpResult11 = tmp(12931);
|
|
}
|
|
if (spanIsSampledResult) {
|
|
const obj2 = {};
|
|
const merged = Object.assign(spanArguments);
|
|
obj2.parentSpanId = spanId;
|
|
obj2.traceId = traceId;
|
|
obj2.sampled = spanIsSampledResult;
|
|
let sentrySpan = new tmp(12967).SentrySpan(obj2);
|
|
} else {
|
|
const obj3 = { traceId };
|
|
sentrySpan = new tmp(12959).SentryNonRecordingSpan(obj3);
|
|
}
|
|
const spanContextResult = parentSpan.spanContext();
|
|
tmp(12931).addChildSpanToSpan(parentSpan, sentrySpan);
|
|
const tmpResult12 = tmp(12931);
|
|
const client = tmp(12953).getClient();
|
|
if (client) {
|
|
client.emit("spanStart", sentrySpan);
|
|
if (spanArguments.endTimestamp) {
|
|
client.emit("spanEnd", sentrySpan);
|
|
}
|
|
}
|
|
const tmpResult13 = tmp(12953);
|
|
tmp(12931).addChildSpanToSpan(parentSpan, sentrySpan);
|
|
const tmpResult14 = tmp(12931);
|
|
}
|
|
tmp(12964).logSpanStart(sentrySpan);
|
|
const tmpResult15 = tmp(12964);
|
|
const result = tmp(12955).setCapturedScopesOnSpan(sentrySpan, scope, isolationScope);
|
|
return sentrySpan;
|
|
}
|
|
if (parentSpan) {
|
|
const dynamicSamplingContextFromSpan = tmp(12962).getDynamicSamplingContextFromSpan(parentSpan);
|
|
const tmpResult17 = tmp(12962);
|
|
({ traceId: traceId2, spanId: spanId2 } = parentSpan.spanContext());
|
|
const spanContextResult1 = parentSpan.spanContext();
|
|
const obj4 = { traceId: traceId2, parentSpanId: spanId2 };
|
|
const tmpResult18 = tmp(12931);
|
|
const merged1 = Object.assign(spanArguments);
|
|
const tmp42 = _startRootSpan(obj4, scope, tmp(12931).spanIsSampled(parentSpan));
|
|
const spanIsSampledResult1 = tmp(12931).spanIsSampled(parentSpan);
|
|
tmp(12962).freezeDscOnSpan(tmp42, dynamicSamplingContextFromSpan);
|
|
sentrySpan = tmp42;
|
|
const tmpResult19 = tmp(12962);
|
|
} else {
|
|
const obj5 = {};
|
|
const merged2 = Object.assign(isolationScope.getPropagationContext());
|
|
const merged3 = Object.assign(scope.getPropagationContext());
|
|
const dsc = obj5.dsc;
|
|
const obj6 = { traceId: null, parentSpanId: null };
|
|
({ traceId: obj12.traceId, parentSpanId: obj12.parentSpanId } = obj5);
|
|
const merged4 = Object.assign(spanArguments);
|
|
const tmp33 = _startRootSpan(obj6, scope, obj5.sampled);
|
|
sentrySpan = tmp33;
|
|
if (dsc) {
|
|
tmp(12962).freezeDscOnSpan(tmp33, dsc);
|
|
sentrySpan = tmp33;
|
|
const tmpResult20 = tmp(12962);
|
|
}
|
|
}
|
|
const tmpResult = tmp(12953);
|
|
} else {
|
|
const sentryNonRecordingSpan = new tmp(12959).SentryNonRecordingSpan();
|
|
return sentryNonRecordingSpan;
|
|
}
|
|
}
|
|
function _startRootSpan(name, arg1, parentSampled) {
|
|
const client = _mod12953.getClient();
|
|
let options = client;
|
|
if (client) {
|
|
options = client.getOptions();
|
|
}
|
|
if (!options) {
|
|
options = {};
|
|
}
|
|
name = name.name;
|
|
let str = "";
|
|
if (undefined !== name) {
|
|
str = name;
|
|
}
|
|
if (arg1.getScopeData().sdkProcessingMetadata[__SENTRY_SUPPRESS_TRACING__]) {
|
|
const items = [false];
|
|
let sampleSpanResult = items;
|
|
} else {
|
|
const obj2 = { name: str, parentSampled, attributes: name.attributes, transactionContext: null };
|
|
const obj3 = { name: str, parentSampled };
|
|
obj2.transactionContext = obj3;
|
|
sampleSpanResult = tmp(12965).sampleSpan(options, obj2);
|
|
const tmpResult = tmp(12965);
|
|
}
|
|
[tmp6, tmp7] = sampleSpanResult;
|
|
const obj4 = {};
|
|
const merged = Object.assign(name);
|
|
const tmp5 = _slicedToArray(sampleSpanResult, 2);
|
|
const merged1 = Object.assign(name.attributes);
|
|
obj4.attributes = { [_mod12941.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "custom" };
|
|
obj4.sampled = tmp6;
|
|
const sentrySpan = new tmp(12967).SentrySpan(obj4);
|
|
if (undefined !== tmp7) {
|
|
const attr = sentrySpan.setAttribute(tmp(12941).SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, tmp7);
|
|
}
|
|
if (client) {
|
|
client.emit("spanStart", sentrySpan);
|
|
}
|
|
return sentrySpan;
|
|
}
|
|
const __SENTRY_SUPPRESS_TRACING__ = "__SENTRY_SUPPRESS_TRACING__";
|
|
|
|
export const continueTrace = (arg0, arg1) => {
|
|
_require = arg1;
|
|
const mainCarrier = require("module_12944").getMainCarrier();
|
|
const obj = require("module_12944");
|
|
const tmp = _require;
|
|
const asyncContextStrategy = require("module_12945").getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.continueTrace) {
|
|
return asyncContextStrategy.continueTrace(arg0, arg1);
|
|
} else {
|
|
({ sentryTrace: dependencyMap, baggage: _slicedToArray } = arg0);
|
|
return tmp(12953).withScope((setPropagationContext) => {
|
|
const result = setPropagationContext.setPropagationContext(_mod12938.propagationContextFromHeaders(dependencyMap, _slicedToArray));
|
|
return closure_0();
|
|
});
|
|
}
|
|
const obj2 = require("module_12945");
|
|
};
|
|
export const startInactiveSpan = function startInactiveSpan(experimental) {
|
|
_require = experimental;
|
|
let mainCarrier = require("module_12944").getMainCarrier();
|
|
let obj = require("module_12944");
|
|
const tmp3 = _require;
|
|
const tmp4 = obj4;
|
|
let asyncContextStrategy = require("module_12945").getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.startInactiveSpan) {
|
|
return asyncContextStrategy.startInactiveSpan(experimental);
|
|
} else {
|
|
const obj3 = { isStandalone: experimental.experimental || {}.standalone };
|
|
const merged = Object.assign(experimental);
|
|
let tmp10 = obj3;
|
|
if (experimental.startTime) {
|
|
obj4 = {};
|
|
const merged1 = Object.assign(obj3);
|
|
obj4.startTimestamp = tmp3(tmp4[5]).spanTimeInputToSeconds(experimental.startTime);
|
|
delete tmp[tmp2];
|
|
tmp10 = obj4;
|
|
const tmp3Result = tmp3(tmp4[5]);
|
|
}
|
|
obj4 = tmp10;
|
|
({ forceTransaction: _slicedToArray, parentSpan } = experimental);
|
|
if (experimental.scope) {
|
|
let fn = (arg0) => _mod12953.withScope(experimental.scope, arg0);
|
|
} else {
|
|
fn = undefined !== parentSpan ? ((arg0) => {
|
|
closure_0 = parentSpan;
|
|
closure_1 = arg0;
|
|
const mainCarrier = _mod12944.getMainCarrier();
|
|
const tmp = parentSpan;
|
|
const asyncContextStrategy = _mod12945.getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.withActiveSpan) {
|
|
let withActiveSpanResult = asyncContextStrategy.withActiveSpan(tmp, arg0);
|
|
} else {
|
|
withActiveSpanResult = _mod12953.withScope((arg0) => {
|
|
_null(dependencyMap[3])._setSpanForScope(arg0, c0);
|
|
return closure_1(arg0);
|
|
});
|
|
const tmp2Result = _mod12953;
|
|
}
|
|
return withActiveSpanResult;
|
|
}) : ((fn) => fn());
|
|
}
|
|
return fn(() => {
|
|
const currentScope = _mod12953.getCurrentScope();
|
|
const _getSpanForScopeResult = _mod12948._getSpanForScope(currentScope);
|
|
let tmp5;
|
|
if (_getSpanForScopeResult) {
|
|
const client = tmp(12953).getClient();
|
|
if (client) {
|
|
let options = client.getOptions();
|
|
} else {
|
|
options = {};
|
|
}
|
|
let rootSpan = _getSpanForScopeResult;
|
|
if (options.parentSpanIsAlwaysRootSpan) {
|
|
rootSpan = tmp(12931).getRootSpan(_getSpanForScopeResult);
|
|
const tmpResult2 = tmp(12931);
|
|
}
|
|
tmp5 = rootSpan;
|
|
const tmpResult = tmp(12953);
|
|
}
|
|
if (experimental.onlyIfParent) {
|
|
if (!tmp5) {
|
|
let sentryNonRecordingSpan = new tmp(12959).SentryNonRecordingSpan();
|
|
}
|
|
return sentryNonRecordingSpan;
|
|
}
|
|
sentryNonRecordingSpan = createChildOrRootSpan({ parentSpan: tmp5, spanArguments: obj4, forceTransaction, scope: currentScope });
|
|
});
|
|
}
|
|
const obj2 = require("module_12945");
|
|
};
|
|
export const startNewTrace = function startNewTrace(arg0) {
|
|
_require = arg0;
|
|
return require("module_12953").withScope((setPropagationContext) => {
|
|
const obj = { traceId: generatePropagationContext.generateTraceId() };
|
|
const result = setPropagationContext.setPropagationContext(obj);
|
|
if (_mod12954.DEBUG_BUILD) {
|
|
const logger = tmp(12926).logger;
|
|
const _HermesInternal = HermesInternal;
|
|
logger.info("Starting a new trace with id " + setPropagationContext.getPropagationContext().traceId);
|
|
}
|
|
c0 = null;
|
|
closure_1 = _null;
|
|
const tmp6 = _null;
|
|
const mainCarrier = _mod12944.getMainCarrier();
|
|
const tmpResult = _mod12944;
|
|
const asyncContextStrategy = _mod12945.getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.withActiveSpan) {
|
|
let withActiveSpanResult = asyncContextStrategy.withActiveSpan(null, tmp6);
|
|
} else {
|
|
withActiveSpanResult = tmp(12953).withScope((arg0) => {
|
|
_null(dependencyMap[3])._setSpanForScope(arg0, c0);
|
|
return closure_1(arg0);
|
|
});
|
|
const tmpResult4 = tmp(12953);
|
|
}
|
|
return withActiveSpanResult;
|
|
});
|
|
};
|
|
export const startSpan = function startSpan(experimental, arg1) {
|
|
_require = experimental;
|
|
dependencyMap = arg1;
|
|
const mainCarrier = require("module_12944").getMainCarrier();
|
|
let obj = require("module_12944");
|
|
const asyncContextStrategy = require("module_12945").getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.startSpan) {
|
|
return asyncContextStrategy.startSpan(experimental, arg1);
|
|
} else {
|
|
let obj3 = { isStandalone: experimental.experimental || {}.standalone };
|
|
const merged = Object.assign(experimental);
|
|
let tmp10 = obj3;
|
|
if (experimental.startTime) {
|
|
let obj4 = {};
|
|
const merged1 = Object.assign(obj3);
|
|
obj4.startTimestamp = tmp3(12931).spanTimeInputToSeconds(experimental.startTime);
|
|
delete tmp[tmp2];
|
|
tmp10 = obj4;
|
|
const tmp3Result = tmp3(12931);
|
|
}
|
|
obj4 = tmp10;
|
|
({ forceTransaction: __SENTRY_SUPPRESS_TRACING__, parentSpan: createChildOrRootSpan } = experimental);
|
|
return tmp3(12953).withScope(experimental.scope, () => {
|
|
closure_0 = createChildOrRootSpan;
|
|
return undefined !== createChildOrRootSpan ? ((arg0) => {
|
|
dependencyMap = arg0;
|
|
const mainCarrier = closure_0(12944).getMainCarrier();
|
|
const obj = closure_0(12944);
|
|
const tmp = closure_0;
|
|
const tmp2 = closure_0;
|
|
const asyncContextStrategy = closure_0(12945).getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.withActiveSpan) {
|
|
let withActiveSpanResult = asyncContextStrategy.withActiveSpan(tmp, arg0);
|
|
} else {
|
|
withActiveSpanResult = tmp2(12953).withScope((arg0) => {
|
|
_null(dependencyMap[3])._setSpanForScope(arg0, c0);
|
|
return closure_1(arg0);
|
|
});
|
|
const tmp2Result = tmp2(12953);
|
|
}
|
|
return withActiveSpanResult;
|
|
}) : ((fn) => fn())(() => {
|
|
const currentScope = sentryNonRecordingSpan(12953).getCurrentScope();
|
|
const obj = sentryNonRecordingSpan(12953);
|
|
const _getSpanForScopeResult = sentryNonRecordingSpan(12948)._getSpanForScope(currentScope);
|
|
let tmp5;
|
|
if (_getSpanForScopeResult) {
|
|
const client = tmp(12953).getClient();
|
|
if (client) {
|
|
let options = client.getOptions();
|
|
} else {
|
|
options = {};
|
|
}
|
|
let rootSpan = _getSpanForScopeResult;
|
|
if (options.parentSpanIsAlwaysRootSpan) {
|
|
rootSpan = tmp(12931).getRootSpan(_getSpanForScopeResult);
|
|
const tmpResult4 = tmp(12931);
|
|
}
|
|
tmp5 = rootSpan;
|
|
const tmpResult = tmp(12953);
|
|
}
|
|
if (sentryNonRecordingSpan.onlyIfParent) {
|
|
if (!tmp5) {
|
|
sentryNonRecordingSpan = new tmp(12959).SentryNonRecordingSpan();
|
|
}
|
|
tmp(12948)._setSpanForScope(currentScope, sentryNonRecordingSpan);
|
|
const tmpResult5 = tmp(12948);
|
|
return tmp(12961).handleCallbackErrors(() => dependencyMap(sentryNonRecordingSpan), () => {
|
|
const status = sentryNonRecordingSpan(dependencyMap[5]).spanToJSON(sentryNonRecordingSpan).status;
|
|
const isRecordingResult = sentryNonRecordingSpan.isRecording();
|
|
let tmp4 = !isRecordingResult;
|
|
if (isRecordingResult) {
|
|
let tmp5 = status;
|
|
if (status) {
|
|
tmp5 = "ok" !== status;
|
|
}
|
|
tmp4 = tmp5;
|
|
}
|
|
if (!tmp4) {
|
|
const obj3 = { code: sentryNonRecordingSpan(dependencyMap[6]).SPAN_STATUS_ERROR, message: "internal_error" };
|
|
sentryNonRecordingSpan.setStatus(obj3);
|
|
}
|
|
}, () => sentryNonRecordingSpan.end());
|
|
}
|
|
sentryNonRecordingSpan = closure_1_4({ parentSpan: tmp5, spanArguments, forceTransaction, scope: currentScope });
|
|
});
|
|
});
|
|
}
|
|
const obj2 = require("module_12945");
|
|
};
|
|
export const startSpanManual = function startSpanManual(experimental, arg1) {
|
|
_require = experimental;
|
|
dependencyMap = arg1;
|
|
let mainCarrier = require("module_12944").getMainCarrier();
|
|
let obj = require("module_12944");
|
|
let asyncContextStrategy = require("module_12945").getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.startSpanManual) {
|
|
return asyncContextStrategy.startSpanManual(experimental, arg1);
|
|
} else {
|
|
let obj3 = { isStandalone: experimental.experimental || {}.standalone };
|
|
const merged = Object.assign(experimental);
|
|
let tmp10 = obj3;
|
|
if (experimental.startTime) {
|
|
let obj4 = {};
|
|
const merged1 = Object.assign(obj3);
|
|
obj4.startTimestamp = tmp3(12931).spanTimeInputToSeconds(experimental.startTime);
|
|
delete tmp[tmp2];
|
|
tmp10 = obj4;
|
|
const tmp3Result = tmp3(12931);
|
|
}
|
|
obj4 = tmp10;
|
|
({ forceTransaction: __SENTRY_SUPPRESS_TRACING__, parentSpan: createChildOrRootSpan } = experimental);
|
|
return tmp3(12953).withScope(experimental.scope, () => {
|
|
closure_0 = createChildOrRootSpan;
|
|
return undefined !== createChildOrRootSpan ? ((arg0) => {
|
|
dependencyMap = arg0;
|
|
const mainCarrier = closure_0(12944).getMainCarrier();
|
|
const obj = closure_0(12944);
|
|
const tmp = closure_0;
|
|
const tmp2 = closure_0;
|
|
const asyncContextStrategy = closure_0(12945).getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.withActiveSpan) {
|
|
let withActiveSpanResult = asyncContextStrategy.withActiveSpan(tmp, arg0);
|
|
} else {
|
|
withActiveSpanResult = tmp2(12953).withScope((arg0) => {
|
|
_null(dependencyMap[3])._setSpanForScope(arg0, c0);
|
|
return closure_1(arg0);
|
|
});
|
|
const tmp2Result = tmp2(12953);
|
|
}
|
|
return withActiveSpanResult;
|
|
}) : ((fn) => fn())(() => {
|
|
function finishAndSetSpan() {
|
|
sentryNonRecordingSpan.end();
|
|
}
|
|
const currentScope = sentryNonRecordingSpan(12953).getCurrentScope();
|
|
const obj = sentryNonRecordingSpan(12953);
|
|
const _getSpanForScopeResult = sentryNonRecordingSpan(12948)._getSpanForScope(currentScope);
|
|
let tmp5;
|
|
if (_getSpanForScopeResult) {
|
|
const client = tmp(12953).getClient();
|
|
if (client) {
|
|
let options = client.getOptions();
|
|
} else {
|
|
options = {};
|
|
}
|
|
let rootSpan = _getSpanForScopeResult;
|
|
if (options.parentSpanIsAlwaysRootSpan) {
|
|
rootSpan = tmp(12931).getRootSpan(_getSpanForScopeResult);
|
|
const tmpResult4 = tmp(12931);
|
|
}
|
|
tmp5 = rootSpan;
|
|
const tmpResult = tmp(12953);
|
|
}
|
|
if (sentryNonRecordingSpan.onlyIfParent) {
|
|
if (!tmp5) {
|
|
sentryNonRecordingSpan = new tmp(12959).SentryNonRecordingSpan();
|
|
}
|
|
tmp(12948)._setSpanForScope(currentScope, sentryNonRecordingSpan);
|
|
const tmpResult5 = tmp(12948);
|
|
return tmp(12961).handleCallbackErrors(() => dependencyMap(sentryNonRecordingSpan, finishAndSetSpan), () => {
|
|
const status = sentryNonRecordingSpan(dependencyMap[5]).spanToJSON(sentryNonRecordingSpan).status;
|
|
const isRecordingResult = sentryNonRecordingSpan.isRecording();
|
|
let tmp4 = !isRecordingResult;
|
|
if (isRecordingResult) {
|
|
let tmp5 = status;
|
|
if (status) {
|
|
tmp5 = "ok" !== status;
|
|
}
|
|
tmp4 = tmp5;
|
|
}
|
|
if (!tmp4) {
|
|
const obj3 = { code: sentryNonRecordingSpan(dependencyMap[6]).SPAN_STATUS_ERROR, message: "internal_error" };
|
|
sentryNonRecordingSpan.setStatus(obj3);
|
|
}
|
|
});
|
|
}
|
|
sentryNonRecordingSpan = closure_1_4({ parentSpan: tmp5, spanArguments, forceTransaction, scope: currentScope });
|
|
});
|
|
});
|
|
}
|
|
const obj2 = require("module_12945");
|
|
};
|
|
export const suppressTracing = function suppressTracing(arg0) {
|
|
_require = arg0;
|
|
const mainCarrier = require("module_12944").getMainCarrier();
|
|
const obj = require("module_12944");
|
|
const tmp = _require;
|
|
const asyncContextStrategy = require("module_12945").getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.suppressTracing) {
|
|
let suppressTracingResult = asyncContextStrategy.suppressTracing(arg0);
|
|
} else {
|
|
suppressTracingResult = tmp(12953).withScope((setSDKProcessingMetadata) => {
|
|
const result = setSDKProcessingMetadata.setSDKProcessingMetadata({ [closure_2_3]: true });
|
|
return closure_0();
|
|
});
|
|
const tmpResult = tmp(12953);
|
|
}
|
|
return suppressTracingResult;
|
|
};
|
|
export const withActiveSpan = function withActiveSpan(arg0, arg1) {
|
|
_require = arg0;
|
|
dependencyMap = arg1;
|
|
const mainCarrier = require("module_12944").getMainCarrier();
|
|
const obj = require("module_12944");
|
|
const tmp = _require;
|
|
const asyncContextStrategy = require("module_12945").getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.withActiveSpan) {
|
|
let withActiveSpanResult = asyncContextStrategy.withActiveSpan(arg0, arg1);
|
|
} else {
|
|
withActiveSpanResult = tmp(12953).withScope((arg0) => {
|
|
_null(dependencyMap[3])._setSpanForScope(arg0, c0);
|
|
return closure_1(arg0);
|
|
});
|
|
const tmpResult = tmp(12953);
|
|
}
|
|
return withActiveSpanResult;
|
|
};
|