autotel 2.24.1 → 2.25.0
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/auto.cjs +2 -2
- package/dist/auto.js +1 -1
- package/dist/{chunk-CSG2D3BZ.cjs → chunk-73SCHI7V.cjs} +7 -7
- package/dist/{chunk-CSG2D3BZ.cjs.map → chunk-73SCHI7V.cjs.map} +1 -1
- package/dist/{chunk-47KW5CV7.js → chunk-7RV6L24E.js} +4 -3
- package/dist/chunk-7RV6L24E.js.map +1 -0
- package/dist/{chunk-AXNPD6XW.cjs → chunk-7ZYUFMWU.cjs} +26 -26
- package/dist/{chunk-AXNPD6XW.cjs.map → chunk-7ZYUFMWU.cjs.map} +1 -1
- package/dist/{chunk-GSZJOYFF.js → chunk-BKIAH2YS.js} +3 -3
- package/dist/{chunk-GSZJOYFF.js.map → chunk-BKIAH2YS.js.map} +1 -1
- package/dist/{chunk-CLR5RQW4.cjs → chunk-DBUNRUDB.cjs} +5 -5
- package/dist/{chunk-CLR5RQW4.cjs.map → chunk-DBUNRUDB.cjs.map} +1 -1
- package/dist/{chunk-PDRIJURL.cjs → chunk-GIND746I.cjs} +4 -3
- package/dist/chunk-GIND746I.cjs.map +1 -0
- package/dist/{chunk-CZR7PJUZ.cjs → chunk-HCFBEOBM.cjs} +13 -13
- package/dist/{chunk-CZR7PJUZ.cjs.map → chunk-HCFBEOBM.cjs.map} +1 -1
- package/dist/{chunk-2D74YR4Z.js → chunk-JDV3LYOI.js} +3 -3
- package/dist/{chunk-2D74YR4Z.js.map → chunk-JDV3LYOI.js.map} +1 -1
- package/dist/{chunk-ZJTBAUXG.js → chunk-JZKMXKJX.js} +3 -3
- package/dist/{chunk-ZJTBAUXG.js.map → chunk-JZKMXKJX.js.map} +1 -1
- package/dist/{chunk-W6U2BUHU.cjs → chunk-LRFG6HRL.cjs} +5 -5
- package/dist/{chunk-W6U2BUHU.cjs.map → chunk-LRFG6HRL.cjs.map} +1 -1
- package/dist/{chunk-Z3BQYTZE.js → chunk-NYTCPK4J.js} +3 -3
- package/dist/{chunk-Z3BQYTZE.js.map → chunk-NYTCPK4J.js.map} +1 -1
- package/dist/{chunk-IJMW6CTV.js → chunk-P5YCN2Z3.js} +3 -3
- package/dist/{chunk-IJMW6CTV.js.map → chunk-P5YCN2Z3.js.map} +1 -1
- package/dist/decorators.cjs +2 -2
- package/dist/decorators.js +2 -2
- package/dist/event.cjs +5 -5
- package/dist/event.js +2 -2
- package/dist/functional.cjs +9 -9
- package/dist/functional.js +2 -2
- package/dist/index.cjs +41 -41
- package/dist/index.js +9 -9
- package/dist/instrumentation.cjs +8 -8
- package/dist/instrumentation.js +1 -1
- package/dist/messaging.cjs +6 -6
- package/dist/messaging.js +3 -3
- package/dist/semantic-helpers.cjs +7 -7
- package/dist/semantic-helpers.js +3 -3
- package/dist/test-span-collector.cjs +1 -0
- package/dist/test-span-collector.cjs.map +1 -1
- package/dist/test-span-collector.d.cts +2 -1
- package/dist/test-span-collector.d.ts +2 -1
- package/dist/test-span-collector.js +1 -1
- package/dist/test-span-collector.js.map +1 -1
- package/dist/webhook.cjs +3 -3
- package/dist/webhook.js +2 -2
- package/dist/workflow-distributed.cjs +4 -4
- package/dist/workflow-distributed.js +2 -2
- package/dist/workflow.cjs +7 -7
- package/dist/workflow.js +3 -3
- package/package.json +5 -5
- package/src/init.openllmetry.test.ts +98 -193
- package/src/init.ts +18 -1
- package/src/test-span-collector.ts +1 -1
- package/dist/chunk-47KW5CV7.js.map +0 -1
- package/dist/chunk-PDRIJURL.cjs.map +0 -1
|
@@ -4,7 +4,7 @@ var chunkW4EUTSB2_cjs = require('./chunk-W4EUTSB2.cjs');
|
|
|
4
4
|
var chunkGML3FBOT_cjs = require('./chunk-GML3FBOT.cjs');
|
|
5
5
|
var chunkD5LMF53P_cjs = require('./chunk-D5LMF53P.cjs');
|
|
6
6
|
var chunkXRKAL7WJ_cjs = require('./chunk-XRKAL7WJ.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunkGIND746I_cjs = require('./chunk-GIND746I.cjs');
|
|
8
8
|
var chunkBGVKKL2N_cjs = require('./chunk-BGVKKL2N.cjs');
|
|
9
9
|
var chunkESLWRGAG_cjs = require('./chunk-ESLWRGAG.cjs');
|
|
10
10
|
var api = require('@opentelemetry/api');
|
|
@@ -222,7 +222,7 @@ var EventQueue = class {
|
|
|
222
222
|
}
|
|
223
223
|
this.metrics?.dropped.add(1, attrs);
|
|
224
224
|
const logLevel = reason === "payload_invalid" ? "error" : "warn";
|
|
225
|
-
const logger =
|
|
225
|
+
const logger = chunkGIND746I_cjs.getLogger();
|
|
226
226
|
if (logLevel === "error") {
|
|
227
227
|
logger.error(
|
|
228
228
|
{
|
|
@@ -254,7 +254,7 @@ var EventQueue = class {
|
|
|
254
254
|
recordFailed(event, subscriberName, error) {
|
|
255
255
|
this.metrics?.failed.add(1, { subscriber: subscriberName });
|
|
256
256
|
this.subscriberHealthy.set(subscriberName, false);
|
|
257
|
-
|
|
257
|
+
chunkGIND746I_cjs.getLogger().error(
|
|
258
258
|
{
|
|
259
259
|
eventName: event.name,
|
|
260
260
|
subscriber: subscriberName,
|
|
@@ -295,7 +295,7 @@ var EventQueue = class {
|
|
|
295
295
|
if (this.queue.length >= this.config.maxSize) {
|
|
296
296
|
const droppedEvent = this.queue.shift();
|
|
297
297
|
this.recordDropped("rate_limit", droppedEvent);
|
|
298
|
-
|
|
298
|
+
chunkGIND746I_cjs.getLogger().warn(
|
|
299
299
|
{
|
|
300
300
|
droppedEvent: droppedEvent?.name
|
|
301
301
|
},
|
|
@@ -391,7 +391,7 @@ var EventQueue = class {
|
|
|
391
391
|
const failedSubscriberNames = [
|
|
392
392
|
...new Set(failedDeliveries.map((f) => f.subscriberName))
|
|
393
393
|
];
|
|
394
|
-
|
|
394
|
+
chunkGIND746I_cjs.getLogger().error(
|
|
395
395
|
{
|
|
396
396
|
failedSubscribers: failedSubscriberNames,
|
|
397
397
|
retriesAttempted: this.config.maxRetries
|
|
@@ -544,8 +544,8 @@ var EventQueue = class {
|
|
|
544
544
|
// src/track.ts
|
|
545
545
|
var eventsQueue = null;
|
|
546
546
|
function buildAutotelContext(span2) {
|
|
547
|
-
const eventsConfig =
|
|
548
|
-
const config =
|
|
547
|
+
const eventsConfig = chunkGIND746I_cjs.getEventsConfig();
|
|
548
|
+
const config = chunkGIND746I_cjs.getConfig();
|
|
549
549
|
const correlationId = chunkXRKAL7WJ_cjs.getOrCreateCorrelationId();
|
|
550
550
|
if (!eventsConfig?.includeTraceContext) {
|
|
551
551
|
return {
|
|
@@ -599,12 +599,12 @@ function buildAutotelContext(span2) {
|
|
|
599
599
|
return autotelContext;
|
|
600
600
|
}
|
|
601
601
|
function getOrCreateQueue() {
|
|
602
|
-
if (!
|
|
603
|
-
|
|
602
|
+
if (!chunkGIND746I_cjs.isInitialized()) {
|
|
603
|
+
chunkGIND746I_cjs.warnIfNotInitialized("track()");
|
|
604
604
|
return null;
|
|
605
605
|
}
|
|
606
606
|
if (!eventsQueue) {
|
|
607
|
-
const config =
|
|
607
|
+
const config = chunkGIND746I_cjs.getConfig();
|
|
608
608
|
if (!config?.subscribers || config.subscribers.length === 0) {
|
|
609
609
|
return null;
|
|
610
610
|
}
|
|
@@ -615,7 +615,7 @@ function getOrCreateQueue() {
|
|
|
615
615
|
function track(event, data) {
|
|
616
616
|
const queue = getOrCreateQueue();
|
|
617
617
|
if (!queue) return;
|
|
618
|
-
const validationConfig =
|
|
618
|
+
const validationConfig = chunkGIND746I_cjs.getValidationConfig();
|
|
619
619
|
const validated = chunkD5LMF53P_cjs.validateEvent(event, data, validationConfig || void 0);
|
|
620
620
|
const span2 = api.trace.getActiveSpan();
|
|
621
621
|
const enrichedData = span2 ? {
|
|
@@ -1034,8 +1034,8 @@ function wrapWithTracing(fnFactory, options, variableName) {
|
|
|
1034
1034
|
}
|
|
1035
1035
|
const startTime = performance.now();
|
|
1036
1036
|
const isRootSpan = options.startNewRoot || api.trace.getActiveSpan() === void 0;
|
|
1037
|
-
const shouldAutoFlush = options.flushOnRootSpanEnd ??
|
|
1038
|
-
const shouldAutoFlushSpans =
|
|
1037
|
+
const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkGIND746I_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
|
|
1038
|
+
const shouldAutoFlushSpans = chunkGIND746I_cjs.getConfig()?.forceFlushOnShutdown ?? false;
|
|
1039
1039
|
const flushIfNeeded = async () => {
|
|
1040
1040
|
if (!shouldAutoFlush || !isRootSpan) return;
|
|
1041
1041
|
try {
|
|
@@ -1044,7 +1044,7 @@ function wrapWithTracing(fnFactory, options, variableName) {
|
|
|
1044
1044
|
await queue.flush();
|
|
1045
1045
|
}
|
|
1046
1046
|
if (shouldAutoFlushSpans) {
|
|
1047
|
-
const sdk =
|
|
1047
|
+
const sdk = chunkGIND746I_cjs.getSdk();
|
|
1048
1048
|
if (sdk) {
|
|
1049
1049
|
try {
|
|
1050
1050
|
const sdkAny = sdk;
|
|
@@ -1059,7 +1059,7 @@ function wrapWithTracing(fnFactory, options, variableName) {
|
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
1061
|
} catch (error) {
|
|
1062
|
-
const initConfig =
|
|
1062
|
+
const initConfig = chunkGIND746I_cjs.getConfig();
|
|
1063
1063
|
const logger = initConfig?.logger;
|
|
1064
1064
|
if (logger?.error) {
|
|
1065
1065
|
logger.error(
|
|
@@ -1223,14 +1223,14 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
1223
1223
|
}
|
|
1224
1224
|
const startTime = performance.now();
|
|
1225
1225
|
const isRootSpan = options.startNewRoot || api.trace.getActiveSpan() === void 0;
|
|
1226
|
-
const shouldAutoFlush = options.flushOnRootSpanEnd ??
|
|
1227
|
-
const shouldAutoFlushSpans =
|
|
1226
|
+
const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkGIND746I_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
|
|
1227
|
+
const shouldAutoFlushSpans = chunkGIND746I_cjs.getConfig()?.forceFlushOnShutdown ?? false;
|
|
1228
1228
|
const flushIfNeeded = () => {
|
|
1229
1229
|
if (!shouldAutoFlush || !isRootSpan) return;
|
|
1230
1230
|
const queue = getEventQueue();
|
|
1231
1231
|
if (queue && queue.size() > 0) {
|
|
1232
1232
|
void queue.flush().catch((error) => {
|
|
1233
|
-
const initConfig =
|
|
1233
|
+
const initConfig = chunkGIND746I_cjs.getConfig();
|
|
1234
1234
|
const logger = initConfig?.logger;
|
|
1235
1235
|
if (logger?.error) {
|
|
1236
1236
|
logger.error(
|
|
@@ -1243,7 +1243,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
1243
1243
|
});
|
|
1244
1244
|
}
|
|
1245
1245
|
if (shouldAutoFlushSpans) {
|
|
1246
|
-
const sdk =
|
|
1246
|
+
const sdk = chunkGIND746I_cjs.getSdk();
|
|
1247
1247
|
if (sdk) {
|
|
1248
1248
|
try {
|
|
1249
1249
|
const sdkAny = sdk;
|
|
@@ -1251,7 +1251,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
1251
1251
|
const tracerProvider = sdkAny.getTracerProvider();
|
|
1252
1252
|
if (tracerProvider && typeof tracerProvider.forceFlush === "function") {
|
|
1253
1253
|
void tracerProvider.forceFlush().catch((error) => {
|
|
1254
|
-
const initConfig =
|
|
1254
|
+
const initConfig = chunkGIND746I_cjs.getConfig();
|
|
1255
1255
|
const logger = initConfig?.logger;
|
|
1256
1256
|
if (logger?.error) {
|
|
1257
1257
|
logger.error(
|
|
@@ -1394,8 +1394,8 @@ function executeImmediately(fn, options) {
|
|
|
1394
1394
|
}
|
|
1395
1395
|
const startTime = performance.now();
|
|
1396
1396
|
const isRootSpan = options.startNewRoot || api.trace.getActiveSpan() === void 0;
|
|
1397
|
-
const shouldAutoFlush = options.flushOnRootSpanEnd ??
|
|
1398
|
-
const shouldAutoFlushSpans =
|
|
1397
|
+
const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkGIND746I_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
|
|
1398
|
+
const shouldAutoFlushSpans = chunkGIND746I_cjs.getConfig()?.forceFlushOnShutdown ?? false;
|
|
1399
1399
|
const callCounter = options.withMetrics ? meter.createCounter(`${spanName}.calls`, {
|
|
1400
1400
|
description: `Call count for ${spanName}`,
|
|
1401
1401
|
unit: "1"
|
|
@@ -1412,7 +1412,7 @@ function executeImmediately(fn, options) {
|
|
|
1412
1412
|
await queue.flush();
|
|
1413
1413
|
}
|
|
1414
1414
|
if (shouldAutoFlushSpans) {
|
|
1415
|
-
const sdk =
|
|
1415
|
+
const sdk = chunkGIND746I_cjs.getSdk();
|
|
1416
1416
|
if (sdk) {
|
|
1417
1417
|
try {
|
|
1418
1418
|
const sdkAny = sdk;
|
|
@@ -1427,7 +1427,7 @@ function executeImmediately(fn, options) {
|
|
|
1427
1427
|
}
|
|
1428
1428
|
}
|
|
1429
1429
|
} catch (error) {
|
|
1430
|
-
const initConfig =
|
|
1430
|
+
const initConfig = chunkGIND746I_cjs.getConfig();
|
|
1431
1431
|
const logger = initConfig?.logger;
|
|
1432
1432
|
if (logger?.error) {
|
|
1433
1433
|
logger.error(
|
|
@@ -1799,5 +1799,5 @@ exports.track = track;
|
|
|
1799
1799
|
exports.withBaggage = withBaggage;
|
|
1800
1800
|
exports.withNewContext = withNewContext;
|
|
1801
1801
|
exports.withTracing = withTracing;
|
|
1802
|
-
//# sourceMappingURL=chunk-
|
|
1803
|
-
//# sourceMappingURL=chunk-
|
|
1802
|
+
//# sourceMappingURL=chunk-7ZYUFMWU.cjs.map
|
|
1803
|
+
//# sourceMappingURL=chunk-7ZYUFMWU.cjs.map
|