autotel 3.0.0 → 3.0.3
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/README.md +21 -4
- package/dist/attribute-redacting-processor.cjs +8 -8
- package/dist/attribute-redacting-processor.d.cts +10 -1
- package/dist/attribute-redacting-processor.d.ts +10 -1
- package/dist/attribute-redacting-processor.js +1 -1
- package/dist/attributes.cjs +21 -21
- package/dist/attributes.js +2 -2
- package/dist/auto.cjs +3 -3
- package/dist/auto.js +2 -2
- package/dist/{chunk-7HNQYHK4.js → chunk-52PUSFC2.js} +3 -3
- package/dist/{chunk-7HNQYHK4.js.map → chunk-52PUSFC2.js.map} +1 -1
- package/dist/{chunk-L7JDUDJD.cjs → chunk-7SMNC4LS.cjs} +7 -7
- package/dist/{chunk-L7JDUDJD.cjs.map → chunk-7SMNC4LS.cjs.map} +1 -1
- package/dist/{chunk-563EL6O6.cjs → chunk-BPO2PQ3T.cjs} +12 -8
- package/dist/chunk-BPO2PQ3T.cjs.map +1 -0
- package/dist/{chunk-ZSABTI3C.cjs → chunk-DAZ7EGR4.cjs} +17 -17
- package/dist/{chunk-ZSABTI3C.cjs.map → chunk-DAZ7EGR4.cjs.map} +1 -1
- package/dist/{chunk-ER43K7ES.js → chunk-DDXIUZEG.js} +3 -3
- package/dist/{chunk-ER43K7ES.js.map → chunk-DDXIUZEG.js.map} +1 -1
- package/dist/{chunk-JKIMEPI2.cjs → chunk-DQ2SUROF.cjs} +4 -4
- package/dist/{chunk-JKIMEPI2.cjs.map → chunk-DQ2SUROF.cjs.map} +1 -1
- package/dist/{chunk-KHGA4OST.cjs → chunk-HKZHUGGN.cjs} +5 -5
- package/dist/{chunk-KHGA4OST.cjs.map → chunk-HKZHUGGN.cjs.map} +1 -1
- package/dist/{chunk-TDNKIHKT.js → chunk-JVWJDHDB.js} +13 -4
- package/dist/chunk-JVWJDHDB.js.map +1 -0
- package/dist/{chunk-3QMFLJHJ.js → chunk-K7HSRLP5.js} +3 -3
- package/dist/{chunk-3QMFLJHJ.js.map → chunk-K7HSRLP5.js.map} +1 -1
- package/dist/{chunk-CJ4PD2TZ.cjs → chunk-KKGM42RQ.cjs} +13 -13
- package/dist/{chunk-CJ4PD2TZ.cjs.map → chunk-KKGM42RQ.cjs.map} +1 -1
- package/dist/{chunk-DWOBIBLY.cjs → chunk-MOO75VE4.cjs} +5 -5
- package/dist/{chunk-DWOBIBLY.cjs.map → chunk-MOO75VE4.cjs.map} +1 -1
- package/dist/{chunk-CMNGGTQL.cjs → chunk-NXLRY2CE.cjs} +13 -4
- package/dist/chunk-NXLRY2CE.cjs.map +1 -0
- package/dist/{chunk-4DAG3RFS.js → chunk-OM4OSBOP.js} +4 -4
- package/dist/{chunk-4DAG3RFS.js.map → chunk-OM4OSBOP.js.map} +1 -1
- package/dist/{chunk-DAAJLUTO.js → chunk-PMRWMRXY.js} +4 -4
- package/dist/{chunk-DAAJLUTO.js.map → chunk-PMRWMRXY.js.map} +1 -1
- package/dist/{chunk-MOK3E54E.cjs → chunk-QPH5ZKP5.cjs} +32 -32
- package/dist/{chunk-MOK3E54E.cjs.map → chunk-QPH5ZKP5.cjs.map} +1 -1
- package/dist/{chunk-IUDXKLS4.js → chunk-TFRZOUTV.js} +3 -3
- package/dist/{chunk-IUDXKLS4.js.map → chunk-TFRZOUTV.js.map} +1 -1
- package/dist/{chunk-QG3U5ONP.js → chunk-Z7VAOK5X.js} +3 -3
- package/dist/{chunk-QG3U5ONP.js.map → chunk-Z7VAOK5X.js.map} +1 -1
- package/dist/{chunk-W35FVJBC.js → chunk-ZDPIWKWD.js} +9 -5
- package/dist/chunk-ZDPIWKWD.js.map +1 -0
- package/dist/correlation-id.cjs +11 -11
- package/dist/correlation-id.js +3 -3
- package/dist/decorators.cjs +5 -5
- package/dist/decorators.js +4 -4
- package/dist/event.cjs +7 -7
- package/dist/event.js +4 -4
- package/dist/functional.cjs +11 -11
- package/dist/functional.js +4 -4
- package/dist/http.cjs +4 -4
- package/dist/http.js +3 -3
- package/dist/index.cjs +226 -92
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +67 -3
- package/dist/index.d.ts +67 -3
- package/dist/index.js +138 -15
- package/dist/index.js.map +1 -1
- package/dist/instrumentation.cjs +9 -9
- package/dist/instrumentation.js +2 -2
- package/dist/messaging.cjs +8 -8
- package/dist/messaging.js +5 -5
- package/dist/semantic-helpers.cjs +9 -9
- package/dist/semantic-helpers.js +5 -5
- package/dist/webhook.cjs +6 -6
- package/dist/webhook.js +4 -4
- package/dist/workflow-distributed.cjs +6 -6
- package/dist/workflow-distributed.js +4 -4
- package/dist/workflow.cjs +9 -9
- package/dist/workflow.js +5 -5
- package/package.json +43 -45
- package/skills/analyze-traces/SKILL.md +178 -0
- package/skills/autotel-core/SKILL.md +0 -7
- package/skills/autotel-events/SKILL.md +0 -6
- package/skills/autotel-frameworks/SKILL.md +0 -9
- package/skills/autotel-instrumentation/SKILL.md +0 -7
- package/skills/autotel-request-logging/SKILL.md +0 -8
- package/skills/autotel-structured-errors/SKILL.md +0 -7
- package/skills/build-audit-trails/SKILL.md +302 -0
- package/skills/debug-missing-spans/SKILL.md +248 -0
- package/skills/migrate-to-autotel/SKILL.md +268 -0
- package/skills/review-otel-patterns/SKILL.md +488 -0
- package/skills/review-otel-patterns/references/code-review.md +75 -0
- package/skills/review-otel-patterns/references/processor-pipeline.md +205 -0
- package/skills/review-otel-patterns/references/structured-errors.md +102 -0
- package/skills/review-otel-patterns/references/wide-spans.md +85 -0
- package/skills/tune-sampling/SKILL.md +210 -0
- package/src/attribute-redacting-processor.test.ts +6 -4
- package/src/attribute-redacting-processor.ts +11 -2
- package/src/drain-toolkit.test.ts +113 -0
- package/src/drain-toolkit.ts +129 -0
- package/src/enricher-toolkit.test.ts +67 -0
- package/src/enricher-toolkit.ts +79 -0
- package/src/index.ts +19 -0
- package/src/redact-values.test.ts +24 -10
- package/src/redact-values.ts +9 -2
- package/src/request-logger.test.ts +91 -0
- package/src/request-logger.ts +36 -2
- package/src/structured-error.test.ts +4 -1
- package/bin/intent.js +0 -6
- package/dist/chunk-563EL6O6.cjs.map +0 -1
- package/dist/chunk-CMNGGTQL.cjs.map +0 -1
- package/dist/chunk-TDNKIHKT.js.map +0 -1
- package/dist/chunk-W35FVJBC.js.map +0 -1
- package/src/package-manifest.test.ts +0 -24
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkNCSMD3TK_cjs = require('./chunk-NCSMD3TK.cjs');
|
|
4
4
|
var chunkVQTCQKHQ_cjs = require('./chunk-VQTCQKHQ.cjs');
|
|
5
|
-
var
|
|
6
|
-
var
|
|
5
|
+
var chunkKKGM42RQ_cjs = require('./chunk-KKGM42RQ.cjs');
|
|
6
|
+
var chunkBPO2PQ3T_cjs = require('./chunk-BPO2PQ3T.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');
|
|
@@ -342,7 +342,7 @@ function shouldSkip(key, fn, skip) {
|
|
|
342
342
|
function getCtxValue() {
|
|
343
343
|
const activeSpan = api.trace.getActiveSpan();
|
|
344
344
|
if (!activeSpan) return null;
|
|
345
|
-
return
|
|
345
|
+
return chunkKKGM42RQ_cjs.createTraceContext(activeSpan);
|
|
346
346
|
}
|
|
347
347
|
var ctx = new Proxy(
|
|
348
348
|
{},
|
|
@@ -407,17 +407,17 @@ function wrapWithTracing(fnFactory, options, variableName) {
|
|
|
407
407
|
}
|
|
408
408
|
const startTime = performance.now();
|
|
409
409
|
const isRootSpan = options.startNewRoot || api.trace.getActiveSpan() === void 0;
|
|
410
|
-
const shouldAutoFlush = options.flushOnRootSpanEnd ??
|
|
411
|
-
const shouldAutoFlushSpans =
|
|
410
|
+
const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkBPO2PQ3T_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
|
|
411
|
+
const shouldAutoFlushSpans = chunkBPO2PQ3T_cjs.getConfig()?.forceFlushOnShutdown ?? false;
|
|
412
412
|
const flushIfNeeded = async () => {
|
|
413
413
|
if (!shouldAutoFlush || !isRootSpan) return;
|
|
414
414
|
try {
|
|
415
|
-
const queue =
|
|
415
|
+
const queue = chunkKKGM42RQ_cjs.getEventQueue();
|
|
416
416
|
if (queue && queue.size() > 0) {
|
|
417
417
|
await queue.flush();
|
|
418
418
|
}
|
|
419
419
|
if (shouldAutoFlushSpans) {
|
|
420
|
-
const sdk =
|
|
420
|
+
const sdk = chunkBPO2PQ3T_cjs.getSdk();
|
|
421
421
|
if (sdk) {
|
|
422
422
|
try {
|
|
423
423
|
const sdkAny = sdk;
|
|
@@ -432,7 +432,7 @@ function wrapWithTracing(fnFactory, options, variableName) {
|
|
|
432
432
|
}
|
|
433
433
|
}
|
|
434
434
|
} catch (error) {
|
|
435
|
-
const initConfig =
|
|
435
|
+
const initConfig = chunkBPO2PQ3T_cjs.getConfig();
|
|
436
436
|
const logger = initConfig?.logger;
|
|
437
437
|
if (logger?.error) {
|
|
438
438
|
logger.error(
|
|
@@ -451,7 +451,7 @@ function wrapWithTracing(fnFactory, options, variableName) {
|
|
|
451
451
|
if (options.spanKind !== void 0) {
|
|
452
452
|
spanOptions.kind = options.spanKind;
|
|
453
453
|
}
|
|
454
|
-
const parentContext =
|
|
454
|
+
const parentContext = chunkKKGM42RQ_cjs.getActiveContextWithBaggage();
|
|
455
455
|
return tracer.startActiveSpan(
|
|
456
456
|
spanName,
|
|
457
457
|
spanOptions,
|
|
@@ -461,11 +461,11 @@ function wrapWithTracing(fnFactory, options, variableName) {
|
|
|
461
461
|
let shouldKeepSpan = true;
|
|
462
462
|
chunkNCSMD3TK_cjs.setSpanName(span2, spanName);
|
|
463
463
|
const initialContext = api.context.active();
|
|
464
|
-
const contextStorage =
|
|
464
|
+
const contextStorage = chunkKKGM42RQ_cjs.getContextStorage();
|
|
465
465
|
if (!contextStorage.getStore()) {
|
|
466
|
-
|
|
466
|
+
chunkKKGM42RQ_cjs.enterOrRun(contextStorage, initialContext);
|
|
467
467
|
}
|
|
468
|
-
const ctxValue =
|
|
468
|
+
const ctxValue = chunkKKGM42RQ_cjs.createTraceContext(span2);
|
|
469
469
|
const fn = fnFactory(ctxValue);
|
|
470
470
|
const argsAttributes = options.attributesFromArgs ? options.attributesFromArgs(args) : {};
|
|
471
471
|
const handleTailSampling = (success, duration, error) => {
|
|
@@ -550,7 +550,7 @@ function wrapWithTracing(fnFactory, options, variableName) {
|
|
|
550
550
|
status: "started"
|
|
551
551
|
});
|
|
552
552
|
const executeWithContext = async () => {
|
|
553
|
-
const currentContext =
|
|
553
|
+
const currentContext = chunkKKGM42RQ_cjs.getActiveContextWithBaggage();
|
|
554
554
|
return api.context.with(currentContext, async () => {
|
|
555
555
|
return fn.call(this, ...args);
|
|
556
556
|
});
|
|
@@ -602,14 +602,14 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
602
602
|
}
|
|
603
603
|
const startTime = performance.now();
|
|
604
604
|
const isRootSpan = options.startNewRoot || api.trace.getActiveSpan() === void 0;
|
|
605
|
-
const shouldAutoFlush = options.flushOnRootSpanEnd ??
|
|
606
|
-
const shouldAutoFlushSpans =
|
|
605
|
+
const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkBPO2PQ3T_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
|
|
606
|
+
const shouldAutoFlushSpans = chunkBPO2PQ3T_cjs.getConfig()?.forceFlushOnShutdown ?? false;
|
|
607
607
|
const flushIfNeeded = () => {
|
|
608
608
|
if (!shouldAutoFlush || !isRootSpan) return;
|
|
609
|
-
const queue =
|
|
609
|
+
const queue = chunkKKGM42RQ_cjs.getEventQueue();
|
|
610
610
|
if (queue && queue.size() > 0) {
|
|
611
611
|
void queue.flush().catch((error) => {
|
|
612
|
-
const initConfig =
|
|
612
|
+
const initConfig = chunkBPO2PQ3T_cjs.getConfig();
|
|
613
613
|
const logger = initConfig?.logger;
|
|
614
614
|
if (logger?.error) {
|
|
615
615
|
logger.error(
|
|
@@ -622,7 +622,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
622
622
|
});
|
|
623
623
|
}
|
|
624
624
|
if (shouldAutoFlushSpans) {
|
|
625
|
-
const sdk =
|
|
625
|
+
const sdk = chunkBPO2PQ3T_cjs.getSdk();
|
|
626
626
|
if (sdk) {
|
|
627
627
|
try {
|
|
628
628
|
const sdkAny = sdk;
|
|
@@ -630,7 +630,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
630
630
|
const tracerProvider = sdkAny.getTracerProvider();
|
|
631
631
|
if (tracerProvider && typeof tracerProvider.forceFlush === "function") {
|
|
632
632
|
void tracerProvider.forceFlush().catch((error) => {
|
|
633
|
-
const initConfig =
|
|
633
|
+
const initConfig = chunkBPO2PQ3T_cjs.getConfig();
|
|
634
634
|
const logger = initConfig?.logger;
|
|
635
635
|
if (logger?.error) {
|
|
636
636
|
logger.error(
|
|
@@ -655,7 +655,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
655
655
|
if (options.spanKind !== void 0) {
|
|
656
656
|
spanOptions.kind = options.spanKind;
|
|
657
657
|
}
|
|
658
|
-
const parentContext =
|
|
658
|
+
const parentContext = chunkKKGM42RQ_cjs.getActiveContextWithBaggage();
|
|
659
659
|
return tracer.startActiveSpan(
|
|
660
660
|
spanName,
|
|
661
661
|
spanOptions,
|
|
@@ -664,7 +664,7 @@ function wrapWithTracingSync(fnFactory, options, variableName) {
|
|
|
664
664
|
return chunkVQTCQKHQ_cjs.runInOperationContext(spanName, () => {
|
|
665
665
|
let shouldKeepSpan = true;
|
|
666
666
|
chunkNCSMD3TK_cjs.setSpanName(span2, spanName);
|
|
667
|
-
const ctxValue =
|
|
667
|
+
const ctxValue = chunkKKGM42RQ_cjs.createTraceContext(span2);
|
|
668
668
|
const fn = fnFactory(ctxValue);
|
|
669
669
|
const argsAttributes = options.attributesFromArgs ? options.attributesFromArgs(args) : {};
|
|
670
670
|
const handleTailSampling = (success, duration, error) => {
|
|
@@ -779,8 +779,8 @@ function executeImmediately(fn, options) {
|
|
|
779
779
|
}
|
|
780
780
|
const startTime = performance.now();
|
|
781
781
|
const isRootSpan = options.startNewRoot || api.trace.getActiveSpan() === void 0;
|
|
782
|
-
const shouldAutoFlush = options.flushOnRootSpanEnd ??
|
|
783
|
-
const shouldAutoFlushSpans =
|
|
782
|
+
const shouldAutoFlush = options.flushOnRootSpanEnd ?? chunkBPO2PQ3T_cjs.getConfig()?.flushOnRootSpanEnd ?? true;
|
|
783
|
+
const shouldAutoFlushSpans = chunkBPO2PQ3T_cjs.getConfig()?.forceFlushOnShutdown ?? false;
|
|
784
784
|
const callCounter = options.withMetrics ? meter.createCounter(`${spanName}.calls`, {
|
|
785
785
|
description: `Call count for ${spanName}`,
|
|
786
786
|
unit: "1"
|
|
@@ -792,12 +792,12 @@ function executeImmediately(fn, options) {
|
|
|
792
792
|
const flushIfNeeded = async () => {
|
|
793
793
|
if (!shouldAutoFlush || !isRootSpan) return;
|
|
794
794
|
try {
|
|
795
|
-
const queue =
|
|
795
|
+
const queue = chunkKKGM42RQ_cjs.getEventQueue();
|
|
796
796
|
if (queue && queue.size() > 0) {
|
|
797
797
|
await queue.flush();
|
|
798
798
|
}
|
|
799
799
|
if (shouldAutoFlushSpans) {
|
|
800
|
-
const sdk =
|
|
800
|
+
const sdk = chunkBPO2PQ3T_cjs.getSdk();
|
|
801
801
|
if (sdk) {
|
|
802
802
|
try {
|
|
803
803
|
const sdkAny = sdk;
|
|
@@ -812,7 +812,7 @@ function executeImmediately(fn, options) {
|
|
|
812
812
|
}
|
|
813
813
|
}
|
|
814
814
|
} catch (error) {
|
|
815
|
-
const initConfig =
|
|
815
|
+
const initConfig = chunkBPO2PQ3T_cjs.getConfig();
|
|
816
816
|
const logger = initConfig?.logger;
|
|
817
817
|
if (logger?.error) {
|
|
818
818
|
logger.error(
|
|
@@ -831,7 +831,7 @@ function executeImmediately(fn, options) {
|
|
|
831
831
|
if (options.spanKind !== void 0) {
|
|
832
832
|
spanOptions.kind = options.spanKind;
|
|
833
833
|
}
|
|
834
|
-
const parentContext =
|
|
834
|
+
const parentContext = chunkKKGM42RQ_cjs.getActiveContextWithBaggage();
|
|
835
835
|
return tracer.startActiveSpan(
|
|
836
836
|
spanName,
|
|
837
837
|
spanOptions,
|
|
@@ -840,7 +840,7 @@ function executeImmediately(fn, options) {
|
|
|
840
840
|
return chunkVQTCQKHQ_cjs.runInOperationContext(spanName, () => {
|
|
841
841
|
let shouldKeepSpan = true;
|
|
842
842
|
chunkNCSMD3TK_cjs.setSpanName(span2, spanName);
|
|
843
|
-
const ctxValue =
|
|
843
|
+
const ctxValue = chunkKKGM42RQ_cjs.createTraceContext(span2);
|
|
844
844
|
const handleTailSampling = (success, duration, error) => {
|
|
845
845
|
if (needsTailSampling && "shouldKeepTrace" in sampler && typeof sampler.shouldKeepTrace === "function") {
|
|
846
846
|
shouldKeepSpan = sampler.shouldKeepTrace(samplingContext, {
|
|
@@ -1121,7 +1121,7 @@ function span(options, fn) {
|
|
|
1121
1121
|
}
|
|
1122
1122
|
});
|
|
1123
1123
|
};
|
|
1124
|
-
const parentContext =
|
|
1124
|
+
const parentContext = chunkKKGM42RQ_cjs.getActiveContextWithBaggage();
|
|
1125
1125
|
const result = tracer.startActiveSpan(name, {}, parentContext, executeSpan);
|
|
1126
1126
|
if (result instanceof Promise) {
|
|
1127
1127
|
return result;
|
|
@@ -1156,7 +1156,7 @@ function withBaggage(options) {
|
|
|
1156
1156
|
updatedBaggage = updatedBaggage.setEntry(key, { value });
|
|
1157
1157
|
}
|
|
1158
1158
|
const newContext = api.propagation.setBaggage(currentContext, updatedBaggage);
|
|
1159
|
-
const ctxStorage =
|
|
1159
|
+
const ctxStorage = chunkKKGM42RQ_cjs.getContextStorage();
|
|
1160
1160
|
const previousStored = ctxStorage.getStore();
|
|
1161
1161
|
const baggageEnrichedStored = previousStored ? { value: api.propagation.setBaggage(previousStored.value, updatedBaggage) } : { value: newContext };
|
|
1162
1162
|
const result = previousStored ? ctxStorage.run(baggageEnrichedStored, () => api.context.with(newContext, fn)) : api.context.with(newContext, fn);
|
|
@@ -1188,5 +1188,5 @@ exports.trace = trace;
|
|
|
1188
1188
|
exports.withBaggage = withBaggage;
|
|
1189
1189
|
exports.withNewContext = withNewContext;
|
|
1190
1190
|
exports.withTracing = withTracing;
|
|
1191
|
-
//# sourceMappingURL=chunk-
|
|
1192
|
-
//# sourceMappingURL=chunk-
|
|
1191
|
+
//# sourceMappingURL=chunk-QPH5ZKP5.cjs.map
|
|
1192
|
+
//# sourceMappingURL=chunk-QPH5ZKP5.cjs.map
|