autotel 3.2.0 → 3.3.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-ZKKJQS6R.js → chunk-32AXF4MA.js} +29 -7
- package/dist/chunk-32AXF4MA.js.map +1 -0
- package/dist/{chunk-RRTFFAG3.cjs → chunk-3MZJ7Y24.cjs} +5 -5
- package/dist/{chunk-RRTFFAG3.cjs.map → chunk-3MZJ7Y24.cjs.map} +1 -1
- package/dist/{chunk-5RZ3NZ2M.cjs → chunk-4RA6HIYF.cjs} +5 -5
- package/dist/{chunk-5RZ3NZ2M.cjs.map → chunk-4RA6HIYF.cjs.map} +1 -1
- package/dist/{chunk-NIDUQZIN.js → chunk-4TAQQZDU.js} +3 -3
- package/dist/{chunk-NIDUQZIN.js.map → chunk-4TAQQZDU.js.map} +1 -1
- package/dist/{chunk-UV64CWMA.cjs → chunk-DQSVSGK3.cjs} +13 -13
- package/dist/{chunk-UV64CWMA.cjs.map → chunk-DQSVSGK3.cjs.map} +1 -1
- package/dist/{chunk-IS2QJ44P.js → chunk-FZROHTZZ.js} +3 -3
- package/dist/{chunk-IS2QJ44P.js.map → chunk-FZROHTZZ.js.map} +1 -1
- package/dist/{chunk-4UUEGERM.cjs → chunk-MQH5OOZK.cjs} +17 -17
- package/dist/{chunk-4UUEGERM.cjs.map → chunk-MQH5OOZK.cjs.map} +1 -1
- package/dist/{chunk-QVLMGNQF.js → chunk-OACAWYLR.js} +4 -4
- package/dist/{chunk-QVLMGNQF.js.map → chunk-OACAWYLR.js.map} +1 -1
- package/dist/{chunk-RZI5XXAD.js → chunk-OPCTN527.js} +3 -3
- package/dist/{chunk-RZI5XXAD.js.map → chunk-OPCTN527.js.map} +1 -1
- package/dist/{chunk-NN2GODP4.cjs → chunk-QICFEFD6.cjs} +7 -7
- package/dist/{chunk-NN2GODP4.cjs.map → chunk-QICFEFD6.cjs.map} +1 -1
- package/dist/{chunk-KKIYPZOP.cjs → chunk-QJYWKAC5.cjs} +29 -7
- package/dist/chunk-QJYWKAC5.cjs.map +1 -0
- package/dist/{chunk-7EVW3Z37.js → chunk-TGV2XF57.js} +3 -3
- package/dist/{chunk-7EVW3Z37.js.map → chunk-TGV2XF57.js.map} +1 -1
- package/dist/{chunk-FVA2YDEQ.js → chunk-U4D5IBSB.js} +4 -4
- package/dist/{chunk-FVA2YDEQ.js.map → chunk-U4D5IBSB.js.map} +1 -1
- package/dist/{chunk-EEQHQKPP.cjs → chunk-U72TGONP.cjs} +32 -32
- package/dist/{chunk-EEQHQKPP.cjs.map → chunk-U72TGONP.cjs.map} +1 -1
- package/dist/correlation-id.cjs +10 -10
- package/dist/correlation-id.js +2 -2
- package/dist/decorators.cjs +4 -4
- package/dist/decorators.js +3 -3
- package/dist/event.cjs +6 -6
- package/dist/event.js +3 -3
- package/dist/functional.cjs +11 -11
- package/dist/functional.js +3 -3
- package/dist/http.cjs +3 -3
- package/dist/http.js +2 -2
- package/dist/index.cjs +215 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +185 -2
- package/dist/index.d.ts +185 -2
- package/dist/index.js +149 -12
- package/dist/index.js.map +1 -1
- package/dist/{init-BSyIyDs5.d.ts → init-DyE43paw.d.ts} +7 -2
- package/dist/{init-D9Bxx39e.d.cts → init-gyesUMwz.d.cts} +7 -2
- package/dist/instrumentation.cjs +8 -8
- package/dist/instrumentation.js +1 -1
- package/dist/messaging.cjs +7 -7
- package/dist/messaging.js +4 -4
- package/dist/semantic-helpers.cjs +8 -8
- package/dist/semantic-helpers.js +4 -4
- package/dist/webhook.cjs +5 -5
- package/dist/webhook.js +3 -3
- package/dist/workflow-distributed.cjs +5 -5
- package/dist/workflow-distributed.js +3 -3
- package/dist/workflow.cjs +8 -8
- package/dist/workflow.js +4 -4
- package/dist/yaml-config.d.cts +1 -1
- package/dist/yaml-config.d.ts +1 -1
- package/package.json +1 -1
- package/skills/build-audit-trails/SKILL.md +150 -5
- package/skills/build-audit-trails/references/audit-queries.md +73 -0
- package/skills/build-audit-trails/references/framework-wiring.md +187 -0
- package/skills/review-otel-patterns/SKILL.md +41 -0
- package/src/error-catalog.test.ts +128 -0
- package/src/error-catalog.ts +259 -0
- package/src/gen-ai-cost.test.ts +81 -0
- package/src/gen-ai-cost.ts +145 -0
- package/src/index.ts +29 -0
- package/src/init-auto-redactor.test.ts +53 -0
- package/src/init.ts +46 -7
- package/dist/chunk-KKIYPZOP.cjs.map +0 -1
- package/dist/chunk-ZKKJQS6R.js.map +0 -1
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var chunk2GIBANLB_cjs = require('./chunk-2GIBANLB.cjs');
|
|
4
4
|
var chunkVQTCQKHQ_cjs = require('./chunk-VQTCQKHQ.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkDQSVSGK3_cjs = require('./chunk-DQSVSGK3.cjs');
|
|
6
|
+
var chunkQJYWKAC5_cjs = require('./chunk-QJYWKAC5.cjs');
|
|
7
7
|
var chunkVH77IPJN_cjs = require('./chunk-VH77IPJN.cjs');
|
|
8
8
|
var chunkESLWRGAG_cjs = require('./chunk-ESLWRGAG.cjs');
|
|
9
9
|
var api = require('@opentelemetry/api');
|
|
@@ -355,7 +355,7 @@ function shouldSkip(key, fn, skip) {
|
|
|
355
355
|
function getCtxValue() {
|
|
356
356
|
const activeSpan = api.trace.getActiveSpan();
|
|
357
357
|
if (!activeSpan) return null;
|
|
358
|
-
return
|
|
358
|
+
return chunkDQSVSGK3_cjs.createTraceContext(activeSpan);
|
|
359
359
|
}
|
|
360
360
|
var ctx = new Proxy(
|
|
361
361
|
{},
|
|
@@ -420,17 +420,17 @@ function wrapWithTracing(fnFactory, options, variableName) {
|
|
|
420
420
|
}
|
|
421
421
|
const startTime = performance.now();
|
|
422
422
|
const isRootSpan = options.startNewRoot || api.trace.getActiveSpan() === void 0;
|
|
423
|
-
const shouldAutoFlush = options.flushOnRootSpanEnd ??
|
|
424
|
-
const shouldAutoFlushSpans =
|
|
423
|
+
const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkQJYWKAC5_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
|
|
424
|
+
const shouldAutoFlushSpans = chunkQJYWKAC5_cjs.getConfig()?.forceFlushOnShutdown ?? false;
|
|
425
425
|
const flushIfNeeded = async () => {
|
|
426
426
|
if (!shouldAutoFlush || !isRootSpan) return;
|
|
427
427
|
try {
|
|
428
|
-
const queue =
|
|
428
|
+
const queue = chunkDQSVSGK3_cjs.getEventQueue();
|
|
429
429
|
if (queue && queue.size() > 0) {
|
|
430
430
|
await queue.flush();
|
|
431
431
|
}
|
|
432
432
|
if (shouldAutoFlushSpans) {
|
|
433
|
-
const sdk =
|
|
433
|
+
const sdk = chunkQJYWKAC5_cjs.getSdk();
|
|
434
434
|
if (sdk) {
|
|
435
435
|
try {
|
|
436
436
|
const sdkAny = sdk;
|
|
@@ -445,7 +445,7 @@ function wrapWithTracing(fnFactory, options, variableName) {
|
|
|
445
445
|
}
|
|
446
446
|
}
|
|
447
447
|
} catch (error) {
|
|
448
|
-
const initConfig =
|
|
448
|
+
const initConfig = chunkQJYWKAC5_cjs.getConfig();
|
|
449
449
|
const logger = initConfig?.logger;
|
|
450
450
|
if (logger?.error) {
|
|
451
451
|
logger.error(
|
|
@@ -464,7 +464,7 @@ function wrapWithTracing(fnFactory, options, variableName) {
|
|
|
464
464
|
if (options.spanKind !== void 0) {
|
|
465
465
|
spanOptions.kind = options.spanKind;
|
|
466
466
|
}
|
|
467
|
-
const parentContext =
|
|
467
|
+
const parentContext = chunkDQSVSGK3_cjs.getActiveContextWithBaggage();
|
|
468
468
|
return tracer.startActiveSpan(
|
|
469
469
|
spanName,
|
|
470
470
|
spanOptions,
|
|
@@ -474,11 +474,11 @@ function wrapWithTracing(fnFactory, options, variableName) {
|
|
|
474
474
|
let shouldKeepSpan = true;
|
|
475
475
|
chunk2GIBANLB_cjs.setSpanName(span2, spanName);
|
|
476
476
|
const initialContext = api.context.active();
|
|
477
|
-
const contextStorage =
|
|
477
|
+
const contextStorage = chunkDQSVSGK3_cjs.getContextStorage();
|
|
478
478
|
if (!contextStorage.getStore()) {
|
|
479
|
-
|
|
479
|
+
chunkDQSVSGK3_cjs.enterOrRun(contextStorage, initialContext);
|
|
480
480
|
}
|
|
481
|
-
const ctxValue =
|
|
481
|
+
const ctxValue = chunkDQSVSGK3_cjs.createTraceContext(span2);
|
|
482
482
|
const fn = fnFactory(ctxValue);
|
|
483
483
|
const argsAttributes = options.attributesFromArgs ? options.attributesFromArgs(args) : {};
|
|
484
484
|
const handleTailSampling = (success, duration, error) => {
|
|
@@ -563,7 +563,7 @@ function wrapWithTracing(fnFactory, options, variableName) {
|
|
|
563
563
|
status: "started"
|
|
564
564
|
});
|
|
565
565
|
const executeWithContext = async () => {
|
|
566
|
-
const currentContext =
|
|
566
|
+
const currentContext = chunkDQSVSGK3_cjs.getActiveContextWithBaggage();
|
|
567
567
|
return api.context.with(currentContext, async () => {
|
|
568
568
|
return fn.call(this, ...args);
|
|
569
569
|
});
|
|
@@ -615,14 +615,14 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
615
615
|
}
|
|
616
616
|
const startTime = performance.now();
|
|
617
617
|
const isRootSpan = options.startNewRoot || api.trace.getActiveSpan() === void 0;
|
|
618
|
-
const shouldAutoFlush = options.flushOnRootSpanEnd ??
|
|
619
|
-
const shouldAutoFlushSpans =
|
|
618
|
+
const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkQJYWKAC5_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
|
|
619
|
+
const shouldAutoFlushSpans = chunkQJYWKAC5_cjs.getConfig()?.forceFlushOnShutdown ?? false;
|
|
620
620
|
const flushIfNeeded = () => {
|
|
621
621
|
if (!shouldAutoFlush || !isRootSpan) return;
|
|
622
|
-
const queue =
|
|
622
|
+
const queue = chunkDQSVSGK3_cjs.getEventQueue();
|
|
623
623
|
if (queue && queue.size() > 0) {
|
|
624
624
|
void queue.flush().catch((error) => {
|
|
625
|
-
const initConfig =
|
|
625
|
+
const initConfig = chunkQJYWKAC5_cjs.getConfig();
|
|
626
626
|
const logger = initConfig?.logger;
|
|
627
627
|
if (logger?.error) {
|
|
628
628
|
logger.error(
|
|
@@ -635,7 +635,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
635
635
|
});
|
|
636
636
|
}
|
|
637
637
|
if (shouldAutoFlushSpans) {
|
|
638
|
-
const sdk =
|
|
638
|
+
const sdk = chunkQJYWKAC5_cjs.getSdk();
|
|
639
639
|
if (sdk) {
|
|
640
640
|
try {
|
|
641
641
|
const sdkAny = sdk;
|
|
@@ -643,7 +643,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
643
643
|
const tracerProvider = sdkAny.getTracerProvider();
|
|
644
644
|
if (tracerProvider && typeof tracerProvider.forceFlush === "function") {
|
|
645
645
|
void tracerProvider.forceFlush().catch((error) => {
|
|
646
|
-
const initConfig =
|
|
646
|
+
const initConfig = chunkQJYWKAC5_cjs.getConfig();
|
|
647
647
|
const logger = initConfig?.logger;
|
|
648
648
|
if (logger?.error) {
|
|
649
649
|
logger.error(
|
|
@@ -668,7 +668,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
668
668
|
if (options.spanKind !== void 0) {
|
|
669
669
|
spanOptions.kind = options.spanKind;
|
|
670
670
|
}
|
|
671
|
-
const parentContext =
|
|
671
|
+
const parentContext = chunkDQSVSGK3_cjs.getActiveContextWithBaggage();
|
|
672
672
|
return tracer.startActiveSpan(
|
|
673
673
|
spanName,
|
|
674
674
|
spanOptions,
|
|
@@ -677,7 +677,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
677
677
|
return chunkVQTCQKHQ_cjs.runInOperationContext(spanName, () => {
|
|
678
678
|
let shouldKeepSpan = true;
|
|
679
679
|
chunk2GIBANLB_cjs.setSpanName(span2, spanName);
|
|
680
|
-
const ctxValue =
|
|
680
|
+
const ctxValue = chunkDQSVSGK3_cjs.createTraceContext(span2);
|
|
681
681
|
const fn = fnFactory(ctxValue);
|
|
682
682
|
const argsAttributes = options.attributesFromArgs ? options.attributesFromArgs(args) : {};
|
|
683
683
|
const handleTailSampling = (success, duration, error) => {
|
|
@@ -792,8 +792,8 @@ function executeImmediately(fn, options) {
|
|
|
792
792
|
}
|
|
793
793
|
const startTime = performance.now();
|
|
794
794
|
const isRootSpan = options.startNewRoot || api.trace.getActiveSpan() === void 0;
|
|
795
|
-
const shouldAutoFlush = options.flushOnRootSpanEnd ??
|
|
796
|
-
const shouldAutoFlushSpans =
|
|
795
|
+
const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkQJYWKAC5_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
|
|
796
|
+
const shouldAutoFlushSpans = chunkQJYWKAC5_cjs.getConfig()?.forceFlushOnShutdown ?? false;
|
|
797
797
|
const callCounter = options.withMetrics ? meter.createCounter(`${spanName}.calls`, {
|
|
798
798
|
description: `Call count for ${spanName}`,
|
|
799
799
|
unit: "1"
|
|
@@ -805,12 +805,12 @@ function executeImmediately(fn, options) {
|
|
|
805
805
|
const flushIfNeeded = async () => {
|
|
806
806
|
if (!shouldAutoFlush || !isRootSpan) return;
|
|
807
807
|
try {
|
|
808
|
-
const queue =
|
|
808
|
+
const queue = chunkDQSVSGK3_cjs.getEventQueue();
|
|
809
809
|
if (queue && queue.size() > 0) {
|
|
810
810
|
await queue.flush();
|
|
811
811
|
}
|
|
812
812
|
if (shouldAutoFlushSpans) {
|
|
813
|
-
const sdk =
|
|
813
|
+
const sdk = chunkQJYWKAC5_cjs.getSdk();
|
|
814
814
|
if (sdk) {
|
|
815
815
|
try {
|
|
816
816
|
const sdkAny = sdk;
|
|
@@ -825,7 +825,7 @@ function executeImmediately(fn, options) {
|
|
|
825
825
|
}
|
|
826
826
|
}
|
|
827
827
|
} catch (error) {
|
|
828
|
-
const initConfig =
|
|
828
|
+
const initConfig = chunkQJYWKAC5_cjs.getConfig();
|
|
829
829
|
const logger = initConfig?.logger;
|
|
830
830
|
if (logger?.error) {
|
|
831
831
|
logger.error(
|
|
@@ -844,7 +844,7 @@ function executeImmediately(fn, options) {
|
|
|
844
844
|
if (options.spanKind !== void 0) {
|
|
845
845
|
spanOptions.kind = options.spanKind;
|
|
846
846
|
}
|
|
847
|
-
const parentContext =
|
|
847
|
+
const parentContext = chunkDQSVSGK3_cjs.getActiveContextWithBaggage();
|
|
848
848
|
return tracer.startActiveSpan(
|
|
849
849
|
spanName,
|
|
850
850
|
spanOptions,
|
|
@@ -853,7 +853,7 @@ function executeImmediately(fn, options) {
|
|
|
853
853
|
return chunkVQTCQKHQ_cjs.runInOperationContext(spanName, () => {
|
|
854
854
|
let shouldKeepSpan = true;
|
|
855
855
|
chunk2GIBANLB_cjs.setSpanName(span2, spanName);
|
|
856
|
-
const ctxValue =
|
|
856
|
+
const ctxValue = chunkDQSVSGK3_cjs.createTraceContext(span2);
|
|
857
857
|
const handleTailSampling = (success, duration, error) => {
|
|
858
858
|
if (needsTailSampling && "shouldKeepTrace" in sampler && typeof sampler.shouldKeepTrace === "function") {
|
|
859
859
|
shouldKeepSpan = sampler.shouldKeepTrace(samplingContext, {
|
|
@@ -1135,7 +1135,7 @@ function span(nameOrOptions, fn) {
|
|
|
1135
1135
|
}
|
|
1136
1136
|
});
|
|
1137
1137
|
};
|
|
1138
|
-
const parentContext =
|
|
1138
|
+
const parentContext = chunkDQSVSGK3_cjs.getActiveContextWithBaggage();
|
|
1139
1139
|
const result = tracer.startActiveSpan(name, {}, parentContext, executeSpan);
|
|
1140
1140
|
if (result instanceof Promise) {
|
|
1141
1141
|
return result;
|
|
@@ -1170,7 +1170,7 @@ function withBaggage(options) {
|
|
|
1170
1170
|
updatedBaggage = updatedBaggage.setEntry(key, { value });
|
|
1171
1171
|
}
|
|
1172
1172
|
const newContext = api.propagation.setBaggage(currentContext, updatedBaggage);
|
|
1173
|
-
const ctxStorage =
|
|
1173
|
+
const ctxStorage = chunkDQSVSGK3_cjs.getContextStorage();
|
|
1174
1174
|
const previousStored = ctxStorage.getStore();
|
|
1175
1175
|
const baggageEnrichedStored = previousStored ? { value: api.propagation.setBaggage(previousStored.value, updatedBaggage) } : { value: newContext };
|
|
1176
1176
|
const result = previousStored ? ctxStorage.run(baggageEnrichedStored, () => api.context.with(newContext, fn)) : api.context.with(newContext, fn);
|
|
@@ -1203,5 +1203,5 @@ exports.trace = trace;
|
|
|
1203
1203
|
exports.withBaggage = withBaggage;
|
|
1204
1204
|
exports.withNewContext = withNewContext;
|
|
1205
1205
|
exports.withTracing = withTracing;
|
|
1206
|
-
//# sourceMappingURL=chunk-
|
|
1207
|
-
//# sourceMappingURL=chunk-
|
|
1206
|
+
//# sourceMappingURL=chunk-U72TGONP.cjs.map
|
|
1207
|
+
//# sourceMappingURL=chunk-U72TGONP.cjs.map
|