Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4792.js (118.4 MB)
475 lines
19 KiB
JavaScript
475 lines
19 KiB
JavaScript
// Module ID: 12926
|
|
// Function ID: 12927
|
|
// Dependencies: [32, 12919, 12925, 12914, 12927, 12897, 12909, 12910, 12911, 12904, 12902, 12920, 12892, 12924, 12928, 12930, 12921, 12931, 12933, 12907]
|
|
// Exports: continueTrace, startInactiveSpan, startNewTrace, startSpan, startSpanManual, suppressTracing, withActiveSpan
|
|
|
|
// Module 12926
|
|
import generatePropagationContext from "generatePropagationContext" /* 12902 */;
|
|
import _mod12904 from "module_12904" /* 12904 */;
|
|
import _mod12907 from "module_12907" /* 12907 */;
|
|
import _mod12910 from "module_12910" /* 12910 */;
|
|
import _mod12911 from "module_12911" /* 12911 */;
|
|
import _mod12914 from "module_12914" /* 12914 */;
|
|
import _mod12919 from "module_12919" /* 12919 */;
|
|
import _mod12920 from "module_12920" /* 12920 */;
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
function createChildOrRootSpan(forceTransaction) {
|
|
({ parentSpan, spanArguments, scope } = forceTransaction);
|
|
if (obj.hasTracingEnabled()) {
|
|
const isolationScope = tmp(12919).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(12897).spanIsSampled(parentSpan);
|
|
const tmpResult11 = tmp(12897);
|
|
}
|
|
if (spanIsSampledResult) {
|
|
const obj2 = {};
|
|
const merged = Object.assign(spanArguments);
|
|
obj2.parentSpanId = spanId;
|
|
obj2.traceId = traceId;
|
|
obj2.sampled = spanIsSampledResult;
|
|
let sentrySpan = new tmp(12933).SentrySpan(obj2);
|
|
} else {
|
|
const obj3 = { traceId };
|
|
sentrySpan = new tmp(12925).SentryNonRecordingSpan(obj3);
|
|
}
|
|
const spanContextResult = parentSpan.spanContext();
|
|
tmp(12897).addChildSpanToSpan(parentSpan, sentrySpan);
|
|
const tmpResult12 = tmp(12897);
|
|
const client = tmp(12919).getClient();
|
|
if (client) {
|
|
client.emit("spanStart", sentrySpan);
|
|
if (spanArguments.endTimestamp) {
|
|
client.emit("spanEnd", sentrySpan);
|
|
}
|
|
}
|
|
const tmpResult13 = tmp(12919);
|
|
tmp(12897).addChildSpanToSpan(parentSpan, sentrySpan);
|
|
const tmpResult14 = tmp(12897);
|
|
}
|
|
tmp(12930).logSpanStart(sentrySpan);
|
|
const tmpResult15 = tmp(12930);
|
|
const result = tmp(12921).setCapturedScopesOnSpan(sentrySpan, scope, isolationScope);
|
|
return sentrySpan;
|
|
}
|
|
if (parentSpan) {
|
|
const dynamicSamplingContextFromSpan = tmp(12928).getDynamicSamplingContextFromSpan(parentSpan);
|
|
const tmpResult17 = tmp(12928);
|
|
({ traceId: traceId2, spanId: spanId2 } = parentSpan.spanContext());
|
|
const spanContextResult1 = parentSpan.spanContext();
|
|
const obj4 = { traceId: traceId2, parentSpanId: spanId2 };
|
|
const tmpResult18 = tmp(12897);
|
|
const merged1 = Object.assign(spanArguments);
|
|
const tmp42 = _startRootSpan(obj4, scope, tmp(12897).spanIsSampled(parentSpan));
|
|
const spanIsSampledResult1 = tmp(12897).spanIsSampled(parentSpan);
|
|
tmp(12928).freezeDscOnSpan(tmp42, dynamicSamplingContextFromSpan);
|
|
sentrySpan = tmp42;
|
|
const tmpResult19 = tmp(12928);
|
|
} 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(12928).freezeDscOnSpan(tmp33, dsc);
|
|
sentrySpan = tmp33;
|
|
const tmpResult20 = tmp(12928);
|
|
}
|
|
}
|
|
const tmpResult = tmp(12919);
|
|
} else {
|
|
const sentryNonRecordingSpan = new tmp(12925).SentryNonRecordingSpan();
|
|
return sentryNonRecordingSpan;
|
|
}
|
|
}
|
|
function _startRootSpan(name, arg1, parentSampled) {
|
|
const client = _mod12919.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(12931).sampleSpan(options, obj2);
|
|
const tmpResult = tmp(12931);
|
|
}
|
|
[tmp6, tmp7] = sampleSpanResult;
|
|
const obj4 = {};
|
|
const merged = Object.assign(name);
|
|
const tmp5 = _slicedToArray(sampleSpanResult, 2);
|
|
const merged1 = Object.assign(name.attributes);
|
|
obj4.attributes = { [_mod12907.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: "custom" };
|
|
obj4.sampled = tmp6;
|
|
const sentrySpan = new tmp(12933).SentrySpan(obj4);
|
|
if (undefined !== tmp7) {
|
|
const attr = sentrySpan.setAttribute(tmp(12907).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_12910").getMainCarrier();
|
|
const obj = require("module_12910");
|
|
const tmp = _require;
|
|
const asyncContextStrategy = require("module_12911").getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.continueTrace) {
|
|
return asyncContextStrategy.continueTrace(arg0, arg1);
|
|
} else {
|
|
({ sentryTrace: dependencyMap, baggage: _slicedToArray } = arg0);
|
|
return tmp(12919).withScope((setPropagationContext) => {
|
|
const result = setPropagationContext.setPropagationContext(_mod12904.propagationContextFromHeaders(dependencyMap, _slicedToArray));
|
|
return closure_0();
|
|
});
|
|
}
|
|
const obj2 = require("module_12911");
|
|
};
|
|
export const startInactiveSpan = function startInactiveSpan(experimental) {
|
|
_require = experimental;
|
|
let mainCarrier = require("module_12910").getMainCarrier();
|
|
let obj = require("module_12910");
|
|
const tmp3 = _require;
|
|
const tmp4 = obj4;
|
|
let asyncContextStrategy = require("module_12911").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) => _mod12919.withScope(experimental.scope, arg0);
|
|
} else {
|
|
fn = undefined !== parentSpan ? ((arg0) => {
|
|
closure_0 = parentSpan;
|
|
closure_1 = arg0;
|
|
const mainCarrier = _mod12910.getMainCarrier();
|
|
const tmp = parentSpan;
|
|
const asyncContextStrategy = _mod12911.getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.withActiveSpan) {
|
|
let withActiveSpanResult = asyncContextStrategy.withActiveSpan(tmp, arg0);
|
|
} else {
|
|
withActiveSpanResult = _mod12919.withScope((arg0) => {
|
|
_null(dependencyMap[3])._setSpanForScope(arg0, c0);
|
|
return closure_1(arg0);
|
|
});
|
|
const tmp2Result = _mod12919;
|
|
}
|
|
return withActiveSpanResult;
|
|
}) : ((fn) => fn());
|
|
}
|
|
return fn(() => {
|
|
const currentScope = _mod12919.getCurrentScope();
|
|
const _getSpanForScopeResult = _mod12914._getSpanForScope(currentScope);
|
|
let tmp5;
|
|
if (_getSpanForScopeResult) {
|
|
const client = tmp(12919).getClient();
|
|
if (client) {
|
|
let options = client.getOptions();
|
|
} else {
|
|
options = {};
|
|
}
|
|
let rootSpan = _getSpanForScopeResult;
|
|
if (options.parentSpanIsAlwaysRootSpan) {
|
|
rootSpan = tmp(12897).getRootSpan(_getSpanForScopeResult);
|
|
const tmpResult2 = tmp(12897);
|
|
}
|
|
tmp5 = rootSpan;
|
|
const tmpResult = tmp(12919);
|
|
}
|
|
if (experimental.onlyIfParent) {
|
|
if (!tmp5) {
|
|
let sentryNonRecordingSpan = new tmp(12925).SentryNonRecordingSpan();
|
|
}
|
|
return sentryNonRecordingSpan;
|
|
}
|
|
sentryNonRecordingSpan = createChildOrRootSpan({ parentSpan: tmp5, spanArguments: obj4, forceTransaction, scope: currentScope });
|
|
});
|
|
}
|
|
const obj2 = require("module_12911");
|
|
};
|
|
export const startNewTrace = function startNewTrace(arg0) {
|
|
_require = arg0;
|
|
return require("module_12919").withScope((setPropagationContext) => {
|
|
const obj = { traceId: generatePropagationContext.generateTraceId() };
|
|
const result = setPropagationContext.setPropagationContext(obj);
|
|
if (_mod12920.DEBUG_BUILD) {
|
|
const logger = tmp(12892).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 = _mod12910.getMainCarrier();
|
|
const tmpResult = _mod12910;
|
|
const asyncContextStrategy = _mod12911.getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.withActiveSpan) {
|
|
let withActiveSpanResult = asyncContextStrategy.withActiveSpan(null, tmp6);
|
|
} else {
|
|
withActiveSpanResult = tmp(12919).withScope((arg0) => {
|
|
_null(dependencyMap[3])._setSpanForScope(arg0, c0);
|
|
return closure_1(arg0);
|
|
});
|
|
const tmpResult4 = tmp(12919);
|
|
}
|
|
return withActiveSpanResult;
|
|
});
|
|
};
|
|
export const startSpan = function startSpan(experimental, arg1) {
|
|
_require = experimental;
|
|
dependencyMap = arg1;
|
|
const mainCarrier = require("module_12910").getMainCarrier();
|
|
let obj = require("module_12910");
|
|
const asyncContextStrategy = require("module_12911").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(12897).spanTimeInputToSeconds(experimental.startTime);
|
|
delete tmp[tmp2];
|
|
tmp10 = obj4;
|
|
const tmp3Result = tmp3(12897);
|
|
}
|
|
obj4 = tmp10;
|
|
({ forceTransaction: __SENTRY_SUPPRESS_TRACING__, parentSpan: createChildOrRootSpan } = experimental);
|
|
return tmp3(12919).withScope(experimental.scope, () => {
|
|
closure_0 = createChildOrRootSpan;
|
|
return undefined !== createChildOrRootSpan ? ((arg0) => {
|
|
dependencyMap = arg0;
|
|
const mainCarrier = closure_0(12910).getMainCarrier();
|
|
const obj = closure_0(12910);
|
|
const tmp = closure_0;
|
|
const tmp2 = closure_0;
|
|
const asyncContextStrategy = closure_0(12911).getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.withActiveSpan) {
|
|
let withActiveSpanResult = asyncContextStrategy.withActiveSpan(tmp, arg0);
|
|
} else {
|
|
withActiveSpanResult = tmp2(12919).withScope((arg0) => {
|
|
_null(dependencyMap[3])._setSpanForScope(arg0, c0);
|
|
return closure_1(arg0);
|
|
});
|
|
const tmp2Result = tmp2(12919);
|
|
}
|
|
return withActiveSpanResult;
|
|
}) : ((fn) => fn())(() => {
|
|
const currentScope = sentryNonRecordingSpan(12919).getCurrentScope();
|
|
const obj = sentryNonRecordingSpan(12919);
|
|
const _getSpanForScopeResult = sentryNonRecordingSpan(12914)._getSpanForScope(currentScope);
|
|
let tmp5;
|
|
if (_getSpanForScopeResult) {
|
|
const client = tmp(12919).getClient();
|
|
if (client) {
|
|
let options = client.getOptions();
|
|
} else {
|
|
options = {};
|
|
}
|
|
let rootSpan = _getSpanForScopeResult;
|
|
if (options.parentSpanIsAlwaysRootSpan) {
|
|
rootSpan = tmp(12897).getRootSpan(_getSpanForScopeResult);
|
|
const tmpResult4 = tmp(12897);
|
|
}
|
|
tmp5 = rootSpan;
|
|
const tmpResult = tmp(12919);
|
|
}
|
|
if (sentryNonRecordingSpan.onlyIfParent) {
|
|
if (!tmp5) {
|
|
sentryNonRecordingSpan = new tmp(12925).SentryNonRecordingSpan();
|
|
}
|
|
tmp(12914)._setSpanForScope(currentScope, sentryNonRecordingSpan);
|
|
const tmpResult5 = tmp(12914);
|
|
return tmp(12927).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_12911");
|
|
};
|
|
export const startSpanManual = function startSpanManual(experimental, arg1) {
|
|
_require = experimental;
|
|
dependencyMap = arg1;
|
|
let mainCarrier = require("module_12910").getMainCarrier();
|
|
let obj = require("module_12910");
|
|
let asyncContextStrategy = require("module_12911").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(12897).spanTimeInputToSeconds(experimental.startTime);
|
|
delete tmp[tmp2];
|
|
tmp10 = obj4;
|
|
const tmp3Result = tmp3(12897);
|
|
}
|
|
obj4 = tmp10;
|
|
({ forceTransaction: __SENTRY_SUPPRESS_TRACING__, parentSpan: createChildOrRootSpan } = experimental);
|
|
return tmp3(12919).withScope(experimental.scope, () => {
|
|
closure_0 = createChildOrRootSpan;
|
|
return undefined !== createChildOrRootSpan ? ((arg0) => {
|
|
dependencyMap = arg0;
|
|
const mainCarrier = closure_0(12910).getMainCarrier();
|
|
const obj = closure_0(12910);
|
|
const tmp = closure_0;
|
|
const tmp2 = closure_0;
|
|
const asyncContextStrategy = closure_0(12911).getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.withActiveSpan) {
|
|
let withActiveSpanResult = asyncContextStrategy.withActiveSpan(tmp, arg0);
|
|
} else {
|
|
withActiveSpanResult = tmp2(12919).withScope((arg0) => {
|
|
_null(dependencyMap[3])._setSpanForScope(arg0, c0);
|
|
return closure_1(arg0);
|
|
});
|
|
const tmp2Result = tmp2(12919);
|
|
}
|
|
return withActiveSpanResult;
|
|
}) : ((fn) => fn())(() => {
|
|
function finishAndSetSpan() {
|
|
sentryNonRecordingSpan.end();
|
|
}
|
|
const currentScope = sentryNonRecordingSpan(12919).getCurrentScope();
|
|
const obj = sentryNonRecordingSpan(12919);
|
|
const _getSpanForScopeResult = sentryNonRecordingSpan(12914)._getSpanForScope(currentScope);
|
|
let tmp5;
|
|
if (_getSpanForScopeResult) {
|
|
const client = tmp(12919).getClient();
|
|
if (client) {
|
|
let options = client.getOptions();
|
|
} else {
|
|
options = {};
|
|
}
|
|
let rootSpan = _getSpanForScopeResult;
|
|
if (options.parentSpanIsAlwaysRootSpan) {
|
|
rootSpan = tmp(12897).getRootSpan(_getSpanForScopeResult);
|
|
const tmpResult4 = tmp(12897);
|
|
}
|
|
tmp5 = rootSpan;
|
|
const tmpResult = tmp(12919);
|
|
}
|
|
if (sentryNonRecordingSpan.onlyIfParent) {
|
|
if (!tmp5) {
|
|
sentryNonRecordingSpan = new tmp(12925).SentryNonRecordingSpan();
|
|
}
|
|
tmp(12914)._setSpanForScope(currentScope, sentryNonRecordingSpan);
|
|
const tmpResult5 = tmp(12914);
|
|
return tmp(12927).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_12911");
|
|
};
|
|
export const suppressTracing = function suppressTracing(arg0) {
|
|
_require = arg0;
|
|
const mainCarrier = require("module_12910").getMainCarrier();
|
|
const obj = require("module_12910");
|
|
const tmp = _require;
|
|
const asyncContextStrategy = require("module_12911").getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.suppressTracing) {
|
|
let suppressTracingResult = asyncContextStrategy.suppressTracing(arg0);
|
|
} else {
|
|
suppressTracingResult = tmp(12919).withScope((setSDKProcessingMetadata) => {
|
|
const result = setSDKProcessingMetadata.setSDKProcessingMetadata({ [closure_2_3]: true });
|
|
return closure_0();
|
|
});
|
|
const tmpResult = tmp(12919);
|
|
}
|
|
return suppressTracingResult;
|
|
};
|
|
export const withActiveSpan = function withActiveSpan(arg0, arg1) {
|
|
_require = arg0;
|
|
dependencyMap = arg1;
|
|
const mainCarrier = require("module_12910").getMainCarrier();
|
|
const obj = require("module_12910");
|
|
const tmp = _require;
|
|
const asyncContextStrategy = require("module_12911").getAsyncContextStrategy(mainCarrier);
|
|
if (asyncContextStrategy.withActiveSpan) {
|
|
let withActiveSpanResult = asyncContextStrategy.withActiveSpan(arg0, arg1);
|
|
} else {
|
|
withActiveSpanResult = tmp(12919).withScope((arg0) => {
|
|
_null(dependencyMap[3])._setSpanForScope(arg0, c0);
|
|
return closure_1(arg0);
|
|
});
|
|
const tmpResult = tmp(12919);
|
|
}
|
|
return withActiveSpanResult;
|
|
};
|