@elizaos/server 1.6.1 → 1.6.2-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/assets/{main-CLvs0bX8.js → main-CpHBkAFA.js} +3 -3
- package/dist/client/assets/{main-CLvs0bX8.js.map → main-CpHBkAFA.js.map} +1 -1
- package/dist/client/assets/{main-llvbgk6E.js → main-SfTqS-Wp.js} +65 -65
- package/dist/client/assets/{main-llvbgk6E.js.map → main-SfTqS-Wp.js.map} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/index.js +606 -649
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -12295,21 +12295,21 @@ var require_ParentBasedSampler = __commonJS((exports) => {
|
|
|
12295
12295
|
this._localParentSampled = config.localParentSampled ?? new AlwaysOnSampler_1.AlwaysOnSampler;
|
|
12296
12296
|
this._localParentNotSampled = config.localParentNotSampled ?? new AlwaysOffSampler_1.AlwaysOffSampler;
|
|
12297
12297
|
}
|
|
12298
|
-
shouldSample(
|
|
12299
|
-
const parentContext = api_1.trace.getSpanContext(
|
|
12298
|
+
shouldSample(context2, traceId, spanName, spanKind, attributes, links) {
|
|
12299
|
+
const parentContext = api_1.trace.getSpanContext(context2);
|
|
12300
12300
|
if (!parentContext || !(0, api_1.isSpanContextValid)(parentContext)) {
|
|
12301
|
-
return this._root.shouldSample(
|
|
12301
|
+
return this._root.shouldSample(context2, traceId, spanName, spanKind, attributes, links);
|
|
12302
12302
|
}
|
|
12303
12303
|
if (parentContext.isRemote) {
|
|
12304
12304
|
if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) {
|
|
12305
|
-
return this._remoteParentSampled.shouldSample(
|
|
12305
|
+
return this._remoteParentSampled.shouldSample(context2, traceId, spanName, spanKind, attributes, links);
|
|
12306
12306
|
}
|
|
12307
|
-
return this._remoteParentNotSampled.shouldSample(
|
|
12307
|
+
return this._remoteParentNotSampled.shouldSample(context2, traceId, spanName, spanKind, attributes, links);
|
|
12308
12308
|
}
|
|
12309
12309
|
if (parentContext.traceFlags & api_1.TraceFlags.SAMPLED) {
|
|
12310
|
-
return this._localParentSampled.shouldSample(
|
|
12310
|
+
return this._localParentSampled.shouldSample(context2, traceId, spanName, spanKind, attributes, links);
|
|
12311
12311
|
}
|
|
12312
|
-
return this._localParentNotSampled.shouldSample(
|
|
12312
|
+
return this._localParentNotSampled.shouldSample(context2, traceId, spanName, spanKind, attributes, links);
|
|
12313
12313
|
}
|
|
12314
12314
|
toString() {
|
|
12315
12315
|
return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`;
|
|
@@ -12333,7 +12333,7 @@ var require_TraceIdRatioBasedSampler = __commonJS((exports) => {
|
|
|
12333
12333
|
this._ratio = this._normalize(_ratio);
|
|
12334
12334
|
this._upperBound = Math.floor(this._ratio * 4294967295);
|
|
12335
12335
|
}
|
|
12336
|
-
shouldSample(
|
|
12336
|
+
shouldSample(context2, traceId) {
|
|
12337
12337
|
return {
|
|
12338
12338
|
decision: (0, api_1.isValidTraceId)(traceId) && this._accumulate(traceId) < this._upperBound ? Sampler_1.SamplingDecision.RECORD_AND_SAMPLED : Sampler_1.SamplingDecision.NOT_RECORD
|
|
12339
12339
|
};
|
|
@@ -12729,12 +12729,12 @@ var require_Tracer = __commonJS((exports) => {
|
|
|
12729
12729
|
this._spanProcessor = spanProcessor;
|
|
12730
12730
|
this.instrumentationScope = instrumentationScope;
|
|
12731
12731
|
}
|
|
12732
|
-
startSpan(name, options = {},
|
|
12732
|
+
startSpan(name, options = {}, context2 = api.context.active()) {
|
|
12733
12733
|
if (options.root) {
|
|
12734
|
-
|
|
12734
|
+
context2 = api.trace.deleteSpan(context2);
|
|
12735
12735
|
}
|
|
12736
|
-
const parentSpan = api.trace.getSpan(
|
|
12737
|
-
if ((0, core_1.isTracingSuppressed)(
|
|
12736
|
+
const parentSpan = api.trace.getSpan(context2);
|
|
12737
|
+
if ((0, core_1.isTracingSuppressed)(context2)) {
|
|
12738
12738
|
api.diag.debug("Instrumentation suppressed, returning Noop Span");
|
|
12739
12739
|
const nonRecordingSpan = api.trace.wrapSpanContext(api.INVALID_SPAN_CONTEXT);
|
|
12740
12740
|
return nonRecordingSpan;
|
|
@@ -12759,7 +12759,7 @@ var require_Tracer = __commonJS((exports) => {
|
|
|
12759
12759
|
};
|
|
12760
12760
|
});
|
|
12761
12761
|
const attributes = (0, core_1.sanitizeAttributes)(options.attributes);
|
|
12762
|
-
const samplingResult = this._sampler.shouldSample(
|
|
12762
|
+
const samplingResult = this._sampler.shouldSample(context2, traceId, name, spanKind, attributes, links);
|
|
12763
12763
|
traceState = samplingResult.traceState ?? traceState;
|
|
12764
12764
|
const traceFlags = samplingResult.decision === api.SamplingDecision.RECORD_AND_SAMPLED ? api.TraceFlags.SAMPLED : api.TraceFlags.NONE;
|
|
12765
12765
|
const spanContext = { traceId, spanId, traceFlags, traceState };
|
|
@@ -12772,7 +12772,7 @@ var require_Tracer = __commonJS((exports) => {
|
|
|
12772
12772
|
const span = new Span_1.SpanImpl({
|
|
12773
12773
|
resource: this._resource,
|
|
12774
12774
|
scope: this.instrumentationScope,
|
|
12775
|
-
context:
|
|
12775
|
+
context: context2,
|
|
12776
12776
|
spanContext,
|
|
12777
12777
|
name,
|
|
12778
12778
|
kind: spanKind,
|
|
@@ -12841,9 +12841,9 @@ var require_MultiSpanProcessor = __commonJS((exports) => {
|
|
|
12841
12841
|
});
|
|
12842
12842
|
});
|
|
12843
12843
|
}
|
|
12844
|
-
onStart(span,
|
|
12844
|
+
onStart(span, context2) {
|
|
12845
12845
|
for (const spanProcessor of this._spanProcessors) {
|
|
12846
|
-
spanProcessor.onStart(span,
|
|
12846
|
+
spanProcessor.onStart(span, context2);
|
|
12847
12847
|
}
|
|
12848
12848
|
}
|
|
12849
12849
|
onEnd(span) {
|
|
@@ -13171,19 +13171,19 @@ var require_AbstractAsyncHooksContextManager = __commonJS((exports) => {
|
|
|
13171
13171
|
];
|
|
13172
13172
|
|
|
13173
13173
|
class AbstractAsyncHooksContextManager {
|
|
13174
|
-
bind(
|
|
13174
|
+
bind(context6, target) {
|
|
13175
13175
|
if (target instanceof events_1.EventEmitter) {
|
|
13176
|
-
return this._bindEventEmitter(
|
|
13176
|
+
return this._bindEventEmitter(context6, target);
|
|
13177
13177
|
}
|
|
13178
13178
|
if (typeof target === "function") {
|
|
13179
|
-
return this._bindFunction(
|
|
13179
|
+
return this._bindFunction(context6, target);
|
|
13180
13180
|
}
|
|
13181
13181
|
return target;
|
|
13182
13182
|
}
|
|
13183
|
-
_bindFunction(
|
|
13183
|
+
_bindFunction(context6, target) {
|
|
13184
13184
|
const manager = this;
|
|
13185
13185
|
const contextWrapper = function(...args) {
|
|
13186
|
-
return manager.with(
|
|
13186
|
+
return manager.with(context6, () => target.apply(this, args));
|
|
13187
13187
|
};
|
|
13188
13188
|
Object.defineProperty(contextWrapper, "length", {
|
|
13189
13189
|
enumerable: false,
|
|
@@ -13193,7 +13193,7 @@ var require_AbstractAsyncHooksContextManager = __commonJS((exports) => {
|
|
|
13193
13193
|
});
|
|
13194
13194
|
return contextWrapper;
|
|
13195
13195
|
}
|
|
13196
|
-
_bindEventEmitter(
|
|
13196
|
+
_bindEventEmitter(context6, ee) {
|
|
13197
13197
|
const map = this._getPatchMap(ee);
|
|
13198
13198
|
if (map !== undefined)
|
|
13199
13199
|
return ee;
|
|
@@ -13201,7 +13201,7 @@ var require_AbstractAsyncHooksContextManager = __commonJS((exports) => {
|
|
|
13201
13201
|
ADD_LISTENER_METHODS.forEach((methodName) => {
|
|
13202
13202
|
if (ee[methodName] === undefined)
|
|
13203
13203
|
return;
|
|
13204
|
-
ee[methodName] = this._patchAddListener(ee, ee[methodName],
|
|
13204
|
+
ee[methodName] = this._patchAddListener(ee, ee[methodName], context6);
|
|
13205
13205
|
});
|
|
13206
13206
|
if (typeof ee.removeListener === "function") {
|
|
13207
13207
|
ee.removeListener = this._patchRemoveListener(ee, ee.removeListener);
|
|
@@ -13239,7 +13239,7 @@ var require_AbstractAsyncHooksContextManager = __commonJS((exports) => {
|
|
|
13239
13239
|
return original.apply(this, arguments);
|
|
13240
13240
|
};
|
|
13241
13241
|
}
|
|
13242
|
-
_patchAddListener(ee, original,
|
|
13242
|
+
_patchAddListener(ee, original, context6) {
|
|
13243
13243
|
const contextManager = this;
|
|
13244
13244
|
return function(event, listener) {
|
|
13245
13245
|
if (contextManager._wrapped) {
|
|
@@ -13254,7 +13254,7 @@ var require_AbstractAsyncHooksContextManager = __commonJS((exports) => {
|
|
|
13254
13254
|
listeners = new WeakMap;
|
|
13255
13255
|
map[event] = listeners;
|
|
13256
13256
|
}
|
|
13257
|
-
const patchedListener = contextManager.bind(
|
|
13257
|
+
const patchedListener = contextManager.bind(context6, listener);
|
|
13258
13258
|
listeners.set(listener, patchedListener);
|
|
13259
13259
|
contextManager._wrapped = true;
|
|
13260
13260
|
try {
|
|
@@ -13303,8 +13303,8 @@ var require_AsyncHooksContextManager = __commonJS((exports) => {
|
|
|
13303
13303
|
active() {
|
|
13304
13304
|
return this._stack[this._stack.length - 1] ?? api_1.ROOT_CONTEXT;
|
|
13305
13305
|
}
|
|
13306
|
-
with(
|
|
13307
|
-
this._enterContext(
|
|
13306
|
+
with(context6, fn, thisArg, ...args) {
|
|
13307
|
+
this._enterContext(context6);
|
|
13308
13308
|
try {
|
|
13309
13309
|
return fn.call(thisArg, ...args);
|
|
13310
13310
|
} finally {
|
|
@@ -13324,25 +13324,25 @@ var require_AsyncHooksContextManager = __commonJS((exports) => {
|
|
|
13324
13324
|
_init(uid, type) {
|
|
13325
13325
|
if (type === "TIMERWRAP")
|
|
13326
13326
|
return;
|
|
13327
|
-
const
|
|
13328
|
-
if (
|
|
13329
|
-
this._contexts.set(uid,
|
|
13327
|
+
const context6 = this._stack[this._stack.length - 1];
|
|
13328
|
+
if (context6 !== undefined) {
|
|
13329
|
+
this._contexts.set(uid, context6);
|
|
13330
13330
|
}
|
|
13331
13331
|
}
|
|
13332
13332
|
_destroy(uid) {
|
|
13333
13333
|
this._contexts.delete(uid);
|
|
13334
13334
|
}
|
|
13335
13335
|
_before(uid) {
|
|
13336
|
-
const
|
|
13337
|
-
if (
|
|
13338
|
-
this._enterContext(
|
|
13336
|
+
const context6 = this._contexts.get(uid);
|
|
13337
|
+
if (context6 !== undefined) {
|
|
13338
|
+
this._enterContext(context6);
|
|
13339
13339
|
}
|
|
13340
13340
|
}
|
|
13341
13341
|
_after() {
|
|
13342
13342
|
this._exitContext();
|
|
13343
13343
|
}
|
|
13344
|
-
_enterContext(
|
|
13345
|
-
this._stack.push(
|
|
13344
|
+
_enterContext(context6) {
|
|
13345
|
+
this._stack.push(context6);
|
|
13346
13346
|
}
|
|
13347
13347
|
_exitContext() {
|
|
13348
13348
|
this._stack.pop();
|
|
@@ -13368,9 +13368,9 @@ var require_AsyncLocalStorageContextManager = __commonJS((exports) => {
|
|
|
13368
13368
|
active() {
|
|
13369
13369
|
return this._asyncLocalStorage.getStore() ?? api_1.ROOT_CONTEXT;
|
|
13370
13370
|
}
|
|
13371
|
-
with(
|
|
13371
|
+
with(context6, fn, thisArg, ...args) {
|
|
13372
13372
|
const cb = thisArg == null ? fn : fn.bind(thisArg);
|
|
13373
|
-
return this._asyncLocalStorage.run(
|
|
13373
|
+
return this._asyncLocalStorage.run(context6, cb, ...args);
|
|
13374
13374
|
}
|
|
13375
13375
|
enable() {
|
|
13376
13376
|
return this;
|
|
@@ -21778,7 +21778,7 @@ var require_utils20 = __commonJS((exports) => {
|
|
|
21778
21778
|
var types_1 = require_types3();
|
|
21779
21779
|
var AttributeNames_1 = require_AttributeNames7();
|
|
21780
21780
|
var semantic_conventions_1 = require_src2();
|
|
21781
|
-
var getMiddlewareMetadata = (
|
|
21781
|
+
var getMiddlewareMetadata = (context11, layer, isRouter, layerPath) => {
|
|
21782
21782
|
if (isRouter) {
|
|
21783
21783
|
return {
|
|
21784
21784
|
attributes: {
|
|
@@ -21786,7 +21786,7 @@ var require_utils20 = __commonJS((exports) => {
|
|
|
21786
21786
|
[AttributeNames_1.AttributeNames.KOA_TYPE]: types_1.KoaLayerType.ROUTER,
|
|
21787
21787
|
[semantic_conventions_1.SEMATTRS_HTTP_ROUTE]: layerPath?.toString()
|
|
21788
21788
|
},
|
|
21789
|
-
name:
|
|
21789
|
+
name: context11._matchedRouteName || `router - ${layerPath}`
|
|
21790
21790
|
};
|
|
21791
21791
|
} else {
|
|
21792
21792
|
return {
|
|
@@ -21882,23 +21882,23 @@ var require_instrumentation17 = __commonJS((exports) => {
|
|
|
21882
21882
|
}
|
|
21883
21883
|
middlewareLayer[internal_types_1.kLayerPatched] = true;
|
|
21884
21884
|
api2.diag.debug("patching Koa middleware layer");
|
|
21885
|
-
return async (
|
|
21885
|
+
return async (context11, next) => {
|
|
21886
21886
|
const parent = api2.trace.getSpan(api2.context.active());
|
|
21887
21887
|
if (parent === undefined) {
|
|
21888
|
-
return middlewareLayer(
|
|
21888
|
+
return middlewareLayer(context11, next);
|
|
21889
21889
|
}
|
|
21890
|
-
const metadata = (0, utils_1.getMiddlewareMetadata)(
|
|
21890
|
+
const metadata = (0, utils_1.getMiddlewareMetadata)(context11, middlewareLayer, isRouter, layerPath);
|
|
21891
21891
|
const span = this.tracer.startSpan(metadata.name, {
|
|
21892
21892
|
attributes: metadata.attributes
|
|
21893
21893
|
});
|
|
21894
21894
|
const rpcMetadata = (0, core_1.getRPCMetadata)(api2.context.active());
|
|
21895
|
-
if (rpcMetadata?.type === core_1.RPCType.HTTP &&
|
|
21896
|
-
rpcMetadata.route =
|
|
21895
|
+
if (rpcMetadata?.type === core_1.RPCType.HTTP && context11._matchedRoute) {
|
|
21896
|
+
rpcMetadata.route = context11._matchedRoute.toString();
|
|
21897
21897
|
}
|
|
21898
21898
|
const { requestHook: requestHook2 } = this.getConfig();
|
|
21899
21899
|
if (requestHook2) {
|
|
21900
21900
|
(0, instrumentation_1.safeExecuteInTheMiddle)(() => requestHook2(span, {
|
|
21901
|
-
context:
|
|
21901
|
+
context: context11,
|
|
21902
21902
|
middlewareLayer,
|
|
21903
21903
|
layerType
|
|
21904
21904
|
}), (e) => {
|
|
@@ -21910,7 +21910,7 @@ var require_instrumentation17 = __commonJS((exports) => {
|
|
|
21910
21910
|
const newContext = api2.trace.setSpan(api2.context.active(), span);
|
|
21911
21911
|
return api2.context.with(newContext, async () => {
|
|
21912
21912
|
try {
|
|
21913
|
-
return await middlewareLayer(
|
|
21913
|
+
return await middlewareLayer(context11, next);
|
|
21914
21914
|
} catch (err) {
|
|
21915
21915
|
span.recordException(err);
|
|
21916
21916
|
throw err;
|
|
@@ -22615,16 +22615,16 @@ var require_utils23 = __commonJS((exports) => {
|
|
|
22615
22615
|
return attributes;
|
|
22616
22616
|
};
|
|
22617
22617
|
exports.getConnectionAttributesFromUrl = getConnectionAttributesFromUrl;
|
|
22618
|
-
var markConfirmChannelTracing = (
|
|
22619
|
-
return
|
|
22618
|
+
var markConfirmChannelTracing = (context11) => {
|
|
22619
|
+
return context11.setValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY, true);
|
|
22620
22620
|
};
|
|
22621
22621
|
exports.markConfirmChannelTracing = markConfirmChannelTracing;
|
|
22622
|
-
var unmarkConfirmChannelTracing = (
|
|
22623
|
-
return
|
|
22622
|
+
var unmarkConfirmChannelTracing = (context11) => {
|
|
22623
|
+
return context11.deleteValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY);
|
|
22624
22624
|
};
|
|
22625
22625
|
exports.unmarkConfirmChannelTracing = unmarkConfirmChannelTracing;
|
|
22626
|
-
var isConfirmChannelTracing = (
|
|
22627
|
-
return
|
|
22626
|
+
var isConfirmChannelTracing = (context11) => {
|
|
22627
|
+
return context11.getValue(IS_CONFIRM_CHANNEL_CONTEXT_KEY) === true;
|
|
22628
22628
|
};
|
|
22629
22629
|
exports.isConfirmChannelTracing = isConfirmChannelTracing;
|
|
22630
22630
|
});
|
|
@@ -23764,6 +23764,8 @@ function createAgentCrudRouter(elizaOS, serverInstance) {
|
|
|
23764
23764
|
}
|
|
23765
23765
|
const updates = req.body;
|
|
23766
23766
|
try {
|
|
23767
|
+
const currentAgent = await db.getAgent(agentId);
|
|
23768
|
+
const activeRuntime = elizaOS.getAgent(agentId);
|
|
23767
23769
|
if (updates.settings?.secrets) {
|
|
23768
23770
|
const salt = getSalt();
|
|
23769
23771
|
const encryptedSecrets = {};
|
|
@@ -23782,11 +23784,46 @@ function createAgentCrudRouter(elizaOS, serverInstance) {
|
|
|
23782
23784
|
await db.updateAgent(agentId, updates);
|
|
23783
23785
|
}
|
|
23784
23786
|
const updatedAgent = await db.getAgent(agentId);
|
|
23785
|
-
|
|
23787
|
+
let needsRestart = false;
|
|
23788
|
+
if (currentAgent && activeRuntime && updatedAgent) {
|
|
23789
|
+
if (updatedAgent.plugins && !Array.isArray(updatedAgent.plugins)) {
|
|
23790
|
+
throw new Error("plugins must be an array");
|
|
23791
|
+
}
|
|
23792
|
+
const currentPlugins = (currentAgent.plugins || []).filter((p) => p != null).map((p) => typeof p === "string" ? p : p.name).filter((name) => typeof name === "string").sort();
|
|
23793
|
+
const updatedPlugins = (updatedAgent.plugins || []).filter((p) => p != null).map((p) => typeof p === "string" ? p : p.name).filter((name) => typeof name === "string").sort();
|
|
23794
|
+
const pluginsChanged = currentPlugins.length !== updatedPlugins.length || currentPlugins.some((plugin, idx) => plugin !== updatedPlugins[idx]);
|
|
23795
|
+
needsRestart = pluginsChanged;
|
|
23796
|
+
if (needsRestart) {
|
|
23797
|
+
logger.debug(`[AGENT UPDATE] Agent ${agentId} requires restart due to plugins changes`);
|
|
23798
|
+
}
|
|
23799
|
+
}
|
|
23786
23800
|
if (activeRuntime && updatedAgent) {
|
|
23787
|
-
|
|
23788
|
-
|
|
23789
|
-
|
|
23801
|
+
if (needsRestart) {
|
|
23802
|
+
logger.debug(`[AGENT UPDATE] Restarting agent ${agentId} due to configuration changes`);
|
|
23803
|
+
try {
|
|
23804
|
+
await serverInstance?.unregisterAgent(agentId);
|
|
23805
|
+
const { enabled, status: status2, createdAt, updatedAt, ...characterData } = updatedAgent;
|
|
23806
|
+
const runtimes = await serverInstance?.startAgents([characterData]);
|
|
23807
|
+
if (!runtimes || runtimes.length === 0) {
|
|
23808
|
+
throw new Error("Failed to restart agent after configuration change");
|
|
23809
|
+
}
|
|
23810
|
+
logger.success(`[AGENT UPDATE] Agent ${agentId} restarted successfully`);
|
|
23811
|
+
} catch (restartError) {
|
|
23812
|
+
logger.error({ error: restartError, agentId }, `[AGENT UPDATE] Failed to restart agent ${agentId}, attempting to restore previous state`);
|
|
23813
|
+
try {
|
|
23814
|
+
const { enabled, status: status2, createdAt, updatedAt, ...previousCharacterData } = currentAgent;
|
|
23815
|
+
await serverInstance?.startAgents([previousCharacterData]);
|
|
23816
|
+
logger.warn(`[AGENT UPDATE] Restored agent ${agentId} to previous state`);
|
|
23817
|
+
} catch (restoreError) {
|
|
23818
|
+
logger.error({ error: restoreError, agentId }, `[AGENT UPDATE] Failed to restore agent ${agentId} - agent may be in broken state`);
|
|
23819
|
+
}
|
|
23820
|
+
throw restartError;
|
|
23821
|
+
}
|
|
23822
|
+
} else {
|
|
23823
|
+
const { enabled, status: status2, createdAt, updatedAt, ...characterData } = updatedAgent;
|
|
23824
|
+
await elizaOS.updateAgent(agentId, characterData);
|
|
23825
|
+
logger.debug(`[AGENT UPDATE] Updated active agent ${agentId} without restart`);
|
|
23826
|
+
}
|
|
23790
23827
|
}
|
|
23791
23828
|
const runtime = elizaOS.getAgent(agentId);
|
|
23792
23829
|
const status = runtime ? "active" : "inactive";
|
|
@@ -28796,7 +28833,7 @@ import express30 from "express";
|
|
|
28796
28833
|
// package.json
|
|
28797
28834
|
var package_default = {
|
|
28798
28835
|
name: "@elizaos/server",
|
|
28799
|
-
version: "1.6.
|
|
28836
|
+
version: "1.6.2-alpha.10",
|
|
28800
28837
|
description: "ElizaOS Server - Core server infrastructure for ElizaOS agents",
|
|
28801
28838
|
publishConfig: {
|
|
28802
28839
|
access: "public",
|
|
@@ -30343,7 +30380,7 @@ async function loadCharacters(charactersArg) {
|
|
|
30343
30380
|
}
|
|
30344
30381
|
|
|
30345
30382
|
// ../../node_modules/@sentry/node/build/esm/integrations/http.js
|
|
30346
|
-
var
|
|
30383
|
+
var import_api9 = __toESM(require_src(), 1);
|
|
30347
30384
|
var import_instrumentation_http = __toESM(require_src7(), 1);
|
|
30348
30385
|
|
|
30349
30386
|
// ../../node_modules/@sentry/core/build/esm/debug-build.js
|
|
@@ -30353,7 +30390,7 @@ var DEBUG_BUILD = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
|
|
|
30353
30390
|
var GLOBAL_OBJ = globalThis;
|
|
30354
30391
|
|
|
30355
30392
|
// ../../node_modules/@sentry/core/build/esm/utils/version.js
|
|
30356
|
-
var SDK_VERSION = "10.
|
|
30393
|
+
var SDK_VERSION = "10.16.0";
|
|
30357
30394
|
|
|
30358
30395
|
// ../../node_modules/@sentry/core/build/esm/carrier.js
|
|
30359
30396
|
function getMainCarrier() {
|
|
@@ -35870,7 +35907,7 @@ function processGenerateSpan(span, name, attributes) {
|
|
|
35870
35907
|
span.setAttribute("ai.pipeline.name", nameWthoutAi);
|
|
35871
35908
|
span.updateName(nameWthoutAi);
|
|
35872
35909
|
const functionId = attributes[AI_TELEMETRY_FUNCTION_ID_ATTRIBUTE];
|
|
35873
|
-
if (functionId && typeof functionId === "string") {
|
|
35910
|
+
if (functionId && typeof functionId === "string" && name.split(".").length - 1 === 1) {
|
|
35874
35911
|
span.updateName(`${nameWthoutAi} ${functionId}`);
|
|
35875
35912
|
span.setAttribute("gen_ai.function_id", functionId);
|
|
35876
35913
|
}
|
|
@@ -37245,6 +37282,9 @@ class LRUMap {
|
|
|
37245
37282
|
return values;
|
|
37246
37283
|
}
|
|
37247
37284
|
}
|
|
37285
|
+
// ../../node_modules/@sentry/node-core/build/esm/debug-build.js
|
|
37286
|
+
var DEBUG_BUILD2 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
|
|
37287
|
+
|
|
37248
37288
|
// ../../node_modules/@sentry/node-core/build/esm/otel/instrument.js
|
|
37249
37289
|
var import_instrumentation = __toESM(require_src6(), 1);
|
|
37250
37290
|
var INSTRUMENTED = {};
|
|
@@ -37314,85 +37354,76 @@ function hasWrap(instrumentation) {
|
|
|
37314
37354
|
return typeof instrumentation["_wrap"] === "function";
|
|
37315
37355
|
}
|
|
37316
37356
|
|
|
37317
|
-
// ../../node_modules/@sentry/node-core/build/esm/integrations/http/
|
|
37318
|
-
var
|
|
37319
|
-
|
|
37357
|
+
// ../../node_modules/@sentry/node-core/build/esm/integrations/http/SentryHttpInstrumentation.js
|
|
37358
|
+
var import_api4 = __toESM(require_src(), 1);
|
|
37359
|
+
var import_core40 = __toESM(require_src3(), 1);
|
|
37360
|
+
var import_instrumentation2 = __toESM(require_src6(), 1);
|
|
37361
|
+
import { subscribe, unsubscribe } from "node:diagnostics_channel";
|
|
37320
37362
|
|
|
37321
|
-
// ../../node_modules/@sentry/node-core/build/esm/
|
|
37322
|
-
|
|
37363
|
+
// ../../node_modules/@sentry/node-core/build/esm/utils/getRequestUrl.js
|
|
37364
|
+
function getRequestUrl(requestOptions) {
|
|
37365
|
+
const protocol = requestOptions.protocol || "";
|
|
37366
|
+
const hostname = requestOptions.hostname || requestOptions.host || "";
|
|
37367
|
+
const port = !requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 || /^(.*):(\d+)$/.test(hostname) ? "" : `:${requestOptions.port}`;
|
|
37368
|
+
const path7 = requestOptions.path ? requestOptions.path : "/";
|
|
37369
|
+
return `${protocol}//${hostname}${port}${path7}`;
|
|
37370
|
+
}
|
|
37323
37371
|
|
|
37324
37372
|
// ../../node_modules/@sentry/node-core/build/esm/integrations/http/constants.js
|
|
37325
37373
|
var INSTRUMENTATION_NAME = "@sentry/instrumentation-http";
|
|
37326
37374
|
var MAX_BODY_BYTE_LENGTH = 1024 * 1024;
|
|
37327
37375
|
|
|
37328
|
-
// ../../node_modules/@sentry/node-core/build/esm/integrations/http/
|
|
37376
|
+
// ../../node_modules/@sentry/node-core/build/esm/integrations/http/incoming-requests.js
|
|
37377
|
+
var import_api2 = __toESM(require_src(), 1);
|
|
37378
|
+
var import_core34 = __toESM(require_src3(), 1);
|
|
37379
|
+
var import_semantic_conventions = __toESM(require_src2(), 1);
|
|
37380
|
+
import { errorMonitor } from "events";
|
|
37329
37381
|
var HTTP_SERVER_INSTRUMENTED_KEY = import_api2.createContextKey("sentry_http_server_instrumented");
|
|
37330
|
-
var INTEGRATION_NAME6 = "Http.Server";
|
|
37331
37382
|
var clientToRequestSessionAggregatesMap = new Map;
|
|
37332
37383
|
var wrappedEmitFns = new WeakSet;
|
|
37333
|
-
function addStartSpanCallback(request, callback) {
|
|
37334
|
-
addNonEnumerableProperty(request, "_startSpanCallback", new WeakRef(callback));
|
|
37335
|
-
}
|
|
37336
|
-
var _httpServerIntegration = (options = {}) => {
|
|
37337
|
-
const _options = {
|
|
37338
|
-
sessions: options.sessions ?? true,
|
|
37339
|
-
sessionFlushingDelayMS: options.sessionFlushingDelayMS ?? 60000,
|
|
37340
|
-
maxRequestBodySize: options.maxRequestBodySize ?? "medium",
|
|
37341
|
-
ignoreRequestBody: options.ignoreRequestBody
|
|
37342
|
-
};
|
|
37343
|
-
return {
|
|
37344
|
-
name: INTEGRATION_NAME6,
|
|
37345
|
-
setupOnce() {
|
|
37346
|
-
const onHttpServerRequestStart = (_data) => {
|
|
37347
|
-
const data = _data;
|
|
37348
|
-
instrumentServer(data.server, _options);
|
|
37349
|
-
};
|
|
37350
|
-
subscribe("http.server.request.start", onHttpServerRequestStart);
|
|
37351
|
-
},
|
|
37352
|
-
afterAllSetup(client) {
|
|
37353
|
-
if (DEBUG_BUILD2 && client.getIntegrationByName("Http")) {
|
|
37354
|
-
debug.warn("It seems that you have manually added `httpServerIntegration` while `httpIntegration` is also present. Make sure to remove `httpServerIntegration` when adding `httpIntegration`.");
|
|
37355
|
-
}
|
|
37356
|
-
}
|
|
37357
|
-
};
|
|
37358
|
-
};
|
|
37359
|
-
var httpServerIntegration = _httpServerIntegration;
|
|
37360
37384
|
function instrumentServer(server, {
|
|
37361
|
-
|
|
37362
|
-
|
|
37363
|
-
|
|
37364
|
-
|
|
37385
|
+
ignoreIncomingRequestBody,
|
|
37386
|
+
ignoreSpansForIncomingRequests,
|
|
37387
|
+
maxIncomingRequestBodySize = "medium",
|
|
37388
|
+
trackIncomingRequestsAsSessions = true,
|
|
37389
|
+
spans,
|
|
37390
|
+
ignoreStaticAssets = true,
|
|
37391
|
+
sessionFlushingDelayMS,
|
|
37392
|
+
instrumentation,
|
|
37393
|
+
incomingRequestSpanHook
|
|
37365
37394
|
}) {
|
|
37366
37395
|
const originalEmit = server.emit;
|
|
37367
37396
|
if (wrappedEmitFns.has(originalEmit)) {
|
|
37397
|
+
DEBUG_BUILD2 && debug.log(INSTRUMENTATION_NAME, "Incoming requests already instrumented, not instrumenting again...");
|
|
37368
37398
|
return;
|
|
37369
37399
|
}
|
|
37400
|
+
const { requestHook, responseHook, applyCustomAttributesOnSpan } = instrumentation ?? {};
|
|
37370
37401
|
const newEmit = new Proxy(originalEmit, {
|
|
37371
37402
|
apply(target, thisArg, args) {
|
|
37372
37403
|
if (args[0] !== "request") {
|
|
37373
37404
|
return target.apply(thisArg, args);
|
|
37374
37405
|
}
|
|
37375
|
-
|
|
37376
|
-
if (import_api2.context.active().getValue(HTTP_SERVER_INSTRUMENTED_KEY) || !client) {
|
|
37406
|
+
if (import_api2.context.active().getValue(HTTP_SERVER_INSTRUMENTED_KEY)) {
|
|
37377
37407
|
return target.apply(thisArg, args);
|
|
37378
37408
|
}
|
|
37379
|
-
DEBUG_BUILD2 && debug.log(
|
|
37409
|
+
DEBUG_BUILD2 && debug.log(INSTRUMENTATION_NAME, "Handling incoming request");
|
|
37410
|
+
const client = getClient();
|
|
37380
37411
|
const isolationScope = getIsolationScope().clone();
|
|
37381
37412
|
const request = args[1];
|
|
37382
37413
|
const response = args[2];
|
|
37383
37414
|
const normalizedRequest = httpRequestToRequestData(request);
|
|
37384
37415
|
const ipAddress = request.ip || request.socket?.remoteAddress;
|
|
37385
37416
|
const url = request.url || "/";
|
|
37386
|
-
if (
|
|
37387
|
-
patchRequestToCaptureBody(request, isolationScope,
|
|
37417
|
+
if (maxIncomingRequestBodySize !== "none" && !ignoreIncomingRequestBody?.(url, request)) {
|
|
37418
|
+
patchRequestToCaptureBody(request, isolationScope, maxIncomingRequestBodySize);
|
|
37388
37419
|
}
|
|
37389
37420
|
isolationScope.setSDKProcessingMetadata({ normalizedRequest, ipAddress });
|
|
37390
37421
|
const httpMethod = (request.method || "GET").toUpperCase();
|
|
37391
37422
|
const httpTargetWithoutQueryFragment = stripUrlQueryAndFragment(url);
|
|
37392
37423
|
const bestEffortTransactionName = `${httpMethod} ${httpTargetWithoutQueryFragment}`;
|
|
37393
37424
|
isolationScope.setTransactionName(bestEffortTransactionName);
|
|
37394
|
-
if (
|
|
37395
|
-
recordRequestSession(
|
|
37425
|
+
if (trackIncomingRequestsAsSessions !== false) {
|
|
37426
|
+
recordRequestSession({
|
|
37396
37427
|
requestIsolationScope: isolationScope,
|
|
37397
37428
|
response,
|
|
37398
37429
|
sessionFlushingDelayMS: sessionFlushingDelayMS ?? 60000
|
|
@@ -37402,12 +37433,79 @@ function instrumentServer(server, {
|
|
|
37402
37433
|
getCurrentScope().getPropagationContext().propagationSpanId = generateSpanId();
|
|
37403
37434
|
const ctx = import_api2.propagation.extract(import_api2.context.active(), normalizedRequest.headers).setValue(HTTP_SERVER_INSTRUMENTED_KEY, true);
|
|
37404
37435
|
return import_api2.context.with(ctx, () => {
|
|
37405
|
-
|
|
37406
|
-
|
|
37407
|
-
|
|
37408
|
-
|
|
37436
|
+
if (typeof __SENTRY_TRACING__ !== "undefined" && !__SENTRY_TRACING__ || !spans || !client || shouldIgnoreSpansForIncomingRequest(request, {
|
|
37437
|
+
ignoreStaticAssets,
|
|
37438
|
+
ignoreSpansForIncomingRequests
|
|
37439
|
+
})) {
|
|
37440
|
+
DEBUG_BUILD2 && debug.log(INSTRUMENTATION_NAME, "Skipping span creation for incoming request");
|
|
37441
|
+
return target.apply(thisArg, args);
|
|
37409
37442
|
}
|
|
37410
|
-
|
|
37443
|
+
const fullUrl = normalizedRequest.url || url;
|
|
37444
|
+
const urlObj = parseStringToURLObject(fullUrl);
|
|
37445
|
+
const headers = request.headers;
|
|
37446
|
+
const userAgent = headers["user-agent"];
|
|
37447
|
+
const ips = headers["x-forwarded-for"];
|
|
37448
|
+
const httpVersion = request.httpVersion;
|
|
37449
|
+
const host = headers.host;
|
|
37450
|
+
const hostname = host?.replace(/^(.*)(:[0-9]{1,5})/, "$1") || "localhost";
|
|
37451
|
+
const tracer = client.tracer;
|
|
37452
|
+
const scheme = fullUrl.startsWith("https") ? "https" : "http";
|
|
37453
|
+
const shouldSendDefaultPii = client?.getOptions().sendDefaultPii ?? false;
|
|
37454
|
+
const span = tracer.startSpan(bestEffortTransactionName, {
|
|
37455
|
+
kind: import_api2.SpanKind.SERVER,
|
|
37456
|
+
attributes: {
|
|
37457
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.server",
|
|
37458
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.http",
|
|
37459
|
+
"sentry.http.prefetch": isKnownPrefetchRequest(request) || undefined,
|
|
37460
|
+
"http.url": fullUrl,
|
|
37461
|
+
"http.method": httpMethod,
|
|
37462
|
+
"http.target": urlObj ? `${urlObj.pathname}${urlObj.search}` : httpTargetWithoutQueryFragment,
|
|
37463
|
+
"http.host": host,
|
|
37464
|
+
"net.host.name": hostname,
|
|
37465
|
+
"http.client_ip": typeof ips === "string" ? ips.split(",")[0] : undefined,
|
|
37466
|
+
"http.user_agent": userAgent,
|
|
37467
|
+
"http.scheme": scheme,
|
|
37468
|
+
"http.flavor": httpVersion,
|
|
37469
|
+
"net.transport": httpVersion?.toUpperCase() === "QUIC" ? "ip_udp" : "ip_tcp",
|
|
37470
|
+
...getRequestContentLengthAttribute(request),
|
|
37471
|
+
...httpHeadersToSpanAttributes(normalizedRequest.headers || {}, shouldSendDefaultPii)
|
|
37472
|
+
}
|
|
37473
|
+
});
|
|
37474
|
+
requestHook?.(span, request);
|
|
37475
|
+
responseHook?.(span, response);
|
|
37476
|
+
applyCustomAttributesOnSpan?.(span, request, response);
|
|
37477
|
+
incomingRequestSpanHook?.(span, request, response);
|
|
37478
|
+
const rpcMetadata = {
|
|
37479
|
+
type: import_core34.RPCType.HTTP,
|
|
37480
|
+
span
|
|
37481
|
+
};
|
|
37482
|
+
import_api2.context.with(import_core34.setRPCMetadata(import_api2.trace.setSpan(import_api2.context.active(), span), rpcMetadata), () => {
|
|
37483
|
+
import_api2.context.bind(import_api2.context.active(), request);
|
|
37484
|
+
import_api2.context.bind(import_api2.context.active(), response);
|
|
37485
|
+
let isEnded = false;
|
|
37486
|
+
function endSpan(status) {
|
|
37487
|
+
if (isEnded) {
|
|
37488
|
+
return;
|
|
37489
|
+
}
|
|
37490
|
+
isEnded = true;
|
|
37491
|
+
const newAttributes = getIncomingRequestAttributesOnResponse(request, response);
|
|
37492
|
+
span.setAttributes(newAttributes);
|
|
37493
|
+
span.setStatus(status);
|
|
37494
|
+
span.end();
|
|
37495
|
+
const route = newAttributes["http.route"];
|
|
37496
|
+
if (route) {
|
|
37497
|
+
getIsolationScope().setTransactionName(`${request.method?.toUpperCase() || "GET"} ${route}`);
|
|
37498
|
+
}
|
|
37499
|
+
}
|
|
37500
|
+
response.on("close", () => {
|
|
37501
|
+
endSpan(getSpanStatusFromHttpCode(response.statusCode));
|
|
37502
|
+
});
|
|
37503
|
+
response.on(errorMonitor, () => {
|
|
37504
|
+
const httpStatus = getSpanStatusFromHttpCode(response.statusCode);
|
|
37505
|
+
endSpan(httpStatus.code === SPAN_STATUS_ERROR ? httpStatus : { code: SPAN_STATUS_ERROR });
|
|
37506
|
+
});
|
|
37507
|
+
return target.apply(thisArg, args);
|
|
37508
|
+
});
|
|
37411
37509
|
});
|
|
37412
37510
|
});
|
|
37413
37511
|
}
|
|
@@ -37415,7 +37513,7 @@ function instrumentServer(server, {
|
|
|
37415
37513
|
wrappedEmitFns.add(newEmit);
|
|
37416
37514
|
server.emit = newEmit;
|
|
37417
37515
|
}
|
|
37418
|
-
function recordRequestSession(
|
|
37516
|
+
function recordRequestSession({
|
|
37419
37517
|
requestIsolationScope,
|
|
37420
37518
|
response,
|
|
37421
37519
|
sessionFlushingDelayMS
|
|
@@ -37424,6 +37522,7 @@ function recordRequestSession(client, {
|
|
|
37424
37522
|
requestSession: { status: "ok" }
|
|
37425
37523
|
});
|
|
37426
37524
|
response.once("close", () => {
|
|
37525
|
+
const client = getClient();
|
|
37427
37526
|
const requestSession = requestIsolationScope.getScopeData().sdkProcessingMetadata.requestSession;
|
|
37428
37527
|
if (client && requestSession) {
|
|
37429
37528
|
DEBUG_BUILD2 && debug.log(`Recorded request session with status: ${requestSession.status}`);
|
|
@@ -37466,7 +37565,7 @@ function recordRequestSession(client, {
|
|
|
37466
37565
|
function patchRequestToCaptureBody(req, isolationScope, maxIncomingRequestBodySize) {
|
|
37467
37566
|
let bodyByteLength = 0;
|
|
37468
37567
|
const chunks = [];
|
|
37469
|
-
DEBUG_BUILD2 && debug.log(
|
|
37568
|
+
DEBUG_BUILD2 && debug.log(INSTRUMENTATION_NAME, "Patching request.on");
|
|
37470
37569
|
const callbackMap = new WeakMap;
|
|
37471
37570
|
const maxBodySize = maxIncomingRequestBodySize === "small" ? 1000 : maxIncomingRequestBodySize === "medium" ? 1e4 : MAX_BODY_BYTE_LENGTH;
|
|
37472
37571
|
try {
|
|
@@ -37474,7 +37573,7 @@ function patchRequestToCaptureBody(req, isolationScope, maxIncomingRequestBodySi
|
|
|
37474
37573
|
apply: (target, thisArg, args) => {
|
|
37475
37574
|
const [event, listener, ...restArgs] = args;
|
|
37476
37575
|
if (event === "data") {
|
|
37477
|
-
DEBUG_BUILD2 && debug.log(
|
|
37576
|
+
DEBUG_BUILD2 && debug.log(INSTRUMENTATION_NAME, `Handling request.on("data") with maximum body size of ${maxBodySize}b`);
|
|
37478
37577
|
const callback = new Proxy(listener, {
|
|
37479
37578
|
apply: (target2, thisArg2, args2) => {
|
|
37480
37579
|
try {
|
|
@@ -37484,10 +37583,10 @@ function patchRequestToCaptureBody(req, isolationScope, maxIncomingRequestBodySi
|
|
|
37484
37583
|
chunks.push(bufferifiedChunk);
|
|
37485
37584
|
bodyByteLength += bufferifiedChunk.byteLength;
|
|
37486
37585
|
} else if (DEBUG_BUILD2) {
|
|
37487
|
-
debug.log(
|
|
37586
|
+
debug.log(INSTRUMENTATION_NAME, `Dropping request body chunk because maximum body length of ${maxBodySize}b is exceeded.`);
|
|
37488
37587
|
}
|
|
37489
37588
|
} catch (err) {
|
|
37490
|
-
DEBUG_BUILD2 && debug.error(
|
|
37589
|
+
DEBUG_BUILD2 && debug.error(INSTRUMENTATION_NAME, "Encountered error while storing body chunk.");
|
|
37491
37590
|
}
|
|
37492
37591
|
return Reflect.apply(target2, thisArg2, args2);
|
|
37493
37592
|
}
|
|
@@ -37521,183 +37620,16 @@ function patchRequestToCaptureBody(req, isolationScope, maxIncomingRequestBodySi
|
|
|
37521
37620
|
}
|
|
37522
37621
|
} catch (error2) {
|
|
37523
37622
|
if (DEBUG_BUILD2) {
|
|
37524
|
-
debug.error(
|
|
37623
|
+
debug.error(INSTRUMENTATION_NAME, "Error building captured request body", error2);
|
|
37525
37624
|
}
|
|
37526
37625
|
}
|
|
37527
37626
|
});
|
|
37528
37627
|
} catch (error2) {
|
|
37529
37628
|
if (DEBUG_BUILD2) {
|
|
37530
|
-
debug.error(
|
|
37629
|
+
debug.error(INSTRUMENTATION_NAME, "Error patching request to capture body", error2);
|
|
37531
37630
|
}
|
|
37532
37631
|
}
|
|
37533
37632
|
}
|
|
37534
|
-
|
|
37535
|
-
// ../../node_modules/@sentry/node-core/build/esm/integrations/http/httpServerSpansIntegration.js
|
|
37536
|
-
var import_api3 = __toESM(require_src(), 1);
|
|
37537
|
-
var import_core35 = __toESM(require_src3(), 1);
|
|
37538
|
-
var import_semantic_conventions = __toESM(require_src2(), 1);
|
|
37539
|
-
import { errorMonitor } from "node:events";
|
|
37540
|
-
var INTEGRATION_NAME7 = "Http.ServerSpans";
|
|
37541
|
-
var _httpServerSpansIntegration = (options = {}) => {
|
|
37542
|
-
const ignoreStaticAssets = options.ignoreStaticAssets ?? true;
|
|
37543
|
-
const ignoreIncomingRequests = options.ignoreIncomingRequests;
|
|
37544
|
-
const ignoreStatusCodes = options.ignoreStatusCodes ?? [
|
|
37545
|
-
[401, 404],
|
|
37546
|
-
[301, 303],
|
|
37547
|
-
[305, 399]
|
|
37548
|
-
];
|
|
37549
|
-
const { onSpanCreated } = options;
|
|
37550
|
-
const { requestHook, responseHook, applyCustomAttributesOnSpan } = options.instrumentation ?? {};
|
|
37551
|
-
return {
|
|
37552
|
-
name: INTEGRATION_NAME7,
|
|
37553
|
-
setup(client) {
|
|
37554
|
-
if (typeof __SENTRY_TRACING__ !== "undefined" && !__SENTRY_TRACING__) {
|
|
37555
|
-
return;
|
|
37556
|
-
}
|
|
37557
|
-
client.on("httpServerRequest", (_request, _response, normalizedRequest) => {
|
|
37558
|
-
const request = _request;
|
|
37559
|
-
const response = _response;
|
|
37560
|
-
const startSpan2 = (next) => {
|
|
37561
|
-
if (shouldIgnoreSpansForIncomingRequest(request, {
|
|
37562
|
-
ignoreStaticAssets,
|
|
37563
|
-
ignoreIncomingRequests
|
|
37564
|
-
})) {
|
|
37565
|
-
DEBUG_BUILD2 && debug.log(INTEGRATION_NAME7, "Skipping span creation for incoming request", request.url);
|
|
37566
|
-
return next();
|
|
37567
|
-
}
|
|
37568
|
-
const fullUrl = normalizedRequest.url || request.url || "/";
|
|
37569
|
-
const urlObj = parseStringToURLObject(fullUrl);
|
|
37570
|
-
const headers = request.headers;
|
|
37571
|
-
const userAgent = headers["user-agent"];
|
|
37572
|
-
const ips = headers["x-forwarded-for"];
|
|
37573
|
-
const httpVersion = request.httpVersion;
|
|
37574
|
-
const host = headers.host;
|
|
37575
|
-
const hostname = host?.replace(/^(.*)(:[0-9]{1,5})/, "$1") || "localhost";
|
|
37576
|
-
const tracer = client.tracer;
|
|
37577
|
-
const scheme = fullUrl.startsWith("https") ? "https" : "http";
|
|
37578
|
-
const method = normalizedRequest.method || request.method?.toUpperCase() || "GET";
|
|
37579
|
-
const httpTargetWithoutQueryFragment = urlObj ? urlObj.pathname : stripUrlQueryAndFragment(fullUrl);
|
|
37580
|
-
const bestEffortTransactionName = `${method} ${httpTargetWithoutQueryFragment}`;
|
|
37581
|
-
const shouldSendDefaultPii = client.getOptions().sendDefaultPii ?? false;
|
|
37582
|
-
const span = tracer.startSpan(bestEffortTransactionName, {
|
|
37583
|
-
kind: import_api3.SpanKind.SERVER,
|
|
37584
|
-
attributes: {
|
|
37585
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: "http.server",
|
|
37586
|
-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: "auto.http.otel.http",
|
|
37587
|
-
"sentry.http.prefetch": isKnownPrefetchRequest(request) || undefined,
|
|
37588
|
-
"http.url": fullUrl,
|
|
37589
|
-
"http.method": normalizedRequest.method,
|
|
37590
|
-
"http.target": urlObj ? `${urlObj.pathname}${urlObj.search}` : httpTargetWithoutQueryFragment,
|
|
37591
|
-
"http.host": host,
|
|
37592
|
-
"net.host.name": hostname,
|
|
37593
|
-
"http.client_ip": typeof ips === "string" ? ips.split(",")[0] : undefined,
|
|
37594
|
-
"http.user_agent": userAgent,
|
|
37595
|
-
"http.scheme": scheme,
|
|
37596
|
-
"http.flavor": httpVersion,
|
|
37597
|
-
"net.transport": httpVersion?.toUpperCase() === "QUIC" ? "ip_udp" : "ip_tcp",
|
|
37598
|
-
...getRequestContentLengthAttribute(request),
|
|
37599
|
-
...httpHeadersToSpanAttributes(normalizedRequest.headers || {}, shouldSendDefaultPii)
|
|
37600
|
-
}
|
|
37601
|
-
});
|
|
37602
|
-
requestHook?.(span, request);
|
|
37603
|
-
responseHook?.(span, response);
|
|
37604
|
-
applyCustomAttributesOnSpan?.(span, request, response);
|
|
37605
|
-
onSpanCreated?.(span, request, response);
|
|
37606
|
-
const rpcMetadata = {
|
|
37607
|
-
type: import_core35.RPCType.HTTP,
|
|
37608
|
-
span
|
|
37609
|
-
};
|
|
37610
|
-
return import_api3.context.with(import_core35.setRPCMetadata(import_api3.trace.setSpan(import_api3.context.active(), span), rpcMetadata), () => {
|
|
37611
|
-
import_api3.context.bind(import_api3.context.active(), request);
|
|
37612
|
-
import_api3.context.bind(import_api3.context.active(), response);
|
|
37613
|
-
let isEnded = false;
|
|
37614
|
-
function endSpan(status) {
|
|
37615
|
-
if (isEnded) {
|
|
37616
|
-
return;
|
|
37617
|
-
}
|
|
37618
|
-
isEnded = true;
|
|
37619
|
-
const newAttributes = getIncomingRequestAttributesOnResponse(request, response);
|
|
37620
|
-
span.setAttributes(newAttributes);
|
|
37621
|
-
span.setStatus(status);
|
|
37622
|
-
span.end();
|
|
37623
|
-
const route = newAttributes["http.route"];
|
|
37624
|
-
if (route) {
|
|
37625
|
-
getIsolationScope().setTransactionName(`${request.method?.toUpperCase() || "GET"} ${route}`);
|
|
37626
|
-
}
|
|
37627
|
-
}
|
|
37628
|
-
response.on("close", () => {
|
|
37629
|
-
endSpan(getSpanStatusFromHttpCode(response.statusCode));
|
|
37630
|
-
});
|
|
37631
|
-
response.on(errorMonitor, () => {
|
|
37632
|
-
const httpStatus = getSpanStatusFromHttpCode(response.statusCode);
|
|
37633
|
-
endSpan(httpStatus.code === SPAN_STATUS_ERROR ? httpStatus : { code: SPAN_STATUS_ERROR });
|
|
37634
|
-
});
|
|
37635
|
-
return next();
|
|
37636
|
-
});
|
|
37637
|
-
};
|
|
37638
|
-
addStartSpanCallback(request, startSpan2);
|
|
37639
|
-
});
|
|
37640
|
-
},
|
|
37641
|
-
processEvent(event) {
|
|
37642
|
-
if (event.type === "transaction") {
|
|
37643
|
-
const statusCode = event.contexts?.trace?.data?.["http.response.status_code"];
|
|
37644
|
-
if (typeof statusCode === "number") {
|
|
37645
|
-
const shouldDrop = shouldFilterStatusCode(statusCode, ignoreStatusCodes);
|
|
37646
|
-
if (shouldDrop) {
|
|
37647
|
-
DEBUG_BUILD2 && debug.log("Dropping transaction due to status code", statusCode);
|
|
37648
|
-
return null;
|
|
37649
|
-
}
|
|
37650
|
-
}
|
|
37651
|
-
}
|
|
37652
|
-
return event;
|
|
37653
|
-
},
|
|
37654
|
-
afterAllSetup(client) {
|
|
37655
|
-
if (!DEBUG_BUILD2) {
|
|
37656
|
-
return;
|
|
37657
|
-
}
|
|
37658
|
-
if (client.getIntegrationByName("Http")) {
|
|
37659
|
-
debug.warn("It seems that you have manually added `httpServerSpansIntergation` while `httpIntegration` is also present. Make sure to remove `httpIntegration` when adding `httpServerSpansIntegration`.");
|
|
37660
|
-
}
|
|
37661
|
-
if (!client.getIntegrationByName("Http.Server")) {
|
|
37662
|
-
debug.error("It seems that you have manually added `httpServerSpansIntergation` without adding `httpServerIntegration`. This is a requiement for spans to be created - please add the `httpServerIntegration` integration.");
|
|
37663
|
-
}
|
|
37664
|
-
}
|
|
37665
|
-
};
|
|
37666
|
-
};
|
|
37667
|
-
var httpServerSpansIntegration = _httpServerSpansIntegration;
|
|
37668
|
-
function isKnownPrefetchRequest(req) {
|
|
37669
|
-
return req.headers["next-router-prefetch"] === "1";
|
|
37670
|
-
}
|
|
37671
|
-
function isStaticAssetRequest(urlPath) {
|
|
37672
|
-
const path7 = stripUrlQueryAndFragment(urlPath);
|
|
37673
|
-
if (path7.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) {
|
|
37674
|
-
return true;
|
|
37675
|
-
}
|
|
37676
|
-
if (path7.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) {
|
|
37677
|
-
return true;
|
|
37678
|
-
}
|
|
37679
|
-
return false;
|
|
37680
|
-
}
|
|
37681
|
-
function shouldIgnoreSpansForIncomingRequest(request, {
|
|
37682
|
-
ignoreStaticAssets,
|
|
37683
|
-
ignoreIncomingRequests
|
|
37684
|
-
}) {
|
|
37685
|
-
if (import_core35.isTracingSuppressed(import_api3.context.active())) {
|
|
37686
|
-
return true;
|
|
37687
|
-
}
|
|
37688
|
-
const urlPath = request.url;
|
|
37689
|
-
const method = request.method?.toUpperCase();
|
|
37690
|
-
if (method === "OPTIONS" || method === "HEAD" || !urlPath) {
|
|
37691
|
-
return true;
|
|
37692
|
-
}
|
|
37693
|
-
if (ignoreStaticAssets && method === "GET" && isStaticAssetRequest(urlPath)) {
|
|
37694
|
-
return true;
|
|
37695
|
-
}
|
|
37696
|
-
if (ignoreIncomingRequests?.(urlPath, request)) {
|
|
37697
|
-
return true;
|
|
37698
|
-
}
|
|
37699
|
-
return false;
|
|
37700
|
-
}
|
|
37701
37633
|
function getRequestContentLengthAttribute(request) {
|
|
37702
37634
|
const length = getContentLength(request.headers);
|
|
37703
37635
|
if (length == null) {
|
|
@@ -37734,7 +37666,7 @@ function getIncomingRequestAttributesOnResponse(request, response) {
|
|
|
37734
37666
|
[import_semantic_conventions.SEMATTRS_HTTP_STATUS_CODE]: statusCode,
|
|
37735
37667
|
"http.status_text": statusMessage?.toUpperCase()
|
|
37736
37668
|
};
|
|
37737
|
-
const rpcMetadata =
|
|
37669
|
+
const rpcMetadata = import_core34.getRPCMetadata(import_api2.context.active());
|
|
37738
37670
|
if (socket) {
|
|
37739
37671
|
const { localAddress, localPort, remoteAddress, remotePort } = socket;
|
|
37740
37672
|
newAttributes[import_semantic_conventions.SEMATTRS_NET_HOST_IP] = localAddress;
|
|
@@ -37744,42 +37676,51 @@ function getIncomingRequestAttributesOnResponse(request, response) {
|
|
|
37744
37676
|
}
|
|
37745
37677
|
newAttributes[import_semantic_conventions.SEMATTRS_HTTP_STATUS_CODE] = statusCode;
|
|
37746
37678
|
newAttributes["http.status_text"] = (statusMessage || "").toUpperCase();
|
|
37747
|
-
if (rpcMetadata?.type ===
|
|
37679
|
+
if (rpcMetadata?.type === import_core34.RPCType.HTTP && rpcMetadata.route !== undefined) {
|
|
37748
37680
|
const routeName = rpcMetadata.route;
|
|
37749
37681
|
newAttributes[import_semantic_conventions.ATTR_HTTP_ROUTE] = routeName;
|
|
37750
37682
|
}
|
|
37751
37683
|
return newAttributes;
|
|
37752
37684
|
}
|
|
37753
|
-
function
|
|
37754
|
-
return
|
|
37755
|
-
if (typeof code === "number") {
|
|
37756
|
-
return code === statusCode;
|
|
37757
|
-
}
|
|
37758
|
-
const [min, max] = code;
|
|
37759
|
-
return statusCode >= min && statusCode <= max;
|
|
37760
|
-
});
|
|
37685
|
+
function isKnownPrefetchRequest(req) {
|
|
37686
|
+
return req.headers["next-router-prefetch"] === "1";
|
|
37761
37687
|
}
|
|
37762
|
-
|
|
37763
|
-
|
|
37764
|
-
|
|
37765
|
-
|
|
37766
|
-
|
|
37767
|
-
|
|
37768
|
-
|
|
37769
|
-
|
|
37770
|
-
|
|
37771
|
-
|
|
37772
|
-
|
|
37773
|
-
|
|
37774
|
-
|
|
37775
|
-
|
|
37688
|
+
function isStaticAssetRequest(urlPath) {
|
|
37689
|
+
const path7 = stripUrlQueryAndFragment(urlPath);
|
|
37690
|
+
if (path7.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)) {
|
|
37691
|
+
return true;
|
|
37692
|
+
}
|
|
37693
|
+
if (path7.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/)) {
|
|
37694
|
+
return true;
|
|
37695
|
+
}
|
|
37696
|
+
return false;
|
|
37697
|
+
}
|
|
37698
|
+
function shouldIgnoreSpansForIncomingRequest(request, {
|
|
37699
|
+
ignoreStaticAssets,
|
|
37700
|
+
ignoreSpansForIncomingRequests
|
|
37701
|
+
}) {
|
|
37702
|
+
if (import_core34.isTracingSuppressed(import_api2.context.active())) {
|
|
37703
|
+
return true;
|
|
37704
|
+
}
|
|
37705
|
+
const urlPath = request.url;
|
|
37706
|
+
const method = request.method?.toUpperCase();
|
|
37707
|
+
if (method === "OPTIONS" || method === "HEAD" || !urlPath) {
|
|
37708
|
+
return true;
|
|
37709
|
+
}
|
|
37710
|
+
if (ignoreStaticAssets && method === "GET" && isStaticAssetRequest(urlPath)) {
|
|
37711
|
+
return true;
|
|
37712
|
+
}
|
|
37713
|
+
if (ignoreSpansForIncomingRequests?.(urlPath, request)) {
|
|
37714
|
+
return true;
|
|
37715
|
+
}
|
|
37716
|
+
return false;
|
|
37776
37717
|
}
|
|
37777
37718
|
|
|
37778
37719
|
// ../../node_modules/@sentry/opentelemetry/build/esm/index.js
|
|
37779
37720
|
var import_semantic_conventions2 = __toESM(require_src2(), 1);
|
|
37780
37721
|
var api = __toESM(require_src(), 1);
|
|
37781
|
-
var
|
|
37782
|
-
var
|
|
37722
|
+
var import_api3 = __toESM(require_src(), 1);
|
|
37723
|
+
var import_core37 = __toESM(require_src3(), 1);
|
|
37783
37724
|
var import_sdk_trace_base = __toESM(require_src9(), 1);
|
|
37784
37725
|
var SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE = "sentry.parentIsRemote";
|
|
37785
37726
|
var SEMANTIC_ATTRIBUTE_SENTRY_GRAPHQL_OPERATION = "sentry.graphql.operation";
|
|
@@ -37837,7 +37778,7 @@ function getSpanKind(span) {
|
|
|
37837
37778
|
if (spanHasKind(span)) {
|
|
37838
37779
|
return span.kind;
|
|
37839
37780
|
}
|
|
37840
|
-
return
|
|
37781
|
+
return import_api3.SpanKind.INTERNAL;
|
|
37841
37782
|
}
|
|
37842
37783
|
var SENTRY_TRACE_HEADER = "sentry-trace";
|
|
37843
37784
|
var SENTRY_BAGGAGE_HEADER = "baggage";
|
|
@@ -37846,19 +37787,19 @@ var SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING = "sentry.sampled_not_recording";
|
|
|
37846
37787
|
var SENTRY_TRACE_STATE_URL = "sentry.url";
|
|
37847
37788
|
var SENTRY_TRACE_STATE_SAMPLE_RAND = "sentry.sample_rand";
|
|
37848
37789
|
var SENTRY_TRACE_STATE_SAMPLE_RATE = "sentry.sample_rate";
|
|
37849
|
-
var SENTRY_SCOPES_CONTEXT_KEY =
|
|
37850
|
-
var SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY =
|
|
37851
|
-
var SENTRY_FORK_SET_SCOPE_CONTEXT_KEY =
|
|
37852
|
-
var SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY =
|
|
37790
|
+
var SENTRY_SCOPES_CONTEXT_KEY = import_api3.createContextKey("sentry_scopes");
|
|
37791
|
+
var SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY = import_api3.createContextKey("sentry_fork_isolation_scope");
|
|
37792
|
+
var SENTRY_FORK_SET_SCOPE_CONTEXT_KEY = import_api3.createContextKey("sentry_fork_set_scope");
|
|
37793
|
+
var SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY = import_api3.createContextKey("sentry_fork_set_isolation_scope");
|
|
37853
37794
|
var SCOPE_CONTEXT_FIELD = "_scopeContext";
|
|
37854
|
-
function getScopesFromContext(
|
|
37855
|
-
return
|
|
37795
|
+
function getScopesFromContext(context4) {
|
|
37796
|
+
return context4.getValue(SENTRY_SCOPES_CONTEXT_KEY);
|
|
37856
37797
|
}
|
|
37857
|
-
function setScopesOnContext(
|
|
37858
|
-
return
|
|
37798
|
+
function setScopesOnContext(context4, scopes) {
|
|
37799
|
+
return context4.setValue(SENTRY_SCOPES_CONTEXT_KEY, scopes);
|
|
37859
37800
|
}
|
|
37860
|
-
function setContextOnScope(scope,
|
|
37861
|
-
addNonEnumerableProperty(scope, SCOPE_CONTEXT_FIELD,
|
|
37801
|
+
function setContextOnScope(scope, context4) {
|
|
37802
|
+
addNonEnumerableProperty(scope, SCOPE_CONTEXT_FIELD, context4);
|
|
37862
37803
|
}
|
|
37863
37804
|
function getContextFromScope(scope) {
|
|
37864
37805
|
return scope[SCOPE_CONTEXT_FIELD];
|
|
@@ -37866,7 +37807,7 @@ function getContextFromScope(scope) {
|
|
|
37866
37807
|
function getSamplingDecision(spanContext) {
|
|
37867
37808
|
const { traceFlags, traceState } = spanContext;
|
|
37868
37809
|
const sampledNotRecording = traceState ? traceState.get(SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING) === "1" : false;
|
|
37869
|
-
if (traceFlags ===
|
|
37810
|
+
if (traceFlags === import_api3.TraceFlags.SAMPLED) {
|
|
37870
37811
|
return true;
|
|
37871
37812
|
}
|
|
37872
37813
|
if (sampledNotRecording) {
|
|
@@ -37941,10 +37882,10 @@ function descriptionForDbSystem({ attributes, name }) {
|
|
|
37941
37882
|
function descriptionForHttpMethod({ name, kind, attributes }, httpMethod) {
|
|
37942
37883
|
const opParts = ["http"];
|
|
37943
37884
|
switch (kind) {
|
|
37944
|
-
case
|
|
37885
|
+
case import_api3.SpanKind.CLIENT:
|
|
37945
37886
|
opParts.push("client");
|
|
37946
37887
|
break;
|
|
37947
|
-
case
|
|
37888
|
+
case import_api3.SpanKind.SERVER:
|
|
37948
37889
|
opParts.push("server");
|
|
37949
37890
|
break;
|
|
37950
37891
|
}
|
|
@@ -37969,7 +37910,7 @@ function descriptionForHttpMethod({ name, kind, attributes }, httpMethod) {
|
|
|
37969
37910
|
if (fragment) {
|
|
37970
37911
|
data["http.fragment"] = fragment;
|
|
37971
37912
|
}
|
|
37972
|
-
const isClientOrServerKind = kind ===
|
|
37913
|
+
const isClientOrServerKind = kind === import_api3.SpanKind.CLIENT || kind === import_api3.SpanKind.SERVER;
|
|
37973
37914
|
const origin = attributes[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] || "manual";
|
|
37974
37915
|
const isManualSpan = !`${origin}`.startsWith("auto");
|
|
37975
37916
|
const alreadyHasCustomSource = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] === "custom";
|
|
@@ -38005,7 +37946,7 @@ function getSanitizedUrl(attributes, kind) {
|
|
|
38005
37946
|
if (typeof httpRoute === "string") {
|
|
38006
37947
|
return { urlPath: httpRoute, url, query, fragment, hasRoute: true };
|
|
38007
37948
|
}
|
|
38008
|
-
if (kind ===
|
|
37949
|
+
if (kind === import_api3.SpanKind.SERVER && typeof httpTarget === "string") {
|
|
38009
37950
|
return { urlPath: stripUrlQueryAndFragment(httpTarget), url, query, fragment, hasRoute: false };
|
|
38010
37951
|
}
|
|
38011
37952
|
if (parsedUrl) {
|
|
@@ -38046,7 +37987,7 @@ function enhanceDscWithOpenTelemetryRootSpanName(client) {
|
|
|
38046
37987
|
});
|
|
38047
37988
|
}
|
|
38048
37989
|
function getActiveSpan2() {
|
|
38049
|
-
return
|
|
37990
|
+
return import_api3.trace.getActiveSpan();
|
|
38050
37991
|
}
|
|
38051
37992
|
var DEBUG_BUILD3 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
|
|
38052
37993
|
function makeTraceState({
|
|
@@ -38054,7 +37995,7 @@ function makeTraceState({
|
|
|
38054
37995
|
sampled
|
|
38055
37996
|
}) {
|
|
38056
37997
|
const dscString = dsc ? dynamicSamplingContextToSentryBaggageHeader(dsc) : undefined;
|
|
38057
|
-
const traceStateBase = new
|
|
37998
|
+
const traceStateBase = new import_core37.TraceState;
|
|
38058
37999
|
const traceStateWithDsc = dscString ? traceStateBase.set(SENTRY_TRACE_STATE_DSC, dscString) : traceStateBase;
|
|
38059
38000
|
return sampled === false ? traceStateWithDsc.set(SENTRY_TRACE_STATE_SAMPLED_NOT_RECORDING, "1") : traceStateWithDsc;
|
|
38060
38001
|
}
|
|
@@ -38066,18 +38007,18 @@ function setIsSetup(element) {
|
|
|
38066
38007
|
setupElements.add(element);
|
|
38067
38008
|
}
|
|
38068
38009
|
|
|
38069
|
-
class SentryPropagator extends
|
|
38010
|
+
class SentryPropagator extends import_core37.W3CBaggagePropagator {
|
|
38070
38011
|
constructor() {
|
|
38071
38012
|
super();
|
|
38072
38013
|
setIsSetup("SentryPropagator");
|
|
38073
38014
|
this._urlMatchesTargetsMap = new LRUMap(100);
|
|
38074
38015
|
}
|
|
38075
|
-
inject(
|
|
38076
|
-
if (
|
|
38016
|
+
inject(context4, carrier, setter) {
|
|
38017
|
+
if (import_core37.isTracingSuppressed(context4)) {
|
|
38077
38018
|
DEBUG_BUILD3 && debug.log("[Tracing] Not injecting trace data for url because tracing is suppressed.");
|
|
38078
38019
|
return;
|
|
38079
38020
|
}
|
|
38080
|
-
const activeSpan =
|
|
38021
|
+
const activeSpan = import_api3.trace.getSpan(context4);
|
|
38081
38022
|
const url = activeSpan && getCurrentURL(activeSpan);
|
|
38082
38023
|
const tracePropagationTargets = getClient()?.getOptions()?.tracePropagationTargets;
|
|
38083
38024
|
if (!shouldPropagateTraceForUrl(url, tracePropagationTargets, this._urlMatchesTargetsMap)) {
|
|
@@ -38085,8 +38026,8 @@ class SentryPropagator extends import_core38.W3CBaggagePropagator {
|
|
|
38085
38026
|
return;
|
|
38086
38027
|
}
|
|
38087
38028
|
const existingBaggageHeader = getExistingBaggage(carrier);
|
|
38088
|
-
let baggage =
|
|
38089
|
-
const { dynamicSamplingContext, traceId, spanId, sampled } = getInjectionData(
|
|
38029
|
+
let baggage = import_api3.propagation.getBaggage(context4) || import_api3.propagation.createBaggage({});
|
|
38030
|
+
const { dynamicSamplingContext, traceId, spanId, sampled } = getInjectionData(context4);
|
|
38090
38031
|
if (existingBaggageHeader) {
|
|
38091
38032
|
const baggageEntries = parseBaggageHeader(existingBaggageHeader);
|
|
38092
38033
|
if (baggageEntries) {
|
|
@@ -38103,16 +38044,16 @@ class SentryPropagator extends import_core38.W3CBaggagePropagator {
|
|
|
38103
38044
|
return b;
|
|
38104
38045
|
}, baggage);
|
|
38105
38046
|
}
|
|
38106
|
-
if (traceId && traceId !==
|
|
38047
|
+
if (traceId && traceId !== import_api3.INVALID_TRACEID) {
|
|
38107
38048
|
setter.set(carrier, SENTRY_TRACE_HEADER, generateSentryTraceHeader(traceId, spanId, sampled));
|
|
38108
38049
|
}
|
|
38109
|
-
super.inject(
|
|
38050
|
+
super.inject(import_api3.propagation.setBaggage(context4, baggage), carrier, setter);
|
|
38110
38051
|
}
|
|
38111
|
-
extract(
|
|
38052
|
+
extract(context4, carrier, getter) {
|
|
38112
38053
|
const maybeSentryTraceHeader = getter.get(carrier, SENTRY_TRACE_HEADER);
|
|
38113
38054
|
const baggage = getter.get(carrier, SENTRY_BAGGAGE_HEADER);
|
|
38114
38055
|
const sentryTrace = maybeSentryTraceHeader ? Array.isArray(maybeSentryTraceHeader) ? maybeSentryTraceHeader[0] : maybeSentryTraceHeader : undefined;
|
|
38115
|
-
return ensureScopesOnContext(getContextWithRemoteActiveSpan(
|
|
38056
|
+
return ensureScopesOnContext(getContextWithRemoteActiveSpan(context4, { sentryTrace, baggage }));
|
|
38116
38057
|
}
|
|
38117
38058
|
fields() {
|
|
38118
38059
|
return [SENTRY_TRACE_HEADER, SENTRY_BAGGAGE_HEADER];
|
|
@@ -38133,8 +38074,8 @@ function shouldPropagateTraceForUrl(url, tracePropagationTargets, decisionMap) {
|
|
|
38133
38074
|
DEBUG_BUILD3 && !decision && debug.log(NOT_PROPAGATED_MESSAGE, url);
|
|
38134
38075
|
return decision;
|
|
38135
38076
|
}
|
|
38136
|
-
function getInjectionData(
|
|
38137
|
-
const span =
|
|
38077
|
+
function getInjectionData(context4, options = {}) {
|
|
38078
|
+
const span = import_api3.trace.getSpan(context4);
|
|
38138
38079
|
if (span?.spanContext().isRemote) {
|
|
38139
38080
|
const spanContext = span.spanContext();
|
|
38140
38081
|
const dynamicSamplingContext2 = getDynamicSamplingContextFromSpan(span);
|
|
@@ -38155,7 +38096,7 @@ function getInjectionData(context5, options = {}) {
|
|
|
38155
38096
|
sampled: getSamplingDecision(spanContext)
|
|
38156
38097
|
};
|
|
38157
38098
|
}
|
|
38158
|
-
const scope = options.scope || getScopesFromContext(
|
|
38099
|
+
const scope = options.scope || getScopesFromContext(context4)?.scope || getCurrentScope();
|
|
38159
38100
|
const client = options.client || getClient();
|
|
38160
38101
|
const propagationContext = scope.getPropagationContext();
|
|
38161
38102
|
const dynamicSamplingContext = client ? getDynamicSamplingContextFromScope(client, scope) : undefined;
|
|
@@ -38180,11 +38121,11 @@ function getContextWithRemoteActiveSpan(ctx, { sentryTrace, baggage }) {
|
|
|
38180
38121
|
sampled,
|
|
38181
38122
|
dsc
|
|
38182
38123
|
});
|
|
38183
|
-
return
|
|
38124
|
+
return import_api3.trace.setSpanContext(ctx, spanContext);
|
|
38184
38125
|
}
|
|
38185
38126
|
function continueTraceAsRemoteSpan(ctx, options, callback) {
|
|
38186
38127
|
const ctxWithSpanContext = ensureScopesOnContext(getContextWithRemoteActiveSpan(ctx, options));
|
|
38187
|
-
return
|
|
38128
|
+
return import_api3.context.with(ctxWithSpanContext, callback);
|
|
38188
38129
|
}
|
|
38189
38130
|
function ensureScopesOnContext(ctx) {
|
|
38190
38131
|
const scopes = getScopesFromContext(ctx);
|
|
@@ -38228,7 +38169,7 @@ function generateRemoteSpanContext({
|
|
|
38228
38169
|
traceId,
|
|
38229
38170
|
spanId,
|
|
38230
38171
|
isRemote: true,
|
|
38231
|
-
traceFlags: sampled ?
|
|
38172
|
+
traceFlags: sampled ? import_api3.TraceFlags.SAMPLED : import_api3.TraceFlags.NONE,
|
|
38232
38173
|
traceState
|
|
38233
38174
|
};
|
|
38234
38175
|
return spanContext;
|
|
@@ -38239,13 +38180,13 @@ function startSpan2(options, callback) {
|
|
|
38239
38180
|
const wrapper = getActiveSpanWrapper2(customParentSpan);
|
|
38240
38181
|
return wrapper(() => {
|
|
38241
38182
|
const activeCtx = getContext(options.scope, options.forceTransaction);
|
|
38242
|
-
const shouldSkipSpan = options.onlyIfParent && !
|
|
38243
|
-
const ctx = shouldSkipSpan ?
|
|
38183
|
+
const shouldSkipSpan = options.onlyIfParent && !import_api3.trace.getSpan(activeCtx);
|
|
38184
|
+
const ctx = shouldSkipSpan ? import_core37.suppressTracing(activeCtx) : activeCtx;
|
|
38244
38185
|
const spanOptions = getSpanOptions(options);
|
|
38245
38186
|
return tracer.startActiveSpan(name, spanOptions, ctx, (span) => {
|
|
38246
38187
|
return handleCallbackErrors(() => callback(span), () => {
|
|
38247
38188
|
if (spanToJSON(span).status === undefined) {
|
|
38248
|
-
span.setStatus({ code:
|
|
38189
|
+
span.setStatus({ code: import_api3.SpanStatusCode.ERROR });
|
|
38249
38190
|
}
|
|
38250
38191
|
}, () => span.end());
|
|
38251
38192
|
});
|
|
@@ -38257,13 +38198,13 @@ function startSpanManual2(options, callback) {
|
|
|
38257
38198
|
const wrapper = getActiveSpanWrapper2(customParentSpan);
|
|
38258
38199
|
return wrapper(() => {
|
|
38259
38200
|
const activeCtx = getContext(options.scope, options.forceTransaction);
|
|
38260
|
-
const shouldSkipSpan = options.onlyIfParent && !
|
|
38261
|
-
const ctx = shouldSkipSpan ?
|
|
38201
|
+
const shouldSkipSpan = options.onlyIfParent && !import_api3.trace.getSpan(activeCtx);
|
|
38202
|
+
const ctx = shouldSkipSpan ? import_core37.suppressTracing(activeCtx) : activeCtx;
|
|
38262
38203
|
const spanOptions = getSpanOptions(options);
|
|
38263
38204
|
return tracer.startActiveSpan(name, spanOptions, ctx, (span) => {
|
|
38264
38205
|
return handleCallbackErrors(() => callback(span, () => span.end()), () => {
|
|
38265
38206
|
if (spanToJSON(span).status === undefined) {
|
|
38266
|
-
span.setStatus({ code:
|
|
38207
|
+
span.setStatus({ code: import_api3.SpanStatusCode.ERROR });
|
|
38267
38208
|
}
|
|
38268
38209
|
});
|
|
38269
38210
|
});
|
|
@@ -38275,20 +38216,20 @@ function startInactiveSpan2(options) {
|
|
|
38275
38216
|
const wrapper = getActiveSpanWrapper2(customParentSpan);
|
|
38276
38217
|
return wrapper(() => {
|
|
38277
38218
|
const activeCtx = getContext(options.scope, options.forceTransaction);
|
|
38278
|
-
const shouldSkipSpan = options.onlyIfParent && !
|
|
38279
|
-
const ctx = shouldSkipSpan ?
|
|
38219
|
+
const shouldSkipSpan = options.onlyIfParent && !import_api3.trace.getSpan(activeCtx);
|
|
38220
|
+
const ctx = shouldSkipSpan ? import_core37.suppressTracing(activeCtx) : activeCtx;
|
|
38280
38221
|
const spanOptions = getSpanOptions(options);
|
|
38281
38222
|
const span = tracer.startSpan(name, spanOptions, ctx);
|
|
38282
38223
|
return span;
|
|
38283
38224
|
});
|
|
38284
38225
|
}
|
|
38285
38226
|
function withActiveSpan2(span, callback) {
|
|
38286
|
-
const newContextWithActiveSpan = span ?
|
|
38287
|
-
return
|
|
38227
|
+
const newContextWithActiveSpan = span ? import_api3.trace.setSpan(import_api3.context.active(), span) : import_api3.trace.deleteSpan(import_api3.context.active());
|
|
38228
|
+
return import_api3.context.with(newContextWithActiveSpan, () => callback(getCurrentScope()));
|
|
38288
38229
|
}
|
|
38289
38230
|
function getTracer() {
|
|
38290
38231
|
const client = getClient();
|
|
38291
|
-
return client?.tracer ||
|
|
38232
|
+
return client?.tracer || import_api3.trace.getTracer("@sentry/opentelemetry", SDK_VERSION);
|
|
38292
38233
|
}
|
|
38293
38234
|
function getSpanOptions(options) {
|
|
38294
38235
|
const { startTime, attributes, kind, op, links } = options;
|
|
@@ -38309,14 +38250,14 @@ function ensureTimestampInMilliseconds(timestamp) {
|
|
|
38309
38250
|
}
|
|
38310
38251
|
function getContext(scope, forceTransaction) {
|
|
38311
38252
|
const ctx = getContextForScope(scope);
|
|
38312
|
-
const parentSpan =
|
|
38253
|
+
const parentSpan = import_api3.trace.getSpan(ctx);
|
|
38313
38254
|
if (!parentSpan) {
|
|
38314
38255
|
return ctx;
|
|
38315
38256
|
}
|
|
38316
38257
|
if (!forceTransaction) {
|
|
38317
38258
|
return ctx;
|
|
38318
38259
|
}
|
|
38319
|
-
const ctxWithoutSpan =
|
|
38260
|
+
const ctxWithoutSpan = import_api3.trace.deleteSpan(ctx);
|
|
38320
38261
|
const { spanId, traceId } = parentSpan.spanContext();
|
|
38321
38262
|
const sampled = getSamplingDecision(parentSpan.spanContext());
|
|
38322
38263
|
const rootSpan = getRootSpan(parentSpan);
|
|
@@ -38329,10 +38270,10 @@ function getContext(scope, forceTransaction) {
|
|
|
38329
38270
|
traceId,
|
|
38330
38271
|
spanId,
|
|
38331
38272
|
isRemote: true,
|
|
38332
|
-
traceFlags: sampled ?
|
|
38273
|
+
traceFlags: sampled ? import_api3.TraceFlags.SAMPLED : import_api3.TraceFlags.NONE,
|
|
38333
38274
|
traceState
|
|
38334
38275
|
};
|
|
38335
|
-
const ctxWithSpanContext =
|
|
38276
|
+
const ctxWithSpanContext = import_api3.trace.setSpanContext(ctxWithoutSpan, spanOptions);
|
|
38336
38277
|
return ctxWithSpanContext;
|
|
38337
38278
|
}
|
|
38338
38279
|
function getContextForScope(scope) {
|
|
@@ -38342,14 +38283,14 @@ function getContextForScope(scope) {
|
|
|
38342
38283
|
return ctx;
|
|
38343
38284
|
}
|
|
38344
38285
|
}
|
|
38345
|
-
return
|
|
38286
|
+
return import_api3.context.active();
|
|
38346
38287
|
}
|
|
38347
38288
|
function continueTrace2(options, callback) {
|
|
38348
|
-
return continueTraceAsRemoteSpan(
|
|
38289
|
+
return continueTraceAsRemoteSpan(import_api3.context.active(), options, callback);
|
|
38349
38290
|
}
|
|
38350
38291
|
function getTraceContextForScope(client, scope) {
|
|
38351
38292
|
const ctx = getContextFromScope(scope);
|
|
38352
|
-
const span = ctx &&
|
|
38293
|
+
const span = ctx && import_api3.trace.getSpan(ctx);
|
|
38353
38294
|
const traceContext = span ? spanToTraceContext(span) : getTraceContextFromScope(scope);
|
|
38354
38295
|
const dynamicSamplingContext = span ? getDynamicSamplingContextFromSpan(span) : getDynamicSamplingContextFromScope(client, scope);
|
|
38355
38296
|
return [dynamicSamplingContext, traceContext];
|
|
@@ -38360,8 +38301,8 @@ function getActiveSpanWrapper2(parentSpan) {
|
|
|
38360
38301
|
} : (callback) => callback();
|
|
38361
38302
|
}
|
|
38362
38303
|
function suppressTracing2(callback) {
|
|
38363
|
-
const ctx =
|
|
38364
|
-
return
|
|
38304
|
+
const ctx = import_core37.suppressTracing(import_api3.context.active());
|
|
38305
|
+
return import_api3.context.with(ctx, callback);
|
|
38365
38306
|
}
|
|
38366
38307
|
function setupEventContextTrace(client) {
|
|
38367
38308
|
client.on("preprocessEvent", (event) => {
|
|
@@ -38463,17 +38404,17 @@ function wrapContextManagerClass(ContextManagerClass) {
|
|
|
38463
38404
|
super(...args);
|
|
38464
38405
|
setIsSetup("SentryContextManager");
|
|
38465
38406
|
}
|
|
38466
|
-
with(
|
|
38467
|
-
const currentScopes = getScopesFromContext(
|
|
38407
|
+
with(context4, fn, thisArg, ...args) {
|
|
38408
|
+
const currentScopes = getScopesFromContext(context4);
|
|
38468
38409
|
const currentScope = currentScopes?.scope || getCurrentScope();
|
|
38469
38410
|
const currentIsolationScope = currentScopes?.isolationScope || getIsolationScope();
|
|
38470
|
-
const shouldForkIsolationScope =
|
|
38471
|
-
const scope =
|
|
38472
|
-
const isolationScope =
|
|
38411
|
+
const shouldForkIsolationScope = context4.getValue(SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY) === true;
|
|
38412
|
+
const scope = context4.getValue(SENTRY_FORK_SET_SCOPE_CONTEXT_KEY);
|
|
38413
|
+
const isolationScope = context4.getValue(SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY);
|
|
38473
38414
|
const newCurrentScope = scope || currentScope.clone();
|
|
38474
38415
|
const newIsolationScope = isolationScope || (shouldForkIsolationScope ? currentIsolationScope.clone() : currentIsolationScope);
|
|
38475
38416
|
const scopes = { scope: newCurrentScope, isolationScope: newIsolationScope };
|
|
38476
|
-
const ctx1 = setScopesOnContext(
|
|
38417
|
+
const ctx1 = setScopesOnContext(context4, scopes);
|
|
38477
38418
|
const ctx2 = ctx1.deleteValue(SENTRY_FORK_ISOLATION_SCOPE_CONTEXT_KEY).deleteValue(SENTRY_FORK_SET_SCOPE_CONTEXT_KEY).deleteValue(SENTRY_FORK_SET_ISOLATION_SCOPE_CONTEXT_KEY);
|
|
38478
38419
|
setContextOnScope(newCurrentScope, ctx2);
|
|
38479
38420
|
return super.with(ctx2, fn, thisArg, ...args);
|
|
@@ -38550,9 +38491,9 @@ function mapStatus(span) {
|
|
|
38550
38491
|
const attributes = spanHasAttributes(span) ? span.attributes : {};
|
|
38551
38492
|
const status = spanHasStatus(span) ? span.status : undefined;
|
|
38552
38493
|
if (status) {
|
|
38553
|
-
if (status.code ===
|
|
38494
|
+
if (status.code === import_api3.SpanStatusCode.OK) {
|
|
38554
38495
|
return { code: SPAN_STATUS_OK };
|
|
38555
|
-
} else if (status.code ===
|
|
38496
|
+
} else if (status.code === import_api3.SpanStatusCode.ERROR) {
|
|
38556
38497
|
if (typeof status.message === "undefined") {
|
|
38557
38498
|
const inferredStatus2 = inferStatusFromAttributes(attributes);
|
|
38558
38499
|
if (inferredStatus2) {
|
|
@@ -38570,7 +38511,7 @@ function mapStatus(span) {
|
|
|
38570
38511
|
if (inferredStatus) {
|
|
38571
38512
|
return inferredStatus;
|
|
38572
38513
|
}
|
|
38573
|
-
if (status?.code ===
|
|
38514
|
+
if (status?.code === import_api3.SpanStatusCode.UNSET) {
|
|
38574
38515
|
return { code: SPAN_STATUS_OK };
|
|
38575
38516
|
} else {
|
|
38576
38517
|
return { code: SPAN_STATUS_ERROR, message: "unknown_error" };
|
|
@@ -38821,8 +38762,8 @@ function removeSentryAttributes(data) {
|
|
|
38821
38762
|
function getData(span) {
|
|
38822
38763
|
const attributes = span.attributes;
|
|
38823
38764
|
const data = {};
|
|
38824
|
-
if (span.kind !==
|
|
38825
|
-
data["otel.kind"] =
|
|
38765
|
+
if (span.kind !== import_api3.SpanKind.INTERNAL) {
|
|
38766
|
+
data["otel.kind"] = import_api3.SpanKind[span.kind];
|
|
38826
38767
|
}
|
|
38827
38768
|
const maybeHttpStatusCodeAttribute = attributes[import_semantic_conventions2.SEMATTRS_HTTP_STATUS_CODE];
|
|
38828
38769
|
if (maybeHttpStatusCodeAttribute) {
|
|
@@ -38841,7 +38782,7 @@ function getData(span) {
|
|
|
38841
38782
|
return data;
|
|
38842
38783
|
}
|
|
38843
38784
|
function onSpanStart(span, parentContext) {
|
|
38844
|
-
const parentSpan =
|
|
38785
|
+
const parentSpan = import_api3.trace.getSpan(parentContext);
|
|
38845
38786
|
let scopes = getScopesFromContext(parentContext);
|
|
38846
38787
|
if (parentSpan && !parentSpan.spanContext().isRemote) {
|
|
38847
38788
|
addChildSpanToSpan(parentSpan, span);
|
|
@@ -38849,7 +38790,7 @@ function onSpanStart(span, parentContext) {
|
|
|
38849
38790
|
if (parentSpan?.spanContext().isRemote) {
|
|
38850
38791
|
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_PARENT_IS_REMOTE, true);
|
|
38851
38792
|
}
|
|
38852
|
-
if (parentContext ===
|
|
38793
|
+
if (parentContext === import_api3.ROOT_CONTEXT) {
|
|
38853
38794
|
scopes = {
|
|
38854
38795
|
scope: getDefaultCurrentScope(),
|
|
38855
38796
|
isolationScope: getDefaultIsolationScope()
|
|
@@ -38893,23 +38834,23 @@ class SentrySampler {
|
|
|
38893
38834
|
this._client = client;
|
|
38894
38835
|
setIsSetup("SentrySampler");
|
|
38895
38836
|
}
|
|
38896
|
-
shouldSample(
|
|
38837
|
+
shouldSample(context4, traceId, spanName, spanKind, spanAttributes, _links) {
|
|
38897
38838
|
const options = this._client.getOptions();
|
|
38898
|
-
const parentSpan = getValidSpan(
|
|
38839
|
+
const parentSpan = getValidSpan(context4);
|
|
38899
38840
|
const parentContext = parentSpan?.spanContext();
|
|
38900
38841
|
if (!hasSpansEnabled(options)) {
|
|
38901
|
-
return wrapSamplingDecision({ decision: undefined, context:
|
|
38842
|
+
return wrapSamplingDecision({ decision: undefined, context: context4, spanAttributes });
|
|
38902
38843
|
}
|
|
38903
38844
|
const maybeSpanHttpMethod = spanAttributes[import_semantic_conventions2.SEMATTRS_HTTP_METHOD] || spanAttributes[import_semantic_conventions2.ATTR_HTTP_REQUEST_METHOD];
|
|
38904
|
-
if (spanKind ===
|
|
38905
|
-
return wrapSamplingDecision({ decision: undefined, context:
|
|
38845
|
+
if (spanKind === import_api3.SpanKind.CLIENT && maybeSpanHttpMethod && (!parentSpan || parentContext?.isRemote)) {
|
|
38846
|
+
return wrapSamplingDecision({ decision: undefined, context: context4, spanAttributes });
|
|
38906
38847
|
}
|
|
38907
38848
|
const parentSampled = parentSpan ? getParentSampled(parentSpan, traceId, spanName) : undefined;
|
|
38908
38849
|
const isRootSpan = !parentSpan || parentContext?.isRemote;
|
|
38909
38850
|
if (!isRootSpan) {
|
|
38910
38851
|
return wrapSamplingDecision({
|
|
38911
38852
|
decision: parentSampled ? import_sdk_trace_base.SamplingDecision.RECORD_AND_SAMPLED : import_sdk_trace_base.SamplingDecision.NOT_RECORD,
|
|
38912
|
-
context:
|
|
38853
|
+
context: context4,
|
|
38913
38854
|
spanAttributes
|
|
38914
38855
|
});
|
|
38915
38856
|
}
|
|
@@ -38933,9 +38874,9 @@ class SentrySampler {
|
|
|
38933
38874
|
parentContext
|
|
38934
38875
|
}, mutableSamplingDecision);
|
|
38935
38876
|
if (!mutableSamplingDecision.decision) {
|
|
38936
|
-
return wrapSamplingDecision({ decision: undefined, context:
|
|
38877
|
+
return wrapSamplingDecision({ decision: undefined, context: context4, spanAttributes });
|
|
38937
38878
|
}
|
|
38938
|
-
const { isolationScope } = getScopesFromContext(
|
|
38879
|
+
const { isolationScope } = getScopesFromContext(context4) ?? {};
|
|
38939
38880
|
const dscString = parentContext?.traceState ? parentContext.traceState.get(SENTRY_TRACE_STATE_DSC) : undefined;
|
|
38940
38881
|
const dsc = dscString ? baggageHeaderToDynamicSamplingContext(dscString) : undefined;
|
|
38941
38882
|
const sampleRand = parseSampleRate(dsc?.sample_rand) ?? Math.random();
|
|
@@ -38951,7 +38892,7 @@ class SentrySampler {
|
|
|
38951
38892
|
DEBUG_BUILD3 && debug.log(`[Tracing] Not sampling span because HTTP method is '${method}' for ${spanName}`);
|
|
38952
38893
|
return wrapSamplingDecision({
|
|
38953
38894
|
decision: import_sdk_trace_base.SamplingDecision.NOT_RECORD,
|
|
38954
|
-
context:
|
|
38895
|
+
context: context4,
|
|
38955
38896
|
spanAttributes,
|
|
38956
38897
|
sampleRand,
|
|
38957
38898
|
downstreamTraceSampleRate: 0
|
|
@@ -38964,7 +38905,7 @@ class SentrySampler {
|
|
|
38964
38905
|
return {
|
|
38965
38906
|
...wrapSamplingDecision({
|
|
38966
38907
|
decision: sampled ? import_sdk_trace_base.SamplingDecision.RECORD_AND_SAMPLED : import_sdk_trace_base.SamplingDecision.NOT_RECORD,
|
|
38967
|
-
context:
|
|
38908
|
+
context: context4,
|
|
38968
38909
|
spanAttributes,
|
|
38969
38910
|
sampleRand,
|
|
38970
38911
|
downstreamTraceSampleRate: localSampleRateWasApplied ? sampleRate : undefined
|
|
@@ -38980,7 +38921,7 @@ class SentrySampler {
|
|
|
38980
38921
|
}
|
|
38981
38922
|
function getParentSampled(parentSpan, traceId, spanName) {
|
|
38982
38923
|
const parentContext = parentSpan.spanContext();
|
|
38983
|
-
if (
|
|
38924
|
+
if (import_api3.isSpanContextValid(parentContext) && parentContext.traceId === traceId) {
|
|
38984
38925
|
if (parentContext.isRemote) {
|
|
38985
38926
|
const parentSampled2 = getSamplingDecision(parentSpan.spanContext());
|
|
38986
38927
|
DEBUG_BUILD3 && debug.log(`[Tracing] Inheriting remote parent's sampled decision for ${spanName}: ${parentSampled2}`);
|
|
@@ -38994,12 +38935,12 @@ function getParentSampled(parentSpan, traceId, spanName) {
|
|
|
38994
38935
|
}
|
|
38995
38936
|
function wrapSamplingDecision({
|
|
38996
38937
|
decision,
|
|
38997
|
-
context:
|
|
38938
|
+
context: context4,
|
|
38998
38939
|
spanAttributes,
|
|
38999
38940
|
sampleRand,
|
|
39000
38941
|
downstreamTraceSampleRate
|
|
39001
38942
|
}) {
|
|
39002
|
-
let traceState = getBaseTraceState(
|
|
38943
|
+
let traceState = getBaseTraceState(context4, spanAttributes);
|
|
39003
38944
|
if (downstreamTraceSampleRate !== undefined) {
|
|
39004
38945
|
traceState = traceState.set(SENTRY_TRACE_STATE_SAMPLE_RATE, `${downstreamTraceSampleRate}`);
|
|
39005
38946
|
}
|
|
@@ -39014,19 +38955,19 @@ function wrapSamplingDecision({
|
|
|
39014
38955
|
}
|
|
39015
38956
|
return { decision, traceState };
|
|
39016
38957
|
}
|
|
39017
|
-
function getBaseTraceState(
|
|
39018
|
-
const parentSpan =
|
|
38958
|
+
function getBaseTraceState(context4, spanAttributes) {
|
|
38959
|
+
const parentSpan = import_api3.trace.getSpan(context4);
|
|
39019
38960
|
const parentContext = parentSpan?.spanContext();
|
|
39020
|
-
let traceState = parentContext?.traceState || new
|
|
38961
|
+
let traceState = parentContext?.traceState || new import_core37.TraceState;
|
|
39021
38962
|
const url = spanAttributes[import_semantic_conventions2.SEMATTRS_HTTP_URL] || spanAttributes[import_semantic_conventions2.ATTR_URL_FULL];
|
|
39022
38963
|
if (url && typeof url === "string") {
|
|
39023
38964
|
traceState = traceState.set(SENTRY_TRACE_STATE_URL, url);
|
|
39024
38965
|
}
|
|
39025
38966
|
return traceState;
|
|
39026
38967
|
}
|
|
39027
|
-
function getValidSpan(
|
|
39028
|
-
const span =
|
|
39029
|
-
return span &&
|
|
38968
|
+
function getValidSpan(context4) {
|
|
38969
|
+
const span = import_api3.trace.getSpan(context4);
|
|
38970
|
+
return span && import_api3.isSpanContextValid(span.spanContext()) ? span : undefined;
|
|
39030
38971
|
}
|
|
39031
38972
|
|
|
39032
38973
|
// ../../node_modules/@sentry/node-core/build/esm/utils/baggage.js
|
|
@@ -39141,6 +39082,21 @@ class SentryHttpInstrumentation extends import_instrumentation2.InstrumentationB
|
|
|
39141
39082
|
}
|
|
39142
39083
|
init() {
|
|
39143
39084
|
let hasRegisteredHandlers = false;
|
|
39085
|
+
const spansEnabled = this.getConfig().spans ?? true;
|
|
39086
|
+
const onHttpServerRequestStart = (_data) => {
|
|
39087
|
+
const data = _data;
|
|
39088
|
+
instrumentServer(data.server, {
|
|
39089
|
+
instrumentation: this.getConfig().instrumentation,
|
|
39090
|
+
ignoreIncomingRequestBody: this.getConfig().ignoreIncomingRequestBody,
|
|
39091
|
+
ignoreSpansForIncomingRequests: this.getConfig().ignoreSpansForIncomingRequests,
|
|
39092
|
+
incomingRequestSpanHook: this.getConfig().incomingRequestSpanHook,
|
|
39093
|
+
maxIncomingRequestBodySize: this.getConfig().maxIncomingRequestBodySize,
|
|
39094
|
+
trackIncomingRequestsAsSessions: this.getConfig().trackIncomingRequestsAsSessions,
|
|
39095
|
+
sessionFlushingDelayMS: this.getConfig().sessionFlushingDelayMS ?? 60000,
|
|
39096
|
+
ignoreStaticAssets: this.getConfig().ignoreStaticAssets,
|
|
39097
|
+
spans: spansEnabled && !this.getConfig().disableIncomingRequestSpans
|
|
39098
|
+
});
|
|
39099
|
+
};
|
|
39144
39100
|
const onHttpClientResponseFinish = (_data) => {
|
|
39145
39101
|
const data = _data;
|
|
39146
39102
|
this._onOutgoingRequestFinish(data.request, data.response);
|
|
@@ -39158,14 +39114,16 @@ class SentryHttpInstrumentation extends import_instrumentation2.InstrumentationB
|
|
|
39158
39114
|
return moduleExports;
|
|
39159
39115
|
}
|
|
39160
39116
|
hasRegisteredHandlers = true;
|
|
39161
|
-
|
|
39162
|
-
|
|
39117
|
+
subscribe("http.server.request.start", onHttpServerRequestStart);
|
|
39118
|
+
subscribe("http.client.response.finish", onHttpClientResponseFinish);
|
|
39119
|
+
subscribe("http.client.request.error", onHttpClientRequestError);
|
|
39163
39120
|
if (this.getConfig().propagateTraceInOutgoingRequests) {
|
|
39164
|
-
|
|
39121
|
+
subscribe("http.client.request.created", onHttpClientRequestCreated);
|
|
39165
39122
|
}
|
|
39166
39123
|
return moduleExports;
|
|
39167
39124
|
};
|
|
39168
39125
|
const unwrap = () => {
|
|
39126
|
+
unsubscribe("http.server.request.start", onHttpServerRequestStart);
|
|
39169
39127
|
unsubscribe("http.client.response.finish", onHttpClientResponseFinish);
|
|
39170
39128
|
unsubscribe("http.client.request.error", onHttpClientRequestError);
|
|
39171
39129
|
unsubscribe("http.client.request.created", onHttpClientRequestCreated);
|
|
@@ -39194,7 +39152,7 @@ class SentryHttpInstrumentation extends import_instrumentation2.InstrumentationB
|
|
|
39194
39152
|
addTracePropagationHeadersToOutgoingRequest(request, this._propagationDecisionMap);
|
|
39195
39153
|
}
|
|
39196
39154
|
_shouldIgnoreOutgoingRequest(request) {
|
|
39197
|
-
if (
|
|
39155
|
+
if (import_core40.isTracingSuppressed(import_api4.context.active())) {
|
|
39198
39156
|
return true;
|
|
39199
39157
|
}
|
|
39200
39158
|
const ignoreOutgoingRequests = this.getConfig().ignoreOutgoingRequests;
|
|
@@ -39208,51 +39166,53 @@ class SentryHttpInstrumentation extends import_instrumentation2.InstrumentationB
|
|
|
39208
39166
|
}
|
|
39209
39167
|
|
|
39210
39168
|
// ../../node_modules/@sentry/node-core/build/esm/integrations/http/index.js
|
|
39211
|
-
var
|
|
39212
|
-
var instrumentSentryHttp = generateInstrumentOnce(`${
|
|
39169
|
+
var INTEGRATION_NAME6 = "Http";
|
|
39170
|
+
var instrumentSentryHttp = generateInstrumentOnce(`${INTEGRATION_NAME6}.sentry`, (options) => {
|
|
39213
39171
|
return new SentryHttpInstrumentation(options);
|
|
39214
39172
|
});
|
|
39215
39173
|
var httpIntegration = defineIntegration((options = {}) => {
|
|
39216
|
-
const
|
|
39217
|
-
|
|
39218
|
-
|
|
39219
|
-
|
|
39220
|
-
|
|
39221
|
-
};
|
|
39222
|
-
const serverSpansOptions = {
|
|
39223
|
-
ignoreIncomingRequests: options.ignoreIncomingRequests,
|
|
39224
|
-
ignoreStaticAssets: options.ignoreStaticAssets,
|
|
39225
|
-
ignoreStatusCodes: options.dropSpansForIncomingRequestStatusCodes
|
|
39226
|
-
};
|
|
39227
|
-
const httpInstrumentationOptions = {
|
|
39228
|
-
breadcrumbs: options.breadcrumbs,
|
|
39229
|
-
propagateTraceInOutgoingRequests: true,
|
|
39230
|
-
ignoreOutgoingRequests: options.ignoreOutgoingRequests
|
|
39231
|
-
};
|
|
39232
|
-
const server = httpServerIntegration(serverOptions);
|
|
39233
|
-
const serverSpans = httpServerSpansIntegration(serverSpansOptions);
|
|
39234
|
-
const spans = options.spans ?? false;
|
|
39235
|
-
const disableIncomingRequestSpans = options.disableIncomingRequestSpans ?? false;
|
|
39236
|
-
const enabledServerSpans = spans && !disableIncomingRequestSpans;
|
|
39174
|
+
const dropSpansForIncomingRequestStatusCodes = options.dropSpansForIncomingRequestStatusCodes ?? [
|
|
39175
|
+
[401, 404],
|
|
39176
|
+
[301, 303],
|
|
39177
|
+
[305, 399]
|
|
39178
|
+
];
|
|
39237
39179
|
return {
|
|
39238
|
-
name:
|
|
39239
|
-
setup(client) {
|
|
39240
|
-
if (enabledServerSpans) {
|
|
39241
|
-
serverSpans.setup(client);
|
|
39242
|
-
}
|
|
39243
|
-
},
|
|
39180
|
+
name: INTEGRATION_NAME6,
|
|
39244
39181
|
setupOnce() {
|
|
39245
|
-
|
|
39246
|
-
|
|
39182
|
+
instrumentSentryHttp({
|
|
39183
|
+
...options,
|
|
39184
|
+
ignoreSpansForIncomingRequests: options.ignoreIncomingRequests,
|
|
39185
|
+
disableIncomingRequestSpans: true,
|
|
39186
|
+
propagateTraceInOutgoingRequests: true
|
|
39187
|
+
});
|
|
39247
39188
|
},
|
|
39248
39189
|
processEvent(event) {
|
|
39249
|
-
|
|
39190
|
+
if (event.type === "transaction") {
|
|
39191
|
+
const statusCode = event.contexts?.trace?.data?.["http.response.status_code"];
|
|
39192
|
+
if (typeof statusCode === "number") {
|
|
39193
|
+
const shouldDrop = shouldFilterStatusCode(statusCode, dropSpansForIncomingRequestStatusCodes);
|
|
39194
|
+
if (shouldDrop) {
|
|
39195
|
+
DEBUG_BUILD2 && debug.log("Dropping transaction due to status code", statusCode);
|
|
39196
|
+
return null;
|
|
39197
|
+
}
|
|
39198
|
+
}
|
|
39199
|
+
}
|
|
39200
|
+
return event;
|
|
39250
39201
|
}
|
|
39251
39202
|
};
|
|
39252
39203
|
});
|
|
39204
|
+
function shouldFilterStatusCode(statusCode, dropForStatusCodes) {
|
|
39205
|
+
return dropForStatusCodes.some((code) => {
|
|
39206
|
+
if (typeof code === "number") {
|
|
39207
|
+
return code === statusCode;
|
|
39208
|
+
}
|
|
39209
|
+
const [min, max] = code;
|
|
39210
|
+
return statusCode >= min && statusCode <= max;
|
|
39211
|
+
});
|
|
39212
|
+
}
|
|
39253
39213
|
// ../../node_modules/@sentry/node-core/build/esm/integrations/node-fetch/SentryNodeFetchInstrumentation.js
|
|
39254
|
-
var
|
|
39255
|
-
var
|
|
39214
|
+
var import_api5 = __toESM(require_src(), 1);
|
|
39215
|
+
var import_core44 = __toESM(require_src3(), 1);
|
|
39256
39216
|
var import_instrumentation3 = __toESM(require_src6(), 1);
|
|
39257
39217
|
import * as diagch from "diagnostics_channel";
|
|
39258
39218
|
|
|
@@ -39372,7 +39332,7 @@ class SentryNodeFetchInstrumentation extends import_instrumentation3.Instrumenta
|
|
|
39372
39332
|
});
|
|
39373
39333
|
}
|
|
39374
39334
|
_shouldIgnoreOutgoingRequest(request) {
|
|
39375
|
-
if (
|
|
39335
|
+
if (import_core44.isTracingSuppressed(import_api5.context.active())) {
|
|
39376
39336
|
return true;
|
|
39377
39337
|
}
|
|
39378
39338
|
const url = getAbsoluteUrl2(request.origin, request.path);
|
|
@@ -39437,8 +39397,8 @@ function getAbsoluteUrl2(origin, path7 = "/") {
|
|
|
39437
39397
|
}
|
|
39438
39398
|
|
|
39439
39399
|
// ../../node_modules/@sentry/node-core/build/esm/integrations/node-fetch/index.js
|
|
39440
|
-
var
|
|
39441
|
-
var instrumentSentryNodeFetch = generateInstrumentOnce(`${
|
|
39400
|
+
var INTEGRATION_NAME7 = "NodeFetch";
|
|
39401
|
+
var instrumentSentryNodeFetch = generateInstrumentOnce(`${INTEGRATION_NAME7}.sentry`, SentryNodeFetchInstrumentation, (options) => {
|
|
39442
39402
|
return options;
|
|
39443
39403
|
});
|
|
39444
39404
|
var _nativeNodeFetchIntegration = (options = {}) => {
|
|
@@ -39458,7 +39418,7 @@ import { join as join2 } from "node:path";
|
|
|
39458
39418
|
import { promisify } from "node:util";
|
|
39459
39419
|
var readFileAsync = promisify(readFile);
|
|
39460
39420
|
var readDirAsync = promisify(readdir);
|
|
39461
|
-
var
|
|
39421
|
+
var INTEGRATION_NAME8 = "Context";
|
|
39462
39422
|
var _nodeContextIntegration = (options = {}) => {
|
|
39463
39423
|
let cachedContext;
|
|
39464
39424
|
const _options = {
|
|
@@ -39507,7 +39467,7 @@ var _nodeContextIntegration = (options = {}) => {
|
|
|
39507
39467
|
return contexts;
|
|
39508
39468
|
}
|
|
39509
39469
|
return {
|
|
39510
|
-
name:
|
|
39470
|
+
name: INTEGRATION_NAME8,
|
|
39511
39471
|
processEvent(event) {
|
|
39512
39472
|
return addContext(event);
|
|
39513
39473
|
}
|
|
@@ -39741,7 +39701,7 @@ import { createInterface } from "node:readline";
|
|
|
39741
39701
|
var LRU_FILE_CONTENTS_CACHE = new LRUMap(10);
|
|
39742
39702
|
var LRU_FILE_CONTENTS_FS_READ_FAILED = new LRUMap(20);
|
|
39743
39703
|
var DEFAULT_LINES_OF_CONTEXT = 7;
|
|
39744
|
-
var
|
|
39704
|
+
var INTEGRATION_NAME9 = "ContextLines";
|
|
39745
39705
|
var MAX_CONTEXTLINES_COLNO = 1000;
|
|
39746
39706
|
var MAX_CONTEXTLINES_LINENO = 1e4;
|
|
39747
39707
|
function emplace(map, key, contents) {
|
|
@@ -39978,7 +39938,7 @@ function makeContextRange(line, linecontext) {
|
|
|
39978
39938
|
var _contextLinesIntegration = (options = {}) => {
|
|
39979
39939
|
const contextLines = options.frameContextLines !== undefined ? options.frameContextLines : DEFAULT_LINES_OF_CONTEXT;
|
|
39980
39940
|
return {
|
|
39981
|
-
name:
|
|
39941
|
+
name: INTEGRATION_NAME9,
|
|
39982
39942
|
processEvent(event) {
|
|
39983
39943
|
return addSourceContext(event, contextLines);
|
|
39984
39944
|
}
|
|
@@ -40039,7 +39999,7 @@ function functionNamesMatch(a, b) {
|
|
|
40039
39999
|
}
|
|
40040
40000
|
|
|
40041
40001
|
// ../../node_modules/@sentry/node-core/build/esm/integrations/local-variables/local-variables-async.js
|
|
40042
|
-
var base64WorkerScript = "
|
|
40002
|
+
var base64WorkerScript = "LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjE2LjAgKDc0YzUyMTMpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=";
|
|
40043
40003
|
function log2(...args) {
|
|
40044
40004
|
debug.log("[LocalVariables]", ...args);
|
|
40045
40005
|
}
|
|
@@ -40246,7 +40206,7 @@ class AsyncSession {
|
|
|
40246
40206
|
next(vars);
|
|
40247
40207
|
}
|
|
40248
40208
|
}
|
|
40249
|
-
var
|
|
40209
|
+
var INTEGRATION_NAME10 = "LocalVariables";
|
|
40250
40210
|
var _localVariablesSyncIntegration = (options = {}, sessionOverride) => {
|
|
40251
40211
|
const cachedFrames = new LRUMap(20);
|
|
40252
40212
|
let rateLimiter;
|
|
@@ -40281,7 +40241,7 @@ var _localVariablesSyncIntegration = (options = {}, sessionOverride) => {
|
|
|
40281
40241
|
return event;
|
|
40282
40242
|
}
|
|
40283
40243
|
return {
|
|
40284
|
-
name:
|
|
40244
|
+
name: INTEGRATION_NAME10,
|
|
40285
40245
|
async setupOnce() {
|
|
40286
40246
|
const client = getClient();
|
|
40287
40247
|
const clientOptions = client?.getOptions();
|
|
@@ -40401,11 +40361,11 @@ function supportsEsmLoaderHooks() {
|
|
|
40401
40361
|
|
|
40402
40362
|
// ../../node_modules/@sentry/node-core/build/esm/integrations/modules.js
|
|
40403
40363
|
var moduleCache;
|
|
40404
|
-
var
|
|
40364
|
+
var INTEGRATION_NAME11 = "Modules";
|
|
40405
40365
|
var SERVER_MODULES = typeof __SENTRY_SERVER_MODULES__ === "undefined" ? {} : __SENTRY_SERVER_MODULES__;
|
|
40406
40366
|
var _modulesIntegration = () => {
|
|
40407
40367
|
return {
|
|
40408
|
-
name:
|
|
40368
|
+
name: INTEGRATION_NAME11,
|
|
40409
40369
|
processEvent(event) {
|
|
40410
40370
|
event.modules = {
|
|
40411
40371
|
...event.modules,
|
|
@@ -40509,14 +40469,14 @@ function logAndExitProcess(error2) {
|
|
|
40509
40469
|
}
|
|
40510
40470
|
|
|
40511
40471
|
// ../../node_modules/@sentry/node-core/build/esm/integrations/onuncaughtexception.js
|
|
40512
|
-
var
|
|
40472
|
+
var INTEGRATION_NAME12 = "OnUncaughtException";
|
|
40513
40473
|
var onUncaughtExceptionIntegration = defineIntegration((options = {}) => {
|
|
40514
40474
|
const optionsWithDefaults = {
|
|
40515
40475
|
exitEvenIfOtherHandlersAreRegistered: false,
|
|
40516
40476
|
...options
|
|
40517
40477
|
};
|
|
40518
40478
|
return {
|
|
40519
|
-
name:
|
|
40479
|
+
name: INTEGRATION_NAME12,
|
|
40520
40480
|
setup(client) {
|
|
40521
40481
|
global.process.on("uncaughtException", makeErrorHandler(client, optionsWithDefaults));
|
|
40522
40482
|
}
|
|
@@ -40580,14 +40540,14 @@ function makeErrorHandler(client, options) {
|
|
|
40580
40540
|
}
|
|
40581
40541
|
|
|
40582
40542
|
// ../../node_modules/@sentry/node-core/build/esm/integrations/onunhandledrejection.js
|
|
40583
|
-
var
|
|
40543
|
+
var INTEGRATION_NAME13 = "OnUnhandledRejection";
|
|
40584
40544
|
var _onUnhandledRejectionIntegration = (options = {}) => {
|
|
40585
40545
|
const opts = {
|
|
40586
40546
|
mode: "warn",
|
|
40587
40547
|
...options
|
|
40588
40548
|
};
|
|
40589
40549
|
return {
|
|
40590
|
-
name:
|
|
40550
|
+
name: INTEGRATION_NAME13,
|
|
40591
40551
|
setup(client) {
|
|
40592
40552
|
global.process.on("unhandledRejection", makeUnhandledPromiseHandler(client, opts));
|
|
40593
40553
|
}
|
|
@@ -40635,13 +40595,13 @@ function handleRejection(reason, mode) {
|
|
|
40635
40595
|
|
|
40636
40596
|
// ../../node_modules/@sentry/node-core/build/esm/integrations/spotlight.js
|
|
40637
40597
|
import * as http from "node:http";
|
|
40638
|
-
var
|
|
40598
|
+
var INTEGRATION_NAME14 = "Spotlight";
|
|
40639
40599
|
var _spotlightIntegration = (options = {}) => {
|
|
40640
40600
|
const _options = {
|
|
40641
40601
|
sidecarUrl: options.sidecarUrl || "http://localhost:8969/stream"
|
|
40642
40602
|
};
|
|
40643
40603
|
return {
|
|
40644
|
-
name:
|
|
40604
|
+
name: INTEGRATION_NAME14,
|
|
40645
40605
|
setup(client) {
|
|
40646
40606
|
try {
|
|
40647
40607
|
if (false) {}
|
|
@@ -40700,7 +40660,7 @@ function parseSidecarUrl(url) {
|
|
|
40700
40660
|
|
|
40701
40661
|
// ../../node_modules/@sentry/node-core/build/esm/integrations/systemError.js
|
|
40702
40662
|
import * as util from "node:util";
|
|
40703
|
-
var
|
|
40663
|
+
var INTEGRATION_NAME15 = "NodeSystemError";
|
|
40704
40664
|
function isSystemError(error2) {
|
|
40705
40665
|
if (!(error2 instanceof Error)) {
|
|
40706
40666
|
return false;
|
|
@@ -40712,7 +40672,7 @@ function isSystemError(error2) {
|
|
|
40712
40672
|
}
|
|
40713
40673
|
var systemErrorIntegration = defineIntegration((options = {}) => {
|
|
40714
40674
|
return {
|
|
40715
|
-
name:
|
|
40675
|
+
name: INTEGRATION_NAME15,
|
|
40716
40676
|
processEvent: (event, hint, client) => {
|
|
40717
40677
|
if (!isSystemError(hint.originalException)) {
|
|
40718
40678
|
return event;
|
|
@@ -40746,10 +40706,10 @@ var systemErrorIntegration = defineIntegration((options = {}) => {
|
|
|
40746
40706
|
|
|
40747
40707
|
// ../../node_modules/@sentry/node-core/build/esm/integrations/childProcess.js
|
|
40748
40708
|
import * as diagnosticsChannel from "node:diagnostics_channel";
|
|
40749
|
-
var
|
|
40709
|
+
var INTEGRATION_NAME16 = "ChildProcess";
|
|
40750
40710
|
var childProcessIntegration = defineIntegration((options = {}) => {
|
|
40751
40711
|
return {
|
|
40752
|
-
name:
|
|
40712
|
+
name: INTEGRATION_NAME16,
|
|
40753
40713
|
setup() {
|
|
40754
40714
|
diagnosticsChannel.channel("child_process").subscribe((event) => {
|
|
40755
40715
|
if (event && typeof event === "object" && "process" in event) {
|
|
@@ -40824,22 +40784,22 @@ function captureWorkerThreadEvents(worker, options) {
|
|
|
40824
40784
|
var import_context_async_hooks = __toESM(require_src10(), 1);
|
|
40825
40785
|
var SentryContextManager = wrapContextManagerClass(import_context_async_hooks.AsyncLocalStorageContextManager);
|
|
40826
40786
|
// ../../node_modules/@sentry/node-core/build/esm/otel/logger.js
|
|
40827
|
-
var
|
|
40787
|
+
var import_api6 = __toESM(require_src(), 1);
|
|
40828
40788
|
function setupOpenTelemetryLogger() {
|
|
40829
|
-
|
|
40830
|
-
|
|
40789
|
+
import_api6.diag.disable();
|
|
40790
|
+
import_api6.diag.setLogger({
|
|
40831
40791
|
error: debug.error,
|
|
40832
40792
|
warn: debug.warn,
|
|
40833
40793
|
info: debug.log,
|
|
40834
40794
|
debug: debug.log,
|
|
40835
40795
|
verbose: debug.log
|
|
40836
|
-
},
|
|
40796
|
+
}, import_api6.DiagLogLevel.DEBUG);
|
|
40837
40797
|
}
|
|
40838
40798
|
// ../../node_modules/@sentry/node-core/build/esm/integrations/processSession.js
|
|
40839
|
-
var
|
|
40799
|
+
var INTEGRATION_NAME17 = "ProcessSession";
|
|
40840
40800
|
var processSessionIntegration = defineIntegration(() => {
|
|
40841
40801
|
return {
|
|
40842
|
-
name:
|
|
40802
|
+
name: INTEGRATION_NAME17,
|
|
40843
40803
|
setupOnce() {
|
|
40844
40804
|
startSession();
|
|
40845
40805
|
process.on("beforeExit", () => {
|
|
@@ -41256,7 +41216,7 @@ function getSentryRelease(fallback) {
|
|
|
41256
41216
|
var defaultStackParser = createStackParser(nodeStackLineParser(createGetModuleFromFilename()));
|
|
41257
41217
|
|
|
41258
41218
|
// ../../node_modules/@sentry/node-core/build/esm/sdk/client.js
|
|
41259
|
-
var
|
|
41219
|
+
var import_api7 = __toESM(require_src(), 1);
|
|
41260
41220
|
var import_instrumentation4 = __toESM(require_src6(), 1);
|
|
41261
41221
|
import * as os2 from "node:os";
|
|
41262
41222
|
import { threadId, isMainThread } from "worker_threads";
|
|
@@ -41300,7 +41260,7 @@ class NodeClient extends ServerRuntimeClient {
|
|
|
41300
41260
|
}
|
|
41301
41261
|
const name = "@sentry/node";
|
|
41302
41262
|
const version = SDK_VERSION;
|
|
41303
|
-
const tracer =
|
|
41263
|
+
const tracer = import_api7.trace.getTracer(name, version);
|
|
41304
41264
|
this._tracer = tracer;
|
|
41305
41265
|
return tracer;
|
|
41306
41266
|
}
|
|
@@ -41410,7 +41370,7 @@ function _init(_options = {}, getDefaultIntegrationsImpl) {
|
|
|
41410
41370
|
setOpenTelemetryContextAsyncContextStrategy();
|
|
41411
41371
|
const scope = getCurrentScope();
|
|
41412
41372
|
scope.update(options.initialScope);
|
|
41413
|
-
if (options.spotlight && !options.integrations.some(({ name }) => name ===
|
|
41373
|
+
if (options.spotlight && !options.integrations.some(({ name }) => name === INTEGRATION_NAME14)) {
|
|
41414
41374
|
options.integrations.push(spotlightIntegration({
|
|
41415
41375
|
sidecarUrl: typeof options.spotlight === "string" ? options.spotlight : undefined
|
|
41416
41376
|
}));
|
|
@@ -41503,19 +41463,22 @@ function updateScopeFromEnvVariables() {
|
|
|
41503
41463
|
function addOriginToSpan2(span, origin) {
|
|
41504
41464
|
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, origin);
|
|
41505
41465
|
}
|
|
41466
|
+
// ../../node_modules/@sentry/node/build/esm/debug-build.js
|
|
41467
|
+
var DEBUG_BUILD4 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
|
|
41468
|
+
|
|
41506
41469
|
// ../../node_modules/@sentry/node/build/esm/integrations/http.js
|
|
41507
|
-
var
|
|
41470
|
+
var INTEGRATION_NAME18 = "Http";
|
|
41508
41471
|
var INSTRUMENTATION_NAME2 = "@opentelemetry_sentry-patched/instrumentation-http";
|
|
41509
|
-
var instrumentSentryHttp2 = generateInstrumentOnce(`${
|
|
41472
|
+
var instrumentSentryHttp2 = generateInstrumentOnce(`${INTEGRATION_NAME18}.sentry`, (options) => {
|
|
41510
41473
|
return new SentryHttpInstrumentation(options);
|
|
41511
41474
|
});
|
|
41512
|
-
var instrumentOtelHttp = generateInstrumentOnce(
|
|
41475
|
+
var instrumentOtelHttp = generateInstrumentOnce(INTEGRATION_NAME18, (config) => {
|
|
41513
41476
|
const instrumentation = new import_instrumentation_http.HttpInstrumentation({
|
|
41514
41477
|
...config,
|
|
41515
41478
|
disableIncomingRequestInstrumentation: true
|
|
41516
41479
|
});
|
|
41517
41480
|
try {
|
|
41518
|
-
instrumentation["_diag"] =
|
|
41481
|
+
instrumentation["_diag"] = import_api9.diag.createComponentLogger({
|
|
41519
41482
|
namespace: INSTRUMENTATION_NAME2
|
|
41520
41483
|
});
|
|
41521
41484
|
instrumentation.instrumentationName = INSTRUMENTATION_NAME2;
|
|
@@ -41535,49 +41498,40 @@ function _shouldUseOtelHttpInstrumentation(options, clientOptions = {}) {
|
|
|
41535
41498
|
return true;
|
|
41536
41499
|
}
|
|
41537
41500
|
var httpIntegration2 = defineIntegration((options = {}) => {
|
|
41538
|
-
const
|
|
41539
|
-
|
|
41540
|
-
|
|
41541
|
-
|
|
41542
|
-
|
|
41543
|
-
ignoreRequestBody: options.ignoreIncomingRequestBody,
|
|
41544
|
-
maxRequestBodySize: options.maxIncomingRequestBodySize
|
|
41545
|
-
};
|
|
41546
|
-
const serverSpansOptions = {
|
|
41547
|
-
ignoreIncomingRequests: options.ignoreIncomingRequests,
|
|
41548
|
-
ignoreStaticAssets: options.ignoreStaticAssets,
|
|
41549
|
-
ignoreStatusCodes: options.dropSpansForIncomingRequestStatusCodes,
|
|
41550
|
-
instrumentation: options.instrumentation,
|
|
41551
|
-
onSpanCreated: options.incomingRequestSpanHook
|
|
41552
|
-
};
|
|
41553
|
-
const server = httpServerIntegration(serverOptions);
|
|
41554
|
-
const serverSpans = httpServerSpansIntegration(serverSpansOptions);
|
|
41555
|
-
const enableServerSpans = spans && !disableIncomingRequestSpans;
|
|
41501
|
+
const dropSpansForIncomingRequestStatusCodes = options.dropSpansForIncomingRequestStatusCodes ?? [
|
|
41502
|
+
[401, 404],
|
|
41503
|
+
[301, 303],
|
|
41504
|
+
[305, 399]
|
|
41505
|
+
];
|
|
41556
41506
|
return {
|
|
41557
|
-
name:
|
|
41558
|
-
setup(client) {
|
|
41559
|
-
const clientOptions = client.getOptions();
|
|
41560
|
-
if (enableServerSpans && hasSpansEnabled(clientOptions)) {
|
|
41561
|
-
serverSpans.setup(client);
|
|
41562
|
-
}
|
|
41563
|
-
},
|
|
41507
|
+
name: INTEGRATION_NAME18,
|
|
41564
41508
|
setupOnce() {
|
|
41565
41509
|
const clientOptions = getClient()?.getOptions() || {};
|
|
41566
41510
|
const useOtelHttpInstrumentation = _shouldUseOtelHttpInstrumentation(options, clientOptions);
|
|
41567
|
-
|
|
41568
|
-
|
|
41569
|
-
|
|
41570
|
-
|
|
41571
|
-
|
|
41572
|
-
|
|
41573
|
-
|
|
41511
|
+
const disableIncomingRequestSpans = options.disableIncomingRequestSpans ?? !hasSpansEnabled(clientOptions);
|
|
41512
|
+
instrumentSentryHttp2({
|
|
41513
|
+
...options,
|
|
41514
|
+
disableIncomingRequestSpans,
|
|
41515
|
+
ignoreSpansForIncomingRequests: options.ignoreIncomingRequests,
|
|
41516
|
+
propagateTraceInOutgoingRequests: !useOtelHttpInstrumentation
|
|
41517
|
+
});
|
|
41574
41518
|
if (useOtelHttpInstrumentation) {
|
|
41575
41519
|
const instrumentationConfig = getConfigWithDefaults(options);
|
|
41576
41520
|
instrumentOtelHttp(instrumentationConfig);
|
|
41577
41521
|
}
|
|
41578
41522
|
},
|
|
41579
41523
|
processEvent(event) {
|
|
41580
|
-
|
|
41524
|
+
if (event.type === "transaction") {
|
|
41525
|
+
const statusCode = event.contexts?.trace?.data?.["http.response.status_code"];
|
|
41526
|
+
if (typeof statusCode === "number") {
|
|
41527
|
+
const shouldDrop = shouldFilterStatusCode2(statusCode, dropSpansForIncomingRequestStatusCodes);
|
|
41528
|
+
if (shouldDrop) {
|
|
41529
|
+
DEBUG_BUILD4 && debug.log("Dropping transaction due to status code", statusCode);
|
|
41530
|
+
return null;
|
|
41531
|
+
}
|
|
41532
|
+
}
|
|
41533
|
+
}
|
|
41534
|
+
return event;
|
|
41581
41535
|
}
|
|
41582
41536
|
};
|
|
41583
41537
|
});
|
|
@@ -41608,14 +41562,23 @@ function getConfigWithDefaults(options = {}) {
|
|
|
41608
41562
|
};
|
|
41609
41563
|
return instrumentationConfig;
|
|
41610
41564
|
}
|
|
41565
|
+
function shouldFilterStatusCode2(statusCode, dropForStatusCodes) {
|
|
41566
|
+
return dropForStatusCodes.some((code) => {
|
|
41567
|
+
if (typeof code === "number") {
|
|
41568
|
+
return code === statusCode;
|
|
41569
|
+
}
|
|
41570
|
+
const [min, max] = code;
|
|
41571
|
+
return statusCode >= min && statusCode <= max;
|
|
41572
|
+
});
|
|
41573
|
+
}
|
|
41611
41574
|
|
|
41612
41575
|
// ../../node_modules/@sentry/node/build/esm/integrations/node-fetch.js
|
|
41613
41576
|
var import_instrumentation_undici = __toESM(require_src11(), 1);
|
|
41614
|
-
var
|
|
41615
|
-
var instrumentOtelNodeFetch = generateInstrumentOnce(
|
|
41577
|
+
var INTEGRATION_NAME19 = "NodeFetch";
|
|
41578
|
+
var instrumentOtelNodeFetch = generateInstrumentOnce(INTEGRATION_NAME19, import_instrumentation_undici.UndiciInstrumentation, (options) => {
|
|
41616
41579
|
return getConfigWithDefaults2(options);
|
|
41617
41580
|
});
|
|
41618
|
-
var instrumentSentryNodeFetch2 = generateInstrumentOnce(`${
|
|
41581
|
+
var instrumentSentryNodeFetch2 = generateInstrumentOnce(`${INTEGRATION_NAME19}.sentry`, SentryNodeFetchInstrumentation, (options) => {
|
|
41619
41582
|
return options;
|
|
41620
41583
|
});
|
|
41621
41584
|
var _nativeNodeFetchIntegration2 = (options = {}) => {
|
|
@@ -41664,12 +41627,7 @@ function getConfigWithDefaults2(options = {}) {
|
|
|
41664
41627
|
|
|
41665
41628
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/express.js
|
|
41666
41629
|
var import_instrumentation_express = __toESM(require_src12(), 1);
|
|
41667
|
-
|
|
41668
|
-
// ../../node_modules/@sentry/node/build/esm/debug-build.js
|
|
41669
|
-
var DEBUG_BUILD4 = typeof __SENTRY_DEBUG__ === "undefined" || __SENTRY_DEBUG__;
|
|
41670
|
-
|
|
41671
|
-
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/express.js
|
|
41672
|
-
var INTEGRATION_NAME22 = "Express";
|
|
41630
|
+
var INTEGRATION_NAME20 = "Express";
|
|
41673
41631
|
function requestHook(span) {
|
|
41674
41632
|
addOriginToSpan2(span, "auto.http.otel.express");
|
|
41675
41633
|
const attributes = spanToJSON(span).data;
|
|
@@ -41694,13 +41652,13 @@ function spanNameHook(info, defaultName) {
|
|
|
41694
41652
|
}
|
|
41695
41653
|
return defaultName;
|
|
41696
41654
|
}
|
|
41697
|
-
var instrumentExpress = generateInstrumentOnce(
|
|
41655
|
+
var instrumentExpress = generateInstrumentOnce(INTEGRATION_NAME20, () => new import_instrumentation_express.ExpressInstrumentation({
|
|
41698
41656
|
requestHook: (span) => requestHook(span),
|
|
41699
41657
|
spanNameHook: (info, defaultName) => spanNameHook(info, defaultName)
|
|
41700
41658
|
}));
|
|
41701
41659
|
var _expressIntegration = () => {
|
|
41702
41660
|
return {
|
|
41703
|
-
name:
|
|
41661
|
+
name: INTEGRATION_NAME20,
|
|
41704
41662
|
setupOnce() {
|
|
41705
41663
|
instrumentExpress();
|
|
41706
41664
|
}
|
|
@@ -41712,8 +41670,8 @@ var expressIntegration = defineIntegration(_expressIntegration);
|
|
|
41712
41670
|
import * as dc from "node:diagnostics_channel";
|
|
41713
41671
|
|
|
41714
41672
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/fastify/fastify-otel/index.js
|
|
41715
|
-
var
|
|
41716
|
-
var
|
|
41673
|
+
var import_api10 = __toESM(require_src(), 1);
|
|
41674
|
+
var import_core72 = __toESM(require_src3(), 1);
|
|
41717
41675
|
var import_instrumentation5 = __toESM(require_src6(), 1);
|
|
41718
41676
|
var import_semantic_conventions3 = __toESM(require_src2(), 1);
|
|
41719
41677
|
import dc__default from "node:diagnostics_channel";
|
|
@@ -42969,7 +42927,7 @@ class FastifyOtelInstrumentation extends import_instrumentation5.Instrumentation
|
|
|
42969
42927
|
super(PACKAGE_NAME, PACKAGE_VERSION, config);
|
|
42970
42928
|
this.servername = config?.servername ?? process.env.OTEL_SERVICE_NAME ?? "fastify";
|
|
42971
42929
|
this[kIgnorePaths] = null;
|
|
42972
|
-
this._logger =
|
|
42930
|
+
this._logger = import_api10.diag.createComponentLogger({ namespace: PACKAGE_NAME });
|
|
42973
42931
|
if (config?.ignorePaths != null || process.env.OTEL_FASTIFY_IGNORE_PATHS != null) {
|
|
42974
42932
|
const ignorePaths = config?.ignorePaths ?? process.env.OTEL_FASTIFY_IGNORE_PATHS;
|
|
42975
42933
|
if ((typeof ignorePaths !== "string" || ignorePaths.length === 0) && typeof ignorePaths !== "function") {
|
|
@@ -43026,10 +42984,10 @@ class FastifyOtelInstrumentation extends import_instrumentation5.Instrumentation
|
|
|
43026
42984
|
tracer: instrumentation.tracer,
|
|
43027
42985
|
context: ctx,
|
|
43028
42986
|
inject: (carrier, setter) => {
|
|
43029
|
-
return
|
|
42987
|
+
return import_api10.propagation.inject(ctx, carrier, setter);
|
|
43030
42988
|
},
|
|
43031
42989
|
extract: (carrier, getter) => {
|
|
43032
|
-
return
|
|
42990
|
+
return import_api10.propagation.extract(ctx, carrier, getter);
|
|
43033
42991
|
}
|
|
43034
42992
|
};
|
|
43035
42993
|
});
|
|
@@ -43094,12 +43052,12 @@ class FastifyOtelInstrumentation extends import_instrumentation5.Instrumentation
|
|
|
43094
43052
|
this[kInstrumentation]._logger.debug(`Ignoring request ${request2.method} ${request2.url} because it matches the ignore path`);
|
|
43095
43053
|
return hookDone();
|
|
43096
43054
|
}
|
|
43097
|
-
let ctx =
|
|
43098
|
-
if (
|
|
43099
|
-
ctx =
|
|
43055
|
+
let ctx = import_api10.context.active();
|
|
43056
|
+
if (import_api10.trace.getSpan(ctx) == null) {
|
|
43057
|
+
ctx = import_api10.propagation.extract(ctx, request2.headers);
|
|
43100
43058
|
}
|
|
43101
|
-
const rpcMetadata =
|
|
43102
|
-
if (request2.routeOptions.url != null && rpcMetadata?.type ===
|
|
43059
|
+
const rpcMetadata = import_core72.getRPCMetadata(ctx);
|
|
43060
|
+
if (request2.routeOptions.url != null && rpcMetadata?.type === import_core72.RPCType.HTTP) {
|
|
43103
43061
|
rpcMetadata.route = request2.routeOptions.url;
|
|
43104
43062
|
}
|
|
43105
43063
|
const span = this[kInstrumentation].tracer.startSpan("request", {
|
|
@@ -43110,9 +43068,9 @@ class FastifyOtelInstrumentation extends import_instrumentation5.Instrumentation
|
|
|
43110
43068
|
[import_semantic_conventions3.ATTR_HTTP_REQUEST_METHOD]: request2.method
|
|
43111
43069
|
}
|
|
43112
43070
|
}, ctx);
|
|
43113
|
-
request2[kRequestContext] =
|
|
43071
|
+
request2[kRequestContext] = import_api10.trace.setSpan(ctx, span);
|
|
43114
43072
|
request2[kRequestSpan] = span;
|
|
43115
|
-
|
|
43073
|
+
import_api10.context.with(request2[kRequestContext], () => {
|
|
43116
43074
|
hookDone();
|
|
43117
43075
|
});
|
|
43118
43076
|
});
|
|
@@ -43120,7 +43078,7 @@ class FastifyOtelInstrumentation extends import_instrumentation5.Instrumentation
|
|
|
43120
43078
|
const span = request2[kRequestSpan];
|
|
43121
43079
|
if (span != null) {
|
|
43122
43080
|
span.setStatus({
|
|
43123
|
-
code:
|
|
43081
|
+
code: import_api10.SpanStatusCode.OK,
|
|
43124
43082
|
message: "OK"
|
|
43125
43083
|
});
|
|
43126
43084
|
span.setAttributes({
|
|
@@ -43139,7 +43097,7 @@ class FastifyOtelInstrumentation extends import_instrumentation5.Instrumentation
|
|
|
43139
43097
|
if (span != null) {
|
|
43140
43098
|
if (reply.statusCode < 500) {
|
|
43141
43099
|
span.setStatus({
|
|
43142
|
-
code:
|
|
43100
|
+
code: import_api10.SpanStatusCode.OK,
|
|
43143
43101
|
message: "OK"
|
|
43144
43102
|
});
|
|
43145
43103
|
}
|
|
@@ -43155,7 +43113,7 @@ class FastifyOtelInstrumentation extends import_instrumentation5.Instrumentation
|
|
|
43155
43113
|
const span = request2[kRequestSpan];
|
|
43156
43114
|
if (span != null) {
|
|
43157
43115
|
span.setStatus({
|
|
43158
|
-
code:
|
|
43116
|
+
code: import_api10.SpanStatusCode.ERROR,
|
|
43159
43117
|
message: error2.message
|
|
43160
43118
|
});
|
|
43161
43119
|
span.recordException(error2);
|
|
@@ -43218,11 +43176,11 @@ class FastifyOtelInstrumentation extends import_instrumentation5.Instrumentation
|
|
|
43218
43176
|
if (instrumentation2.isEnabled() === false) {
|
|
43219
43177
|
return handler.call(this, ...args);
|
|
43220
43178
|
}
|
|
43221
|
-
const ctx = request2[kRequestContext] ??
|
|
43179
|
+
const ctx = request2[kRequestContext] ?? import_api10.context.active();
|
|
43222
43180
|
const span = instrumentation2.tracer.startSpan(`handler - ${handler.name?.length > 0 ? handler.name : this.pluginName ?? ANONYMOUS_FUNCTION_NAME}`, {
|
|
43223
43181
|
attributes: spanAttributes
|
|
43224
43182
|
}, ctx);
|
|
43225
|
-
return
|
|
43183
|
+
return import_api10.context.with(import_api10.trace.setSpan(ctx, span), function() {
|
|
43226
43184
|
try {
|
|
43227
43185
|
const res = handler.call(this, ...args);
|
|
43228
43186
|
if (typeof res?.then === "function") {
|
|
@@ -43231,7 +43189,7 @@ class FastifyOtelInstrumentation extends import_instrumentation5.Instrumentation
|
|
|
43231
43189
|
return result;
|
|
43232
43190
|
}, (error2) => {
|
|
43233
43191
|
span.setStatus({
|
|
43234
|
-
code:
|
|
43192
|
+
code: import_api10.SpanStatusCode.ERROR,
|
|
43235
43193
|
message: error2.message
|
|
43236
43194
|
});
|
|
43237
43195
|
span.recordException(error2);
|
|
@@ -43243,7 +43201,7 @@ class FastifyOtelInstrumentation extends import_instrumentation5.Instrumentation
|
|
|
43243
43201
|
return res;
|
|
43244
43202
|
} catch (error2) {
|
|
43245
43203
|
span.setStatus({
|
|
43246
|
-
code:
|
|
43204
|
+
code: import_api10.SpanStatusCode.ERROR,
|
|
43247
43205
|
message: error2.message
|
|
43248
43206
|
});
|
|
43249
43207
|
span.recordException(error2);
|
|
@@ -43258,8 +43216,8 @@ class FastifyOtelInstrumentation extends import_instrumentation5.Instrumentation
|
|
|
43258
43216
|
}
|
|
43259
43217
|
|
|
43260
43218
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/fastify/v3/instrumentation.js
|
|
43261
|
-
var
|
|
43262
|
-
var
|
|
43219
|
+
var import_api12 = __toESM(require_src(), 1);
|
|
43220
|
+
var import_core73 = __toESM(require_src3(), 1);
|
|
43263
43221
|
var import_instrumentation6 = __toESM(require_src6(), 1);
|
|
43264
43222
|
var import_semantic_conventions4 = __toESM(require_src2(), 1);
|
|
43265
43223
|
|
|
@@ -43291,7 +43249,7 @@ var FastifyNames;
|
|
|
43291
43249
|
})(FastifyNames || (FastifyNames = {}));
|
|
43292
43250
|
|
|
43293
43251
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/fastify/v3/utils.js
|
|
43294
|
-
var
|
|
43252
|
+
var import_api11 = __toESM(require_src(), 1);
|
|
43295
43253
|
|
|
43296
43254
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/fastify/v3/constants.js
|
|
43297
43255
|
var spanRequestSymbol = Symbol("opentelemetry.instrumentation.fastify.request_active_span");
|
|
@@ -43316,7 +43274,7 @@ function endSpan(reply, err) {
|
|
|
43316
43274
|
spans.forEach((span) => {
|
|
43317
43275
|
if (err) {
|
|
43318
43276
|
span.setStatus({
|
|
43319
|
-
code:
|
|
43277
|
+
code: import_api11.SpanStatusCode.ERROR,
|
|
43320
43278
|
message: err.message
|
|
43321
43279
|
});
|
|
43322
43280
|
span.recordException(err);
|
|
@@ -43384,9 +43342,9 @@ class FastifyInstrumentationV3 extends import_instrumentation6.InstrumentationBa
|
|
|
43384
43342
|
}
|
|
43385
43343
|
instrumentation._wrap(reply, "send", instrumentation._patchSend());
|
|
43386
43344
|
const anyRequest = request2;
|
|
43387
|
-
const rpcMetadata =
|
|
43345
|
+
const rpcMetadata = import_core73.getRPCMetadata(import_api12.context.active());
|
|
43388
43346
|
const routeName = anyRequest.routeOptions ? anyRequest.routeOptions.url : request2.routerPath;
|
|
43389
|
-
if (routeName && rpcMetadata?.type ===
|
|
43347
|
+
if (routeName && rpcMetadata?.type === import_core73.RPCType.HTTP) {
|
|
43390
43348
|
rpcMetadata.route = routeName;
|
|
43391
43349
|
}
|
|
43392
43350
|
const method = request2.method || "GET";
|
|
@@ -43416,13 +43374,13 @@ class FastifyInstrumentationV3 extends import_instrumentation6.InstrumentationBa
|
|
|
43416
43374
|
origDone.apply(this, doneArgs);
|
|
43417
43375
|
};
|
|
43418
43376
|
}
|
|
43419
|
-
return
|
|
43377
|
+
return import_api12.context.with(import_api12.trace.setSpan(import_api12.context.active(), span), () => {
|
|
43420
43378
|
return safeExecuteInTheMiddleMaybePromise(() => {
|
|
43421
43379
|
return original.apply(this, args);
|
|
43422
43380
|
}, (err) => {
|
|
43423
43381
|
if (err instanceof Error) {
|
|
43424
43382
|
span.setStatus({
|
|
43425
|
-
code:
|
|
43383
|
+
code: import_api12.SpanStatusCode.ERROR,
|
|
43426
43384
|
message: err.message
|
|
43427
43385
|
});
|
|
43428
43386
|
span.recordException(err);
|
|
@@ -43519,7 +43477,7 @@ class FastifyInstrumentationV3 extends import_instrumentation6.InstrumentationBa
|
|
|
43519
43477
|
}
|
|
43520
43478
|
}, true);
|
|
43521
43479
|
}
|
|
43522
|
-
return
|
|
43480
|
+
return import_api12.context.with(import_api12.trace.setSpan(import_api12.context.active(), span), () => {
|
|
43523
43481
|
done();
|
|
43524
43482
|
});
|
|
43525
43483
|
};
|
|
@@ -43551,14 +43509,14 @@ function addFastifyV3SpanAttributes(span) {
|
|
|
43551
43509
|
}
|
|
43552
43510
|
|
|
43553
43511
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/fastify/index.js
|
|
43554
|
-
var
|
|
43555
|
-
var instrumentFastifyV3 = generateInstrumentOnce(`${
|
|
43512
|
+
var INTEGRATION_NAME21 = "Fastify";
|
|
43513
|
+
var instrumentFastifyV3 = generateInstrumentOnce(`${INTEGRATION_NAME21}.v3`, () => new FastifyInstrumentationV3);
|
|
43556
43514
|
function getFastifyIntegration() {
|
|
43557
43515
|
const client = getClient();
|
|
43558
43516
|
if (!client) {
|
|
43559
43517
|
return;
|
|
43560
43518
|
} else {
|
|
43561
|
-
return client.getIntegrationByName(
|
|
43519
|
+
return client.getIntegrationByName(INTEGRATION_NAME21);
|
|
43562
43520
|
}
|
|
43563
43521
|
}
|
|
43564
43522
|
function handleFastifyError(error2, request2, reply, handlerOrigin) {
|
|
@@ -43574,7 +43532,7 @@ function handleFastifyError(error2, request2, reply, handlerOrigin) {
|
|
|
43574
43532
|
captureException(error2, { mechanism: { handled: false, type: "auto.function.fastify" } });
|
|
43575
43533
|
}
|
|
43576
43534
|
}
|
|
43577
|
-
var instrumentFastify = generateInstrumentOnce(`${
|
|
43535
|
+
var instrumentFastify = generateInstrumentOnce(`${INTEGRATION_NAME21}.v5`, () => {
|
|
43578
43536
|
const fastifyOtelInstrumentationInstance = new FastifyOtelInstrumentation;
|
|
43579
43537
|
const plugin = fastifyOtelInstrumentationInstance.plugin();
|
|
43580
43538
|
dc.subscribe("fastify.initialization", (message) => {
|
|
@@ -43599,7 +43557,7 @@ var instrumentFastify = generateInstrumentOnce(`${INTEGRATION_NAME23}.v5`, () =>
|
|
|
43599
43557
|
var _fastifyIntegration = ({ shouldHandleError }) => {
|
|
43600
43558
|
let _shouldHandleError;
|
|
43601
43559
|
return {
|
|
43602
|
-
name:
|
|
43560
|
+
name: INTEGRATION_NAME21,
|
|
43603
43561
|
setupOnce() {
|
|
43604
43562
|
_shouldHandleError = shouldHandleError || defaultShouldHandleError;
|
|
43605
43563
|
instrumentFastifyV3();
|
|
@@ -43663,10 +43621,10 @@ function instrumentOnRequest(fastify) {
|
|
|
43663
43621
|
}
|
|
43664
43622
|
|
|
43665
43623
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/graphql.js
|
|
43666
|
-
var
|
|
43624
|
+
var import_api13 = __toESM(require_src(), 1);
|
|
43667
43625
|
var import_instrumentation_graphql = __toESM(require_src13(), 1);
|
|
43668
|
-
var
|
|
43669
|
-
var instrumentGraphql = generateInstrumentOnce(
|
|
43626
|
+
var INTEGRATION_NAME22 = "Graphql";
|
|
43627
|
+
var instrumentGraphql = generateInstrumentOnce(INTEGRATION_NAME22, import_instrumentation_graphql.GraphQLInstrumentation, (_options) => {
|
|
43670
43628
|
const options = getOptionsWithDefaults(_options);
|
|
43671
43629
|
return {
|
|
43672
43630
|
...options,
|
|
@@ -43674,7 +43632,7 @@ var instrumentGraphql = generateInstrumentOnce(INTEGRATION_NAME24, import_instru
|
|
|
43674
43632
|
addOriginToSpan2(span, "auto.graphql.otel.graphql");
|
|
43675
43633
|
const resultWithMaybeError = result;
|
|
43676
43634
|
if (resultWithMaybeError.errors?.length && !spanToJSON(span).status) {
|
|
43677
|
-
span.setStatus({ code:
|
|
43635
|
+
span.setStatus({ code: import_api13.SpanStatusCode.ERROR });
|
|
43678
43636
|
}
|
|
43679
43637
|
const attributes = spanToJSON(span).data;
|
|
43680
43638
|
const operationType = attributes["graphql.operation.type"];
|
|
@@ -43702,7 +43660,7 @@ var instrumentGraphql = generateInstrumentOnce(INTEGRATION_NAME24, import_instru
|
|
|
43702
43660
|
});
|
|
43703
43661
|
var _graphqlIntegration = (options = {}) => {
|
|
43704
43662
|
return {
|
|
43705
|
-
name:
|
|
43663
|
+
name: INTEGRATION_NAME22,
|
|
43706
43664
|
setupOnce() {
|
|
43707
43665
|
instrumentGraphql(getOptionsWithDefaults(options));
|
|
43708
43666
|
}
|
|
@@ -43731,8 +43689,8 @@ function getGraphqlOperationNamesFromAttribute2(attr) {
|
|
|
43731
43689
|
|
|
43732
43690
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/kafka.js
|
|
43733
43691
|
var import_instrumentation_kafkajs = __toESM(require_src14(), 1);
|
|
43734
|
-
var
|
|
43735
|
-
var instrumentKafka = generateInstrumentOnce(
|
|
43692
|
+
var INTEGRATION_NAME23 = "Kafka";
|
|
43693
|
+
var instrumentKafka = generateInstrumentOnce(INTEGRATION_NAME23, () => new import_instrumentation_kafkajs.KafkaJsInstrumentation({
|
|
43736
43694
|
consumerHook(span) {
|
|
43737
43695
|
addOriginToSpan2(span, "auto.kafkajs.otel.consumer");
|
|
43738
43696
|
},
|
|
@@ -43742,7 +43700,7 @@ var instrumentKafka = generateInstrumentOnce(INTEGRATION_NAME25, () => new impor
|
|
|
43742
43700
|
}));
|
|
43743
43701
|
var _kafkaIntegration = () => {
|
|
43744
43702
|
return {
|
|
43745
|
-
name:
|
|
43703
|
+
name: INTEGRATION_NAME23,
|
|
43746
43704
|
setupOnce() {
|
|
43747
43705
|
instrumentKafka();
|
|
43748
43706
|
}
|
|
@@ -43752,11 +43710,11 @@ var kafkaIntegration = defineIntegration(_kafkaIntegration);
|
|
|
43752
43710
|
|
|
43753
43711
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/lrumemoizer.js
|
|
43754
43712
|
var import_instrumentation_lru_memoizer = __toESM(require_src15(), 1);
|
|
43755
|
-
var
|
|
43756
|
-
var instrumentLruMemoizer = generateInstrumentOnce(
|
|
43713
|
+
var INTEGRATION_NAME24 = "LruMemoizer";
|
|
43714
|
+
var instrumentLruMemoizer = generateInstrumentOnce(INTEGRATION_NAME24, () => new import_instrumentation_lru_memoizer.LruMemoizerInstrumentation);
|
|
43757
43715
|
var _lruMemoizerIntegration = () => {
|
|
43758
43716
|
return {
|
|
43759
|
-
name:
|
|
43717
|
+
name: INTEGRATION_NAME24,
|
|
43760
43718
|
setupOnce() {
|
|
43761
43719
|
instrumentLruMemoizer();
|
|
43762
43720
|
}
|
|
@@ -43766,8 +43724,8 @@ var lruMemoizerIntegration = defineIntegration(_lruMemoizerIntegration);
|
|
|
43766
43724
|
|
|
43767
43725
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/mongo.js
|
|
43768
43726
|
var import_instrumentation_mongodb = __toESM(require_src16(), 1);
|
|
43769
|
-
var
|
|
43770
|
-
var instrumentMongo = generateInstrumentOnce(
|
|
43727
|
+
var INTEGRATION_NAME25 = "Mongo";
|
|
43728
|
+
var instrumentMongo = generateInstrumentOnce(INTEGRATION_NAME25, () => new import_instrumentation_mongodb.MongoDBInstrumentation({
|
|
43771
43729
|
dbStatementSerializer: _defaultDbStatementSerializer,
|
|
43772
43730
|
responseHook(span) {
|
|
43773
43731
|
addOriginToSpan2(span, "auto.db.otel.mongo");
|
|
@@ -43807,7 +43765,7 @@ function isCommandEntry(value) {
|
|
|
43807
43765
|
}
|
|
43808
43766
|
var _mongoIntegration = () => {
|
|
43809
43767
|
return {
|
|
43810
|
-
name:
|
|
43768
|
+
name: INTEGRATION_NAME25,
|
|
43811
43769
|
setupOnce() {
|
|
43812
43770
|
instrumentMongo();
|
|
43813
43771
|
}
|
|
@@ -43817,15 +43775,15 @@ var mongoIntegration = defineIntegration(_mongoIntegration);
|
|
|
43817
43775
|
|
|
43818
43776
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/mongoose.js
|
|
43819
43777
|
var import_instrumentation_mongoose = __toESM(require_src17(), 1);
|
|
43820
|
-
var
|
|
43821
|
-
var instrumentMongoose = generateInstrumentOnce(
|
|
43778
|
+
var INTEGRATION_NAME26 = "Mongoose";
|
|
43779
|
+
var instrumentMongoose = generateInstrumentOnce(INTEGRATION_NAME26, () => new import_instrumentation_mongoose.MongooseInstrumentation({
|
|
43822
43780
|
responseHook(span) {
|
|
43823
43781
|
addOriginToSpan2(span, "auto.db.otel.mongoose");
|
|
43824
43782
|
}
|
|
43825
43783
|
}));
|
|
43826
43784
|
var _mongooseIntegration = () => {
|
|
43827
43785
|
return {
|
|
43828
|
-
name:
|
|
43786
|
+
name: INTEGRATION_NAME26,
|
|
43829
43787
|
setupOnce() {
|
|
43830
43788
|
instrumentMongoose();
|
|
43831
43789
|
}
|
|
@@ -43835,11 +43793,11 @@ var mongooseIntegration = defineIntegration(_mongooseIntegration);
|
|
|
43835
43793
|
|
|
43836
43794
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/mysql.js
|
|
43837
43795
|
var import_instrumentation_mysql = __toESM(require_src18(), 1);
|
|
43838
|
-
var
|
|
43839
|
-
var instrumentMysql = generateInstrumentOnce(
|
|
43796
|
+
var INTEGRATION_NAME27 = "Mysql";
|
|
43797
|
+
var instrumentMysql = generateInstrumentOnce(INTEGRATION_NAME27, () => new import_instrumentation_mysql.MySQLInstrumentation({}));
|
|
43840
43798
|
var _mysqlIntegration = () => {
|
|
43841
43799
|
return {
|
|
43842
|
-
name:
|
|
43800
|
+
name: INTEGRATION_NAME27,
|
|
43843
43801
|
setupOnce() {
|
|
43844
43802
|
instrumentMysql();
|
|
43845
43803
|
}
|
|
@@ -43849,15 +43807,15 @@ var mysqlIntegration = defineIntegration(_mysqlIntegration);
|
|
|
43849
43807
|
|
|
43850
43808
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/mysql2.js
|
|
43851
43809
|
var import_instrumentation_mysql2 = __toESM(require_src20(), 1);
|
|
43852
|
-
var
|
|
43853
|
-
var instrumentMysql2 = generateInstrumentOnce(
|
|
43810
|
+
var INTEGRATION_NAME28 = "Mysql2";
|
|
43811
|
+
var instrumentMysql2 = generateInstrumentOnce(INTEGRATION_NAME28, () => new import_instrumentation_mysql2.MySQL2Instrumentation({
|
|
43854
43812
|
responseHook(span) {
|
|
43855
43813
|
addOriginToSpan2(span, "auto.db.otel.mysql2");
|
|
43856
43814
|
}
|
|
43857
43815
|
}));
|
|
43858
43816
|
var _mysql2Integration = () => {
|
|
43859
43817
|
return {
|
|
43860
|
-
name:
|
|
43818
|
+
name: INTEGRATION_NAME28,
|
|
43861
43819
|
setupOnce() {
|
|
43862
43820
|
instrumentMysql2();
|
|
43863
43821
|
}
|
|
@@ -43959,7 +43917,7 @@ function flatten(input) {
|
|
|
43959
43917
|
}
|
|
43960
43918
|
|
|
43961
43919
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/redis.js
|
|
43962
|
-
var
|
|
43920
|
+
var INTEGRATION_NAME29 = "Redis";
|
|
43963
43921
|
var _redisOptions = {};
|
|
43964
43922
|
var cacheResponseHook = (span, redisCommand, cmdArgs, response) => {
|
|
43965
43923
|
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, "auto.db.otel.redis");
|
|
@@ -43987,12 +43945,12 @@ var cacheResponseHook = (span, redisCommand, cmdArgs, response) => {
|
|
|
43987
43945
|
const spanDescription = safeKey.join(", ");
|
|
43988
43946
|
span.updateName(truncate(spanDescription, 1024));
|
|
43989
43947
|
};
|
|
43990
|
-
var instrumentIORedis = generateInstrumentOnce(`${
|
|
43948
|
+
var instrumentIORedis = generateInstrumentOnce(`${INTEGRATION_NAME29}.IORedis`, () => {
|
|
43991
43949
|
return new import_instrumentation_ioredis.IORedisInstrumentation({
|
|
43992
43950
|
responseHook: cacheResponseHook
|
|
43993
43951
|
});
|
|
43994
43952
|
});
|
|
43995
|
-
var instrumentRedisModule = generateInstrumentOnce(`${
|
|
43953
|
+
var instrumentRedisModule = generateInstrumentOnce(`${INTEGRATION_NAME29}.Redis`, () => {
|
|
43996
43954
|
return new import_instrumentation_redis.RedisInstrumentation({
|
|
43997
43955
|
responseHook: cacheResponseHook
|
|
43998
43956
|
});
|
|
@@ -44000,10 +43958,10 @@ var instrumentRedisModule = generateInstrumentOnce(`${INTEGRATION_NAME31}.Redis`
|
|
|
44000
43958
|
var instrumentRedis = Object.assign(() => {
|
|
44001
43959
|
instrumentIORedis();
|
|
44002
43960
|
instrumentRedisModule();
|
|
44003
|
-
}, { id:
|
|
43961
|
+
}, { id: INTEGRATION_NAME29 });
|
|
44004
43962
|
var _redisIntegration = (options = {}) => {
|
|
44005
43963
|
return {
|
|
44006
|
-
name:
|
|
43964
|
+
name: INTEGRATION_NAME29,
|
|
44007
43965
|
setupOnce() {
|
|
44008
43966
|
_redisOptions = options;
|
|
44009
43967
|
instrumentRedis();
|
|
@@ -44014,8 +43972,8 @@ var redisIntegration = defineIntegration(_redisIntegration);
|
|
|
44014
43972
|
|
|
44015
43973
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/postgres.js
|
|
44016
43974
|
var import_instrumentation_pg = __toESM(require_src24(), 1);
|
|
44017
|
-
var
|
|
44018
|
-
var instrumentPostgres = generateInstrumentOnce(
|
|
43975
|
+
var INTEGRATION_NAME30 = "Postgres";
|
|
43976
|
+
var instrumentPostgres = generateInstrumentOnce(INTEGRATION_NAME30, () => new import_instrumentation_pg.PgInstrumentation({
|
|
44019
43977
|
requireParentSpan: true,
|
|
44020
43978
|
requestHook(span) {
|
|
44021
43979
|
addOriginToSpan2(span, "auto.db.otel.postgres");
|
|
@@ -44023,7 +43981,7 @@ var instrumentPostgres = generateInstrumentOnce(INTEGRATION_NAME32, () => new im
|
|
|
44023
43981
|
}));
|
|
44024
43982
|
var _postgresIntegration = () => {
|
|
44025
43983
|
return {
|
|
44026
|
-
name:
|
|
43984
|
+
name: INTEGRATION_NAME30,
|
|
44027
43985
|
setupOnce() {
|
|
44028
43986
|
instrumentPostgres();
|
|
44029
43987
|
}
|
|
@@ -44032,12 +43990,12 @@ var _postgresIntegration = () => {
|
|
|
44032
43990
|
var postgresIntegration = defineIntegration(_postgresIntegration);
|
|
44033
43991
|
|
|
44034
43992
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/postgresjs.js
|
|
44035
|
-
var
|
|
43993
|
+
var import_api14 = __toESM(require_src(), 1);
|
|
44036
43994
|
var import_instrumentation8 = __toESM(require_src6(), 1);
|
|
44037
43995
|
var import_semantic_conventions5 = __toESM(require_src2(), 1);
|
|
44038
|
-
var
|
|
43996
|
+
var INTEGRATION_NAME31 = "PostgresJs";
|
|
44039
43997
|
var SUPPORTED_VERSIONS2 = [">=3.0.0 <4"];
|
|
44040
|
-
var instrumentPostgresJs = generateInstrumentOnce(
|
|
43998
|
+
var instrumentPostgresJs = generateInstrumentOnce(INTEGRATION_NAME31, (options) => new PostgresJsInstrumentation({
|
|
44041
43999
|
requireParentSpan: options?.requireParentSpan ?? true,
|
|
44042
44000
|
requestHook: options?.requestHook
|
|
44043
44001
|
}));
|
|
@@ -44056,7 +44014,7 @@ class PostgresJsInstrumentation extends import_instrumentation8.InstrumentationB
|
|
|
44056
44014
|
}
|
|
44057
44015
|
_shouldCreateSpans() {
|
|
44058
44016
|
const config = this.getConfig();
|
|
44059
|
-
const hasParentSpan =
|
|
44017
|
+
const hasParentSpan = import_api14.trace.getSpan(import_api14.context.active()) !== undefined;
|
|
44060
44018
|
return hasParentSpan || !config.requireParentSpan;
|
|
44061
44019
|
}
|
|
44062
44020
|
_patchReject(rejectTarget, span) {
|
|
@@ -44105,7 +44063,7 @@ class PostgresJsInstrumentation extends import_instrumentation8.InstrumentationB
|
|
|
44105
44063
|
if (requestHook2) {
|
|
44106
44064
|
import_instrumentation8.safeExecuteInTheMiddle(() => requestHook2(span, sanitizedSqlQuery, postgresConnectionContext), (error2) => {
|
|
44107
44065
|
if (error2) {
|
|
44108
|
-
debug.error(`Error in requestHook for ${
|
|
44066
|
+
debug.error(`Error in requestHook for ${INTEGRATION_NAME31} integration:`, error2);
|
|
44109
44067
|
}
|
|
44110
44068
|
});
|
|
44111
44069
|
}
|
|
@@ -44158,7 +44116,7 @@ class PostgresJsInstrumentation extends import_instrumentation8.InstrumentationB
|
|
|
44158
44116
|
}
|
|
44159
44117
|
var _postgresJsIntegration = () => {
|
|
44160
44118
|
return {
|
|
44161
|
-
name:
|
|
44119
|
+
name: INTEGRATION_NAME31,
|
|
44162
44120
|
setupOnce() {
|
|
44163
44121
|
instrumentPostgresJs();
|
|
44164
44122
|
}
|
|
@@ -44167,21 +44125,21 @@ var _postgresJsIntegration = () => {
|
|
|
44167
44125
|
var postgresJsIntegration = defineIntegration(_postgresJsIntegration);
|
|
44168
44126
|
|
|
44169
44127
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/prisma.js
|
|
44170
|
-
var
|
|
44128
|
+
var import_api17 = __toESM(require_src(), 1);
|
|
44171
44129
|
|
|
44172
44130
|
// ../../node_modules/@prisma/instrumentation/dist/index.mjs
|
|
44173
|
-
var
|
|
44131
|
+
var import_api15 = __toESM(require_src(), 1);
|
|
44174
44132
|
var import_instrumentation9 = __toESM(require_src26(), 1);
|
|
44175
|
-
var
|
|
44133
|
+
var import_api16 = __toESM(require_src(), 1);
|
|
44176
44134
|
var showAllTraces = process.env.PRISMA_SHOW_ALL_TRACES === "true";
|
|
44177
44135
|
var nonSampledTraceParent = `00-10-10-00`;
|
|
44178
44136
|
function engineSpanKindToOtelSpanKind(engineSpanKind) {
|
|
44179
44137
|
switch (engineSpanKind) {
|
|
44180
44138
|
case "client":
|
|
44181
|
-
return
|
|
44139
|
+
return import_api16.SpanKind.CLIENT;
|
|
44182
44140
|
case "internal":
|
|
44183
44141
|
default:
|
|
44184
|
-
return
|
|
44142
|
+
return import_api16.SpanKind.INTERNAL;
|
|
44185
44143
|
}
|
|
44186
44144
|
}
|
|
44187
44145
|
var ActiveTracingHelper = class {
|
|
@@ -44194,8 +44152,8 @@ var ActiveTracingHelper = class {
|
|
|
44194
44152
|
isEnabled() {
|
|
44195
44153
|
return true;
|
|
44196
44154
|
}
|
|
44197
|
-
getTraceParent(
|
|
44198
|
-
const span =
|
|
44155
|
+
getTraceParent(context9) {
|
|
44156
|
+
const span = import_api16.trace.getSpanContext(context9 ?? import_api16.context.active());
|
|
44199
44157
|
if (span) {
|
|
44200
44158
|
return `00-${span.traceId}-${span.spanId}-0${span.traceFlags}`;
|
|
44201
44159
|
}
|
|
@@ -44210,7 +44168,7 @@ var ActiveTracingHelper = class {
|
|
|
44210
44168
|
}
|
|
44211
44169
|
}
|
|
44212
44170
|
getActiveContext() {
|
|
44213
|
-
return
|
|
44171
|
+
return import_api16.context.active();
|
|
44214
44172
|
}
|
|
44215
44173
|
runInChildSpan(options, callback) {
|
|
44216
44174
|
if (typeof options === "string") {
|
|
@@ -44220,16 +44178,16 @@ var ActiveTracingHelper = class {
|
|
|
44220
44178
|
return callback();
|
|
44221
44179
|
}
|
|
44222
44180
|
const tracer = this.tracerProvider.getTracer("prisma");
|
|
44223
|
-
const
|
|
44181
|
+
const context9 = options.context ?? this.getActiveContext();
|
|
44224
44182
|
const name = `prisma:client:${options.name}`;
|
|
44225
44183
|
if (shouldIgnoreSpan2(name, this.ignoreSpanTypes)) {
|
|
44226
44184
|
return callback();
|
|
44227
44185
|
}
|
|
44228
44186
|
if (options.active === false) {
|
|
44229
|
-
const span = tracer.startSpan(name, options,
|
|
44230
|
-
return endSpan2(span, callback(span,
|
|
44187
|
+
const span = tracer.startSpan(name, options, context9);
|
|
44188
|
+
return endSpan2(span, callback(span, context9));
|
|
44231
44189
|
}
|
|
44232
|
-
return tracer.startActiveSpan(name, options, (span) => endSpan2(span, callback(span,
|
|
44190
|
+
return tracer.startActiveSpan(name, options, (span) => endSpan2(span, callback(span, context9)));
|
|
44233
44191
|
}
|
|
44234
44192
|
};
|
|
44235
44193
|
function dispatchEngineSpan(tracer, engineSpan, allSpans, linkIds, ignoreSpanTypes) {
|
|
@@ -44365,7 +44323,7 @@ var PrismaInstrumentation = class extends import_instrumentation9.Instrumentatio
|
|
|
44365
44323
|
const config = this._config;
|
|
44366
44324
|
const globalValue = {
|
|
44367
44325
|
helper: new ActiveTracingHelper({
|
|
44368
|
-
tracerProvider: this.tracerProvider ??
|
|
44326
|
+
tracerProvider: this.tracerProvider ?? import_api15.trace.getTracerProvider(),
|
|
44369
44327
|
ignoreSpanTypes: config.ignoreSpanTypes ?? []
|
|
44370
44328
|
})
|
|
44371
44329
|
};
|
|
@@ -44382,7 +44340,7 @@ var PrismaInstrumentation = class extends import_instrumentation9.Instrumentatio
|
|
|
44382
44340
|
};
|
|
44383
44341
|
|
|
44384
44342
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/prisma.js
|
|
44385
|
-
var
|
|
44343
|
+
var INTEGRATION_NAME32 = "Prisma";
|
|
44386
44344
|
function isPrismaV6TracingHelper(helper) {
|
|
44387
44345
|
return !!helper && typeof helper === "object" && "dispatchEngineSpans" in helper;
|
|
44388
44346
|
}
|
|
@@ -44401,7 +44359,7 @@ class SentryPrismaInteropInstrumentation extends PrismaInstrumentation {
|
|
|
44401
44359
|
const prismaTracingHelper = getPrismaTracingHelper();
|
|
44402
44360
|
if (isPrismaV6TracingHelper(prismaTracingHelper)) {
|
|
44403
44361
|
prismaTracingHelper.createEngineSpan = (engineSpanEvent) => {
|
|
44404
|
-
const tracer =
|
|
44362
|
+
const tracer = import_api17.trace.getTracer("prismaV5Compatibility");
|
|
44405
44363
|
const initialIdGenerator = tracer._idGenerator;
|
|
44406
44364
|
if (!initialIdGenerator) {
|
|
44407
44365
|
consoleSandbox(() => {
|
|
@@ -44420,16 +44378,16 @@ class SentryPrismaInteropInstrumentation extends PrismaInstrumentation {
|
|
|
44420
44378
|
context: {
|
|
44421
44379
|
traceId: link.trace_id,
|
|
44422
44380
|
spanId: link.span_id,
|
|
44423
|
-
traceFlags:
|
|
44381
|
+
traceFlags: import_api17.TraceFlags.SAMPLED
|
|
44424
44382
|
}
|
|
44425
44383
|
};
|
|
44426
44384
|
});
|
|
44427
|
-
const ctx =
|
|
44385
|
+
const ctx = import_api17.trace.setSpanContext(import_api17.context.active(), {
|
|
44428
44386
|
traceId,
|
|
44429
44387
|
spanId: parentSpanId,
|
|
44430
|
-
traceFlags:
|
|
44388
|
+
traceFlags: import_api17.TraceFlags.SAMPLED
|
|
44431
44389
|
});
|
|
44432
|
-
|
|
44390
|
+
import_api17.context.with(ctx, () => {
|
|
44433
44391
|
const temporaryIdGenerator = {
|
|
44434
44392
|
generateTraceId: () => {
|
|
44435
44393
|
return traceId;
|
|
@@ -44459,18 +44417,18 @@ class SentryPrismaInteropInstrumentation extends PrismaInstrumentation {
|
|
|
44459
44417
|
function engineSpanKindToOTELSpanKind(engineSpanKind) {
|
|
44460
44418
|
switch (engineSpanKind) {
|
|
44461
44419
|
case "client":
|
|
44462
|
-
return
|
|
44420
|
+
return import_api17.SpanKind.CLIENT;
|
|
44463
44421
|
case "internal":
|
|
44464
44422
|
default:
|
|
44465
|
-
return
|
|
44423
|
+
return import_api17.SpanKind.INTERNAL;
|
|
44466
44424
|
}
|
|
44467
44425
|
}
|
|
44468
|
-
var instrumentPrisma = generateInstrumentOnce(
|
|
44426
|
+
var instrumentPrisma = generateInstrumentOnce(INTEGRATION_NAME32, (_options) => {
|
|
44469
44427
|
return new SentryPrismaInteropInstrumentation;
|
|
44470
44428
|
});
|
|
44471
44429
|
var prismaIntegration = defineIntegration((_options) => {
|
|
44472
44430
|
return {
|
|
44473
|
-
name:
|
|
44431
|
+
name: INTEGRATION_NAME32,
|
|
44474
44432
|
setupOnce() {
|
|
44475
44433
|
instrumentPrisma();
|
|
44476
44434
|
},
|
|
@@ -44496,11 +44454,11 @@ var prismaIntegration = defineIntegration((_options) => {
|
|
|
44496
44454
|
|
|
44497
44455
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/hapi/index.js
|
|
44498
44456
|
var import_instrumentation_hapi = __toESM(require_src27(), 1);
|
|
44499
|
-
var
|
|
44500
|
-
var instrumentHapi = generateInstrumentOnce(
|
|
44457
|
+
var INTEGRATION_NAME33 = "Hapi";
|
|
44458
|
+
var instrumentHapi = generateInstrumentOnce(INTEGRATION_NAME33, () => new import_instrumentation_hapi.HapiInstrumentation);
|
|
44501
44459
|
var _hapiIntegration = () => {
|
|
44502
44460
|
return {
|
|
44503
|
-
name:
|
|
44461
|
+
name: INTEGRATION_NAME33,
|
|
44504
44462
|
setupOnce() {
|
|
44505
44463
|
instrumentHapi();
|
|
44506
44464
|
}
|
|
@@ -44522,7 +44480,7 @@ var HonoTypes = {
|
|
|
44522
44480
|
};
|
|
44523
44481
|
|
|
44524
44482
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/hono/instrumentation.js
|
|
44525
|
-
var
|
|
44483
|
+
var import_api18 = __toESM(require_src(), 1);
|
|
44526
44484
|
var import_instrumentation11 = __toESM(require_src6(), 1);
|
|
44527
44485
|
var PACKAGE_NAME3 = "@sentry/instrumentation-hono";
|
|
44528
44486
|
var PACKAGE_VERSION3 = "0.0.1";
|
|
@@ -44618,7 +44576,7 @@ class HonoInstrumentation extends import_instrumentation11.InstrumentationBase {
|
|
|
44618
44576
|
}
|
|
44619
44577
|
const path8 = c.req.path;
|
|
44620
44578
|
const span = instrumentation.tracer.startSpan(path8);
|
|
44621
|
-
return
|
|
44579
|
+
return import_api18.context.with(import_api18.trace.setSpan(import_api18.context.active(), span), () => {
|
|
44622
44580
|
return instrumentation._safeExecute(() => {
|
|
44623
44581
|
const result = handler.apply(this, [c, next]);
|
|
44624
44582
|
if (isThenable(result)) {
|
|
@@ -44667,7 +44625,7 @@ class HonoInstrumentation extends import_instrumentation11.InstrumentationBase {
|
|
|
44667
44625
|
_handleError(span, error2) {
|
|
44668
44626
|
if (error2 instanceof Error) {
|
|
44669
44627
|
span.setStatus({
|
|
44670
|
-
code:
|
|
44628
|
+
code: import_api18.SpanStatusCode.ERROR,
|
|
44671
44629
|
message: error2.message
|
|
44672
44630
|
});
|
|
44673
44631
|
span.recordException(error2);
|
|
@@ -44676,7 +44634,7 @@ class HonoInstrumentation extends import_instrumentation11.InstrumentationBase {
|
|
|
44676
44634
|
}
|
|
44677
44635
|
|
|
44678
44636
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/hono/index.js
|
|
44679
|
-
var
|
|
44637
|
+
var INTEGRATION_NAME34 = "Hono";
|
|
44680
44638
|
function addHonoSpanAttributes(span) {
|
|
44681
44639
|
const attributes = spanToJSON(span).data;
|
|
44682
44640
|
const type = attributes[AttributeNames2.HONO_TYPE];
|
|
@@ -44701,14 +44659,14 @@ function addHonoSpanAttributes(span) {
|
|
|
44701
44659
|
getIsolationScope().setTransactionName(`${method} ${route}`);
|
|
44702
44660
|
}
|
|
44703
44661
|
}
|
|
44704
|
-
var instrumentHono = generateInstrumentOnce(
|
|
44662
|
+
var instrumentHono = generateInstrumentOnce(INTEGRATION_NAME34, () => new HonoInstrumentation({
|
|
44705
44663
|
responseHook: (span) => {
|
|
44706
44664
|
addHonoSpanAttributes(span);
|
|
44707
44665
|
}
|
|
44708
44666
|
}));
|
|
44709
44667
|
var _honoIntegration = () => {
|
|
44710
44668
|
return {
|
|
44711
|
-
name:
|
|
44669
|
+
name: INTEGRATION_NAME34,
|
|
44712
44670
|
setupOnce() {
|
|
44713
44671
|
instrumentHono();
|
|
44714
44672
|
}
|
|
@@ -44719,8 +44677,8 @@ var honoIntegration = defineIntegration(_honoIntegration);
|
|
|
44719
44677
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/koa.js
|
|
44720
44678
|
var import_instrumentation_koa = __toESM(require_src28(), 1);
|
|
44721
44679
|
var import_semantic_conventions7 = __toESM(require_src2(), 1);
|
|
44722
|
-
var
|
|
44723
|
-
var instrumentKoa = generateInstrumentOnce(
|
|
44680
|
+
var INTEGRATION_NAME35 = "Koa";
|
|
44681
|
+
var instrumentKoa = generateInstrumentOnce(INTEGRATION_NAME35, import_instrumentation_koa.KoaInstrumentation, (options = {}) => {
|
|
44724
44682
|
return {
|
|
44725
44683
|
ignoreLayersType: options.ignoreLayersType,
|
|
44726
44684
|
requestHook(span, info) {
|
|
@@ -44748,7 +44706,7 @@ var instrumentKoa = generateInstrumentOnce(INTEGRATION_NAME37, import_instrument
|
|
|
44748
44706
|
});
|
|
44749
44707
|
var _koaIntegration = (options = {}) => {
|
|
44750
44708
|
return {
|
|
44751
|
-
name:
|
|
44709
|
+
name: INTEGRATION_NAME35,
|
|
44752
44710
|
setupOnce() {
|
|
44753
44711
|
instrumentKoa(options);
|
|
44754
44712
|
}
|
|
@@ -44758,11 +44716,11 @@ var koaIntegration = defineIntegration(_koaIntegration);
|
|
|
44758
44716
|
|
|
44759
44717
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/connect.js
|
|
44760
44718
|
var import_instrumentation_connect = __toESM(require_src29(), 1);
|
|
44761
|
-
var
|
|
44762
|
-
var instrumentConnect = generateInstrumentOnce(
|
|
44719
|
+
var INTEGRATION_NAME36 = "Connect";
|
|
44720
|
+
var instrumentConnect = generateInstrumentOnce(INTEGRATION_NAME36, () => new import_instrumentation_connect.ConnectInstrumentation);
|
|
44763
44721
|
var _connectIntegration = () => {
|
|
44764
44722
|
return {
|
|
44765
|
-
name:
|
|
44723
|
+
name: INTEGRATION_NAME36,
|
|
44766
44724
|
setupOnce() {
|
|
44767
44725
|
instrumentConnect();
|
|
44768
44726
|
}
|
|
@@ -44780,12 +44738,12 @@ var TEDIUS_INSTRUMENTED_METHODS = new Set([
|
|
|
44780
44738
|
"prepare",
|
|
44781
44739
|
"execute"
|
|
44782
44740
|
]);
|
|
44783
|
-
var
|
|
44784
|
-
var instrumentTedious = generateInstrumentOnce(
|
|
44741
|
+
var INTEGRATION_NAME37 = "Tedious";
|
|
44742
|
+
var instrumentTedious = generateInstrumentOnce(INTEGRATION_NAME37, () => new import_instrumentation_tedious.TediousInstrumentation({}));
|
|
44785
44743
|
var _tediousIntegration = () => {
|
|
44786
44744
|
let instrumentationWrappedCallback;
|
|
44787
44745
|
return {
|
|
44788
|
-
name:
|
|
44746
|
+
name: INTEGRATION_NAME37,
|
|
44789
44747
|
setupOnce() {
|
|
44790
44748
|
const instrumentation = instrumentTedious();
|
|
44791
44749
|
instrumentationWrappedCallback = instrumentWhenWrapped(instrumentation);
|
|
@@ -44808,12 +44766,12 @@ var tediousIntegration = defineIntegration(_tediousIntegration);
|
|
|
44808
44766
|
|
|
44809
44767
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/genericPool.js
|
|
44810
44768
|
var import_instrumentation_generic_pool = __toESM(require_src31(), 1);
|
|
44811
|
-
var
|
|
44812
|
-
var instrumentGenericPool = generateInstrumentOnce(
|
|
44769
|
+
var INTEGRATION_NAME38 = "GenericPool";
|
|
44770
|
+
var instrumentGenericPool = generateInstrumentOnce(INTEGRATION_NAME38, () => new import_instrumentation_generic_pool.GenericPoolInstrumentation({}));
|
|
44813
44771
|
var _genericPoolIntegration = () => {
|
|
44814
44772
|
let instrumentationWrappedCallback;
|
|
44815
44773
|
return {
|
|
44816
|
-
name:
|
|
44774
|
+
name: INTEGRATION_NAME38,
|
|
44817
44775
|
setupOnce() {
|
|
44818
44776
|
const instrumentation = instrumentGenericPool();
|
|
44819
44777
|
instrumentationWrappedCallback = instrumentWhenWrapped(instrumentation);
|
|
@@ -44834,7 +44792,7 @@ var genericPoolIntegration = defineIntegration(_genericPoolIntegration);
|
|
|
44834
44792
|
|
|
44835
44793
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/amqplib.js
|
|
44836
44794
|
var import_instrumentation_amqplib = __toESM(require_src32(), 1);
|
|
44837
|
-
var
|
|
44795
|
+
var INTEGRATION_NAME39 = "Amqplib";
|
|
44838
44796
|
var config = {
|
|
44839
44797
|
consumeEndHook: (span) => {
|
|
44840
44798
|
addOriginToSpan2(span, "auto.amqplib.otel.consumer");
|
|
@@ -44843,10 +44801,10 @@ var config = {
|
|
|
44843
44801
|
addOriginToSpan2(span, "auto.amqplib.otel.publisher");
|
|
44844
44802
|
}
|
|
44845
44803
|
};
|
|
44846
|
-
var instrumentAmqplib = generateInstrumentOnce(
|
|
44804
|
+
var instrumentAmqplib = generateInstrumentOnce(INTEGRATION_NAME39, () => new import_instrumentation_amqplib.AmqplibInstrumentation(config));
|
|
44847
44805
|
var _amqplibIntegration = () => {
|
|
44848
44806
|
return {
|
|
44849
|
-
name:
|
|
44807
|
+
name: INTEGRATION_NAME39,
|
|
44850
44808
|
setupOnce() {
|
|
44851
44809
|
instrumentAmqplib();
|
|
44852
44810
|
}
|
|
@@ -44855,7 +44813,7 @@ var _amqplibIntegration = () => {
|
|
|
44855
44813
|
var amqplibIntegration = defineIntegration(_amqplibIntegration);
|
|
44856
44814
|
|
|
44857
44815
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/vercelai/constants.js
|
|
44858
|
-
var
|
|
44816
|
+
var INTEGRATION_NAME40 = "VercelAI";
|
|
44859
44817
|
|
|
44860
44818
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/vercelai/instrumentation.js
|
|
44861
44819
|
var import_instrumentation13 = __toESM(require_src6(), 1);
|
|
@@ -44958,7 +44916,7 @@ class SentryVercelAiInstrumentation extends import_instrumentation13.Instrumenta
|
|
|
44958
44916
|
const existingExperimentalTelemetry = args[0].experimental_telemetry || {};
|
|
44959
44917
|
const isEnabled3 = existingExperimentalTelemetry.isEnabled;
|
|
44960
44918
|
const client = getClient();
|
|
44961
|
-
const integration = client?.getIntegrationByName(
|
|
44919
|
+
const integration = client?.getIntegrationByName(INTEGRATION_NAME40);
|
|
44962
44920
|
const integrationOptions = integration?.options;
|
|
44963
44921
|
const shouldRecordInputsAndOutputs = integration ? Boolean(client?.getOptions().sendDefaultPii) : false;
|
|
44964
44922
|
const { recordInputs, recordOutputs } = determineRecordingSettings(integrationOptions, existingExperimentalTelemetry, isEnabled3, shouldRecordInputsAndOutputs);
|
|
@@ -44994,7 +44952,7 @@ class SentryVercelAiInstrumentation extends import_instrumentation13.Instrumenta
|
|
|
44994
44952
|
}
|
|
44995
44953
|
|
|
44996
44954
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/vercelai/index.js
|
|
44997
|
-
var instrumentVercelAi = generateInstrumentOnce(
|
|
44955
|
+
var instrumentVercelAi = generateInstrumentOnce(INTEGRATION_NAME40, () => new SentryVercelAiInstrumentation({}));
|
|
44998
44956
|
function shouldForceIntegration(client) {
|
|
44999
44957
|
const modules = client.getIntegrationByName("Modules");
|
|
45000
44958
|
return !!modules?.getModules?.()?.ai;
|
|
@@ -45002,7 +44960,7 @@ function shouldForceIntegration(client) {
|
|
|
45002
44960
|
var _vercelAIIntegration = (options = {}) => {
|
|
45003
44961
|
let instrumentation;
|
|
45004
44962
|
return {
|
|
45005
|
-
name:
|
|
44963
|
+
name: INTEGRATION_NAME40,
|
|
45006
44964
|
options,
|
|
45007
44965
|
setupOnce() {
|
|
45008
44966
|
instrumentation = instrumentVercelAi();
|
|
@@ -45236,7 +45194,7 @@ var googleGenAIIntegration = defineIntegration(_googleGenAIIntegration);
|
|
|
45236
45194
|
var import_instrumentation22 = __toESM(require_src6(), 1);
|
|
45237
45195
|
|
|
45238
45196
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/firebase/otel/patches/firestore.js
|
|
45239
|
-
var
|
|
45197
|
+
var import_api19 = __toESM(require_src(), 1);
|
|
45240
45198
|
var import_instrumentation21 = __toESM(require_src6(), 1);
|
|
45241
45199
|
var import_semantic_conventions8 = __toESM(require_src2(), 1);
|
|
45242
45200
|
import * as net2 from "node:net";
|
|
@@ -45250,7 +45208,7 @@ function patchFirestore(tracer, firestoreSupportedVersions, wrap, unwrap, config
|
|
|
45250
45208
|
if (!error2) {
|
|
45251
45209
|
return;
|
|
45252
45210
|
}
|
|
45253
|
-
|
|
45211
|
+
import_api19.diag.error(error2?.message);
|
|
45254
45212
|
}, true);
|
|
45255
45213
|
};
|
|
45256
45214
|
}
|
|
@@ -45327,7 +45285,7 @@ function patchSetDoc(tracer, firestoreSpanCreationHook) {
|
|
|
45327
45285
|
};
|
|
45328
45286
|
}
|
|
45329
45287
|
function executeContextWithSpan(span, callback) {
|
|
45330
|
-
return
|
|
45288
|
+
return import_api19.context.with(import_api19.trace.setSpan(import_api19.context.active(), span), () => {
|
|
45331
45289
|
return import_instrumentation21.safeExecuteInTheMiddle(() => {
|
|
45332
45290
|
return callback();
|
|
45333
45291
|
}, (err) => {
|
|
@@ -45339,7 +45297,7 @@ function executeContextWithSpan(span, callback) {
|
|
|
45339
45297
|
});
|
|
45340
45298
|
}
|
|
45341
45299
|
function startDBSpan(tracer, spanName, reference) {
|
|
45342
|
-
const span = tracer.startSpan(`${spanName} ${reference.path}`, { kind:
|
|
45300
|
+
const span = tracer.startSpan(`${spanName} ${reference.path}`, { kind: import_api19.SpanKind.CLIENT });
|
|
45343
45301
|
addAttributes(span, reference);
|
|
45344
45302
|
span.setAttribute(import_semantic_conventions8.ATTR_DB_OPERATION_NAME, spanName);
|
|
45345
45303
|
return span;
|
|
@@ -45421,17 +45379,17 @@ class FirebaseInstrumentation extends import_instrumentation22.InstrumentationBa
|
|
|
45421
45379
|
}
|
|
45422
45380
|
|
|
45423
45381
|
// ../../node_modules/@sentry/node/build/esm/integrations/tracing/firebase/firebase.js
|
|
45424
|
-
var
|
|
45382
|
+
var INTEGRATION_NAME41 = "Firebase";
|
|
45425
45383
|
var config2 = {
|
|
45426
45384
|
firestoreSpanCreationHook: (span) => {
|
|
45427
45385
|
addOriginToSpan2(span, "auto.firebase.otel.firestore");
|
|
45428
45386
|
span.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_OP, "db.query");
|
|
45429
45387
|
}
|
|
45430
45388
|
};
|
|
45431
|
-
var instrumentFirebase = generateInstrumentOnce(
|
|
45389
|
+
var instrumentFirebase = generateInstrumentOnce(INTEGRATION_NAME41, () => new FirebaseInstrumentation(config2));
|
|
45432
45390
|
var _firebaseIntegration = () => {
|
|
45433
45391
|
return {
|
|
45434
|
-
name:
|
|
45392
|
+
name: INTEGRATION_NAME41,
|
|
45435
45393
|
setupOnce() {
|
|
45436
45394
|
instrumentFirebase();
|
|
45437
45395
|
}
|
|
@@ -45471,7 +45429,7 @@ function getAutoPerformanceIntegrations() {
|
|
|
45471
45429
|
}
|
|
45472
45430
|
|
|
45473
45431
|
// ../../node_modules/@sentry/node/build/esm/sdk/initOtel.js
|
|
45474
|
-
var
|
|
45432
|
+
var import_api20 = __toESM(require_src(), 1);
|
|
45475
45433
|
var import_resources = __toESM(require_src8(), 1);
|
|
45476
45434
|
var import_sdk_trace_base2 = __toESM(require_src9(), 1);
|
|
45477
45435
|
var import_semantic_conventions9 = __toESM(require_src2(), 1);
|
|
@@ -45499,9 +45457,9 @@ function setupOtel(client, options = {}) {
|
|
|
45499
45457
|
...options.spanProcessors || []
|
|
45500
45458
|
]
|
|
45501
45459
|
});
|
|
45502
|
-
|
|
45503
|
-
|
|
45504
|
-
|
|
45460
|
+
import_api20.trace.setGlobalTracerProvider(provider);
|
|
45461
|
+
import_api20.propagation.setGlobalPropagator(new SentryPropagator);
|
|
45462
|
+
import_api20.context.setGlobalContextManager(new SentryContextManager);
|
|
45505
45463
|
return provider;
|
|
45506
45464
|
}
|
|
45507
45465
|
function _clampSpanProcessorTimeout(maxSpanWaitDuration) {
|
|
@@ -46594,12 +46552,11 @@ class AgentServer {
|
|
|
46594
46552
|
const agent = this.elizaOS?.getAgent(agentId);
|
|
46595
46553
|
if (agent) {
|
|
46596
46554
|
try {
|
|
46597
|
-
agent.stop().catch((stopError) => {
|
|
46598
|
-
logger32.error({ error: stopError, agentId }, `[AGENT UNREGISTER] Error stopping agent services for ${agentId}:`);
|
|
46599
|
-
});
|
|
46600
46555
|
logger32.debug(`[AGENT UNREGISTER] Stopping services for agent ${agentId}`);
|
|
46556
|
+
await agent.stop();
|
|
46557
|
+
logger32.debug(`[AGENT UNREGISTER] All services stopped for agent ${agentId}`);
|
|
46601
46558
|
} catch (stopError) {
|
|
46602
|
-
logger32.error({ error: stopError, agentId }, `[AGENT UNREGISTER] Error
|
|
46559
|
+
logger32.error({ error: stopError, agentId }, `[AGENT UNREGISTER] Error stopping agent services for ${agentId}:`);
|
|
46603
46560
|
}
|
|
46604
46561
|
}
|
|
46605
46562
|
if (this.elizaOS) {
|