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: 12963
|
|
// Function ID: 12964
|
|
// Dependencies: [12933, 12964, 12954, 12932, 12940, 12942, 12959]
|
|
// Exports: freezeDscOnSpan, getDynamicSamplingContextFromClient, getDynamicSamplingContextFromScope, spanToBaggageHeader
|
|
|
|
// Module 12963
|
|
import _mod12933 from "module_12933" /* 12933 */;
|
|
import BAGGAGE_HEADER_NAME from "BAGGAGE_HEADER_NAME" /* 12940 */;
|
|
import _mod12954 from "module_12954" /* 12954 */;
|
|
|
|
const _mod12964 = tmp3(12964);
|
|
require = arg1;
|
|
const dependencyMap = arg6;
|
|
function getDynamicSamplingContextFromSpan(spanContext) {
|
|
const client = _mod12954.getClient();
|
|
if (client) {
|
|
const rootSpan = tmp(12932).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(12940).baggageHeaderToDynamicSamplingContext(value);
|
|
const tmpResult6 = tmp(12940);
|
|
}
|
|
if (result) {
|
|
return result;
|
|
} else {
|
|
const options = client.getOptions();
|
|
const tmp9 = client.getDsn() || {};
|
|
let DEFAULT_ENVIRONMENT = options.environment;
|
|
if (!DEFAULT_ENVIRONMENT) {
|
|
DEFAULT_ENVIRONMENT = tmp(12964).DEFAULT_ENVIRONMENT;
|
|
}
|
|
const obj2 = { environment: DEFAULT_ENVIRONMENT, release: options.release, public_key: tmp9.publicKey, trace_id: spanContext.spanContext().traceId };
|
|
const dropUndefinedKeysResult = tmp(12933).dropUndefinedKeys(obj2);
|
|
client.emit("createDsc", dropUndefinedKeysResult);
|
|
const tmpResult7 = tmp(12933);
|
|
const spanToJSONResult = tmp(12932).spanToJSON(rootSpan);
|
|
const tmp13 = spanToJSONResult.data || {};
|
|
const tmp14 = tmp13[tmp(undefined, 12942).SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE];
|
|
if (null != tmp14) {
|
|
const _HermesInternal = HermesInternal;
|
|
dropUndefinedKeysResult.sample_rate = "" + tmp14;
|
|
}
|
|
const description = spanToJSONResult.description;
|
|
const tmpResult8 = tmp(12932);
|
|
if (tmp17) {
|
|
dropUndefinedKeysResult.transaction = description;
|
|
}
|
|
tmp17 = "url" !== tmp13[tmp(undefined, 12942).SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] && description;
|
|
if (tmpResult9.hasTracingEnabled()) {
|
|
const _String = String;
|
|
dropUndefinedKeysResult.sampled = String(tmp(12932).spanIsSampled(rootSpan));
|
|
const tmpResult10 = tmp(12932);
|
|
}
|
|
client.emit("createDsc", dropUndefinedKeysResult, rootSpan);
|
|
return dropUndefinedKeysResult;
|
|
}
|
|
}
|
|
const tmpResult = tmp(12932);
|
|
} else {
|
|
return {};
|
|
}
|
|
}
|
|
const _frozenDsc = "_frozenDsc";
|
|
|
|
export const freezeDscOnSpan = function freezeDscOnSpan(arg0, arg1) {
|
|
const result = _mod12933.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 = _mod12964.DEFAULT_ENVIRONMENT;
|
|
}
|
|
const dropUndefinedKeysResult = _mod12933.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(12964).DEFAULT_ENVIRONMENT;
|
|
}
|
|
const obj2 = { environment: DEFAULT_ENVIRONMENT, release: options.release, public_key: tmp4.publicKey, trace_id: propagationContext.traceId };
|
|
const dropUndefinedKeysResult = _mod12933.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);
|
|
};
|