Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
109 lines
4.5 KiB
JavaScript
109 lines
4.5 KiB
JavaScript
// Module ID: 12962
|
|
// Function ID: 12963
|
|
// Dependencies: [12932, 12963, 12953, 12931, 12939, 12941, 12958]
|
|
// Exports: freezeDscOnSpan, getDynamicSamplingContextFromClient, getDynamicSamplingContextFromScope, spanToBaggageHeader
|
|
|
|
// Module 12962
|
|
import _mod12932 from "module_12932" /* 12932 */;
|
|
import BAGGAGE_HEADER_NAME from "BAGGAGE_HEADER_NAME" /* 12939 */;
|
|
import _mod12953 from "module_12953" /* 12953 */;
|
|
|
|
const _mod12963 = tmp3(12963);
|
|
require = arg1;
|
|
const dependencyMap = arg6;
|
|
function getDynamicSamplingContextFromSpan(spanContext) {
|
|
const client = _mod12953.getClient();
|
|
if (client) {
|
|
const rootSpan = tmp(12931).getRootSpan(spanContext);
|
|
if (rootSpan[_frozenDsc]) {
|
|
return tmp5;
|
|
} else {
|
|
const traceState = rootSpan.spanContext().traceState;
|
|
value = traceState;
|
|
if (traceState) {
|
|
value = traceState.get("sentry.dsc");
|
|
}
|
|
let result = value;
|
|
if (value) {
|
|
result = tmp(12939).baggageHeaderToDynamicSamplingContext(value);
|
|
const tmpResult6 = tmp(12939);
|
|
}
|
|
if (result) {
|
|
return result;
|
|
} else {
|
|
const options = client.getOptions();
|
|
const tmp9 = client.getDsn() || {};
|
|
let DEFAULT_ENVIRONMENT = options.environment;
|
|
if (!DEFAULT_ENVIRONMENT) {
|
|
DEFAULT_ENVIRONMENT = tmp(12963).DEFAULT_ENVIRONMENT;
|
|
}
|
|
const obj2 = { environment: DEFAULT_ENVIRONMENT, release: options.release, public_key: tmp9.publicKey, trace_id: spanContext.spanContext().traceId };
|
|
const dropUndefinedKeysResult = tmp(12932).dropUndefinedKeys(obj2);
|
|
client.emit("createDsc", dropUndefinedKeysResult);
|
|
const tmpResult7 = tmp(12932);
|
|
const spanToJSONResult = tmp(12931).spanToJSON(rootSpan);
|
|
const tmp13 = spanToJSONResult.data || {};
|
|
const tmp14 = tmp13[tmp(undefined, 12941).SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE];
|
|
if (null != tmp14) {
|
|
const _HermesInternal = HermesInternal;
|
|
dropUndefinedKeysResult.sample_rate = "" + tmp14;
|
|
}
|
|
const description = spanToJSONResult.description;
|
|
const tmpResult8 = tmp(12931);
|
|
if (tmp17) {
|
|
dropUndefinedKeysResult.transaction = description;
|
|
}
|
|
tmp17 = "url" !== tmp13[tmp(undefined, 12941).SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] && description;
|
|
if (tmpResult9.hasTracingEnabled()) {
|
|
const _String = String;
|
|
dropUndefinedKeysResult.sampled = String(tmp(12931).spanIsSampled(rootSpan));
|
|
const tmpResult10 = tmp(12931);
|
|
}
|
|
client.emit("createDsc", dropUndefinedKeysResult, rootSpan);
|
|
return dropUndefinedKeysResult;
|
|
}
|
|
}
|
|
const tmpResult = tmp(12931);
|
|
} else {
|
|
return {};
|
|
}
|
|
}
|
|
const _frozenDsc = "_frozenDsc";
|
|
|
|
export const freezeDscOnSpan = function freezeDscOnSpan(arg0, arg1) {
|
|
const result = _mod12932.addNonEnumerableProperty(arg0, _frozenDsc, arg1);
|
|
};
|
|
export const getDynamicSamplingContextFromClient = function getDynamicSamplingContextFromClient(trace_id, getOptions) {
|
|
const options = getOptions.getOptions();
|
|
const tmp2 = getOptions.getDsn() || {};
|
|
let DEFAULT_ENVIRONMENT = options.environment;
|
|
if (!DEFAULT_ENVIRONMENT) {
|
|
DEFAULT_ENVIRONMENT = _mod12963.DEFAULT_ENVIRONMENT;
|
|
}
|
|
const dropUndefinedKeysResult = _mod12932.dropUndefinedKeys({ environment: DEFAULT_ENVIRONMENT, release: options.release, public_key: tmp2.publicKey, trace_id });
|
|
getOptions.emit("createDsc", dropUndefinedKeysResult);
|
|
return dropUndefinedKeysResult;
|
|
};
|
|
export const getDynamicSamplingContextFromScope = function getDynamicSamplingContextFromScope(getOptions, getPropagationContext) {
|
|
const propagationContext = getPropagationContext.getPropagationContext();
|
|
let dsc = propagationContext.dsc;
|
|
if (!dsc) {
|
|
const options = getOptions.getOptions();
|
|
const tmp4 = getOptions.getDsn() || {};
|
|
const tmp5 = require;
|
|
let DEFAULT_ENVIRONMENT = options.environment;
|
|
if (!DEFAULT_ENVIRONMENT) {
|
|
DEFAULT_ENVIRONMENT = tmp5(12963).DEFAULT_ENVIRONMENT;
|
|
}
|
|
const obj2 = { environment: DEFAULT_ENVIRONMENT, release: options.release, public_key: tmp4.publicKey, trace_id: propagationContext.traceId };
|
|
const dropUndefinedKeysResult = _mod12932.dropUndefinedKeys(obj2);
|
|
getOptions.emit("createDsc", dropUndefinedKeysResult);
|
|
dsc = dropUndefinedKeysResult;
|
|
}
|
|
return dsc;
|
|
};
|
|
export { getDynamicSamplingContextFromSpan };
|
|
export const spanToBaggageHeader = function spanToBaggageHeader(arg0) {
|
|
const tmp = getDynamicSamplingContextFromSpan(arg0);
|
|
return BAGGAGE_HEADER_NAME.dynamicSamplingContextToSentryBaggageHeader(tmp);
|
|
};
|