2026-07-25 08:10:48 +00:00
|
|
|
// Module ID: 6347
|
|
|
|
|
// Function ID: 57087
|
2026-07-20 16:05:17 +00:00
|
|
|
// Name: getDynamicSamplingContextFromClient
|
2026-07-25 08:10:48 +00:00
|
|
|
// Dependencies: [6317, 6348, 6338, 6316, 6324, 6326, 6343]
|
2026-07-20 16:05:17 +00:00
|
|
|
|
2026-07-25 08:10:48 +00:00
|
|
|
// Module 6347 (getDynamicSamplingContextFromClient)
|
2026-07-23 10:11:24 +00:00
|
|
|
const require = arg1;
|
|
|
|
|
const dependencyMap = arg6;
|
2026-07-20 16:05:17 +00:00
|
|
|
function getDynamicSamplingContextFromClient(trace_id, getOptions) {
|
|
|
|
|
const options = getOptions.getOptions();
|
2026-07-25 08:10:48 +00:00
|
|
|
let obj = require(6317) /* addNonEnumerableProperty */;
|
2026-07-20 16:05:17 +00:00
|
|
|
obj = {};
|
|
|
|
|
let DEFAULT_ENVIRONMENT = options.environment;
|
|
|
|
|
if (!DEFAULT_ENVIRONMENT) {
|
2026-07-25 08:10:48 +00:00
|
|
|
DEFAULT_ENVIRONMENT = require(6348).DEFAULT_ENVIRONMENT;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
obj.environment = DEFAULT_ENVIRONMENT;
|
|
|
|
|
obj.release = options.release;
|
|
|
|
|
obj.public_key = getOptions.getDsn() || {}.publicKey;
|
|
|
|
|
obj.trace_id = trace_id;
|
|
|
|
|
const dropUndefinedKeysResult = obj.dropUndefinedKeys(obj);
|
|
|
|
|
getOptions.emit("createDsc", dropUndefinedKeysResult);
|
|
|
|
|
return dropUndefinedKeysResult;
|
|
|
|
|
}
|
|
|
|
|
function getDynamicSamplingContextFromSpan(spanContext) {
|
2026-07-25 08:10:48 +00:00
|
|
|
const client = require(6338) /* getCurrentScope */.getClient();
|
2026-07-20 16:05:17 +00:00
|
|
|
if (client) {
|
2026-07-25 08:10:48 +00:00
|
|
|
const rootSpan = require(6316) /* spanTimeInputToSeconds */.getRootSpan(spanContext);
|
2026-07-23 10:11:24 +00:00
|
|
|
if (rootSpan[_frozenDsc]) {
|
2026-07-20 16:05:17 +00:00
|
|
|
return tmp4;
|
|
|
|
|
} else {
|
|
|
|
|
const traceState = rootSpan.spanContext().traceState;
|
|
|
|
|
let value = traceState;
|
|
|
|
|
if (traceState) {
|
|
|
|
|
value = traceState.get("sentry.dsc");
|
|
|
|
|
}
|
|
|
|
|
let result = value;
|
|
|
|
|
if (value) {
|
2026-07-25 08:10:48 +00:00
|
|
|
result = require(6324) /* parseBaggageHeader */.baggageHeaderToDynamicSamplingContext(value);
|
|
|
|
|
const obj5 = require(6324) /* parseBaggageHeader */;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
if (result) {
|
|
|
|
|
return result;
|
|
|
|
|
} else {
|
|
|
|
|
const tmp10 = getDynamicSamplingContextFromClient(spanContext.spanContext().traceId, client);
|
2026-07-25 08:10:48 +00:00
|
|
|
const spanToJSONResult = require(6316) /* spanTimeInputToSeconds */.spanToJSON(rootSpan);
|
2026-07-20 16:05:17 +00:00
|
|
|
const tmp14 = spanToJSONResult.data || {};
|
2026-07-25 08:10:48 +00:00
|
|
|
const tmp17 = tmp14[require(undefined, 6326).SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE];
|
2026-07-23 10:11:24 +00:00
|
|
|
if (null != tmp17) {
|
2026-07-20 16:05:17 +00:00
|
|
|
const _HermesInternal = HermesInternal;
|
|
|
|
|
tmp10.sample_rate = "" + tmp17;
|
|
|
|
|
}
|
|
|
|
|
const description = spanToJSONResult.description;
|
2026-07-25 08:10:48 +00:00
|
|
|
const obj6 = require(6316) /* spanTimeInputToSeconds */;
|
2026-07-20 16:05:17 +00:00
|
|
|
if (tmp22) {
|
|
|
|
|
tmp10.transaction = description;
|
|
|
|
|
}
|
2026-07-25 08:10:48 +00:00
|
|
|
tmp22 = "url" !== tmp14[require(undefined, 6326).SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] && description;
|
2026-07-20 16:05:17 +00:00
|
|
|
if (obj7.hasTracingEnabled()) {
|
|
|
|
|
const _String = String;
|
2026-07-25 08:10:48 +00:00
|
|
|
tmp10.sampled = String(require(6316) /* spanTimeInputToSeconds */.spanIsSampled(rootSpan));
|
|
|
|
|
const obj8 = require(6316) /* spanTimeInputToSeconds */;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
client.emit("createDsc", tmp10, rootSpan);
|
|
|
|
|
return tmp10;
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-07-25 08:10:48 +00:00
|
|
|
const obj3 = require(6316) /* spanTimeInputToSeconds */;
|
2026-07-20 16:05:17 +00:00
|
|
|
} else {
|
|
|
|
|
return {};
|
|
|
|
|
}
|
2026-07-25 08:10:48 +00:00
|
|
|
const obj = require(6338) /* getCurrentScope */;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-23 10:11:24 +00:00
|
|
|
const _frozenDsc = "_frozenDsc";
|
2026-07-20 16:05:17 +00:00
|
|
|
arg5.freezeDscOnSpan = function freezeDscOnSpan(arg0, arg1) {
|
2026-07-25 08:10:48 +00:00
|
|
|
const result = require(6317) /* addNonEnumerableProperty */.addNonEnumerableProperty(arg0, _frozenDsc, arg1);
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|
|
|
|
|
arg5.getDynamicSamplingContextFromClient = getDynamicSamplingContextFromClient;
|
|
|
|
|
arg5.getDynamicSamplingContextFromScope = function getDynamicSamplingContextFromScope(arg0, getPropagationContext) {
|
|
|
|
|
const propagationContext = getPropagationContext.getPropagationContext();
|
|
|
|
|
let dsc = propagationContext.dsc;
|
|
|
|
|
if (!dsc) {
|
|
|
|
|
dsc = getDynamicSamplingContextFromClient(propagationContext.traceId, arg0);
|
|
|
|
|
}
|
|
|
|
|
return dsc;
|
|
|
|
|
};
|
|
|
|
|
arg5.getDynamicSamplingContextFromSpan = getDynamicSamplingContextFromSpan;
|
|
|
|
|
arg5.spanToBaggageHeader = function spanToBaggageHeader(arg0) {
|
|
|
|
|
const tmp = getDynamicSamplingContextFromSpan(arg0);
|
2026-07-25 08:10:48 +00:00
|
|
|
return require(6324) /* parseBaggageHeader */.dynamicSamplingContextToSentryBaggageHeader(tmp);
|
2026-07-20 16:05:17 +00:00
|
|
|
};
|