autotel 2.26.0 → 2.26.2
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/attribute-redacting-processor.cjs +14 -6
- package/dist/attribute-redacting-processor.d.cts +63 -1
- package/dist/attribute-redacting-processor.d.ts +63 -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 +8 -8
- package/dist/auto.js +6 -6
- package/dist/{chunk-RUD7KS4R.js → chunk-3SDILILG.js} +3 -3
- package/dist/{chunk-RUD7KS4R.js.map → chunk-3SDILILG.js.map} +1 -1
- package/dist/{chunk-B33XPEKY.js → chunk-55ER2KD5.js} +4 -4
- package/dist/chunk-55ER2KD5.js.map +1 -0
- package/dist/{chunk-UJJPTSEI.cjs → chunk-563EL6O6.cjs} +81 -14
- package/dist/chunk-563EL6O6.cjs.map +1 -0
- package/dist/{chunk-TS7IHIRW.cjs → chunk-6YGUN7IY.cjs} +5 -5
- package/dist/{chunk-TS7IHIRW.cjs.map → chunk-6YGUN7IY.cjs.map} +1 -1
- package/dist/{chunk-XDKK53OL.js → chunk-A4E5AQFK.js} +3 -3
- package/dist/{chunk-XDKK53OL.js.map → chunk-A4E5AQFK.js.map} +1 -1
- package/dist/{chunk-WAB4CHBU.js → chunk-BJ2XPN77.js} +3 -3
- package/dist/{chunk-WAB4CHBU.js.map → chunk-BJ2XPN77.js.map} +1 -1
- package/dist/{chunk-KZEC4CHV.cjs → chunk-CEAQK2QY.cjs} +5 -5
- package/dist/{chunk-KZEC4CHV.cjs.map → chunk-CEAQK2QY.cjs.map} +1 -1
- package/dist/chunk-CMNGGTQL.cjs +349 -0
- package/dist/chunk-CMNGGTQL.cjs.map +1 -0
- package/dist/{chunk-VYA6QDNA.js → chunk-DPSA4QLA.js} +4 -2
- package/dist/chunk-DPSA4QLA.js.map +1 -0
- package/dist/{chunk-M4US3P4K.js → chunk-ER43K7ES.js} +3 -3
- package/dist/{chunk-M4US3P4K.js.map → chunk-ER43K7ES.js.map} +1 -1
- package/dist/{chunk-AZ24DJAG.cjs → chunk-FU6R566Y.cjs} +4 -4
- package/dist/chunk-FU6R566Y.cjs.map +1 -0
- package/dist/{chunk-4PTCDOZY.js → chunk-HPUGKUMZ.js} +4 -4
- package/dist/{chunk-4PTCDOZY.js.map → chunk-HPUGKUMZ.js.map} +1 -1
- package/dist/{chunk-XRBP4RYL.cjs → chunk-JKIMEPI2.cjs} +4 -4
- package/dist/{chunk-XRBP4RYL.cjs.map → chunk-JKIMEPI2.cjs.map} +1 -1
- package/dist/{chunk-N344PVE5.cjs → chunk-OBWXM4NN.cjs} +9 -9
- package/dist/{chunk-N344PVE5.cjs.map → chunk-OBWXM4NN.cjs.map} +1 -1
- package/dist/{chunk-OFPZULMQ.cjs → chunk-OC6X2VIN.cjs} +8 -8
- package/dist/{chunk-OFPZULMQ.cjs.map → chunk-OC6X2VIN.cjs.map} +1 -1
- package/dist/{chunk-GTD3NXOS.js → chunk-QC5MNKVF.js} +4 -4
- package/dist/{chunk-GTD3NXOS.js.map → chunk-QC5MNKVF.js.map} +1 -1
- package/dist/chunk-TDNKIHKT.js +341 -0
- package/dist/chunk-TDNKIHKT.js.map +1 -0
- package/dist/{chunk-DGPUZ6TE.js → chunk-U54FTVFH.js} +3 -3
- package/dist/{chunk-DGPUZ6TE.js.map → chunk-U54FTVFH.js.map} +1 -1
- package/dist/{chunk-ZJ5GXCOT.cjs → chunk-UTZR7P7E.cjs} +36 -36
- package/dist/{chunk-ZJ5GXCOT.cjs.map → chunk-UTZR7P7E.cjs.map} +1 -1
- package/dist/{chunk-7FIGORWI.cjs → chunk-VH77IPJN.cjs} +4 -2
- package/dist/chunk-VH77IPJN.cjs.map +1 -0
- package/dist/{chunk-EXOXDI5A.js → chunk-W35FVJBC.js} +73 -8
- package/dist/chunk-W35FVJBC.js.map +1 -0
- package/dist/{chunk-II7GFVAF.cjs → chunk-WZOKY3PW.cjs} +13 -13
- package/dist/{chunk-II7GFVAF.cjs.map → chunk-WZOKY3PW.cjs.map} +1 -1
- package/dist/{chunk-CMADDTHY.cjs → chunk-YEVCD6DR.cjs} +7 -7
- package/dist/{chunk-CMADDTHY.cjs.map → chunk-YEVCD6DR.cjs.map} +1 -1
- package/dist/{chunk-RXFZKLRQ.js → chunk-YN7USLHW.js} +3 -3
- package/dist/{chunk-RXFZKLRQ.js.map → chunk-YN7USLHW.js.map} +1 -1
- package/dist/decorators.cjs +7 -7
- package/dist/decorators.js +7 -7
- package/dist/event.cjs +10 -10
- package/dist/event.js +7 -7
- package/dist/functional.cjs +14 -14
- package/dist/functional.js +7 -7
- package/dist/index.cjs +340 -97
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +205 -3
- package/dist/index.d.ts +205 -3
- package/dist/index.js +257 -33
- package/dist/index.js.map +1 -1
- package/dist/{init-QSj7X6zU.d.cts → init-CMuTaFAV.d.cts} +26 -1
- package/dist/{init-FiR_glVc.d.ts → init-D6JfWEjL.d.ts} +26 -1
- package/dist/instrumentation.cjs +14 -14
- package/dist/instrumentation.js +6 -6
- package/dist/logger.cjs +8 -8
- package/dist/logger.js +1 -1
- package/dist/messaging.cjs +11 -11
- package/dist/messaging.js +8 -8
- package/dist/metric.cjs +1 -1
- package/dist/metric.js +1 -1
- package/dist/sampling.cjs +15 -15
- package/dist/sampling.js +2 -2
- package/dist/semantic-helpers.cjs +12 -12
- package/dist/semantic-helpers.js +8 -8
- package/dist/tail-sampling-processor.cjs +4 -4
- package/dist/tail-sampling-processor.js +3 -3
- package/dist/testing.cjs +1 -1
- package/dist/testing.js +1 -1
- package/dist/webhook.cjs +9 -8
- package/dist/webhook.cjs.map +1 -1
- package/dist/webhook.js +8 -7
- package/dist/webhook.js.map +1 -1
- package/dist/workflow-distributed.cjs +9 -9
- package/dist/workflow-distributed.js +7 -7
- package/dist/workflow.cjs +12 -12
- package/dist/workflow.js +8 -8
- package/dist/yaml-config.cjs +6 -6
- package/dist/yaml-config.d.cts +1 -1
- package/dist/yaml-config.d.ts +1 -1
- package/dist/yaml-config.js +3 -3
- package/package.json +1 -1
- package/src/attribute-redacting-processor.test.ts +81 -16
- package/src/attribute-redacting-processor.ts +278 -24
- package/src/autotel-logger.ts +2 -2
- package/src/gen-ai-events.test.ts +135 -0
- package/src/gen-ai-events.ts +199 -0
- package/src/gen-ai-metrics.test.ts +96 -0
- package/src/gen-ai-metrics.ts +128 -0
- package/src/index.ts +28 -1
- package/src/init.ts +117 -2
- package/src/request-logger.test.ts +266 -1
- package/src/request-logger.ts +115 -16
- package/src/structured-error.ts +54 -1
- package/dist/chunk-7FIGORWI.cjs.map +0 -1
- package/dist/chunk-AZ24DJAG.cjs.map +0 -1
- package/dist/chunk-B33XPEKY.js.map +0 -1
- package/dist/chunk-ELW34S4C.cjs +0 -173
- package/dist/chunk-ELW34S4C.cjs.map +0 -1
- package/dist/chunk-EXOXDI5A.js.map +0 -1
- package/dist/chunk-SNINLBEE.js +0 -167
- package/dist/chunk-SNINLBEE.js.map +0 -1
- package/dist/chunk-UJJPTSEI.cjs.map +0 -1
- package/dist/chunk-VYA6QDNA.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunk7EQ4G4SI_cjs = require('./chunk-7EQ4G4SI.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunk6YGUN7IY_cjs = require('./chunk-6YGUN7IY.cjs');
|
|
5
|
+
var chunkJKIMEPI2_cjs = require('./chunk-JKIMEPI2.cjs');
|
|
6
6
|
var chunk2ZKEORFN_cjs = require('./chunk-2ZKEORFN.cjs');
|
|
7
7
|
var chunkESMHTKLJ_cjs = require('./chunk-ESMHTKLJ.cjs');
|
|
8
8
|
var chunkT4B5LB6E_cjs = require('./chunk-T4B5LB6E.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunkOBWXM4NN_cjs = require('./chunk-OBWXM4NN.cjs');
|
|
10
10
|
var chunkINJD3G4K_cjs = require('./chunk-INJD3G4K.cjs');
|
|
11
11
|
var chunkTC5ZPWM4_cjs = require('./chunk-TC5ZPWM4.cjs');
|
|
12
12
|
require('./chunk-YTXEZ4SD.cjs');
|
|
13
13
|
var chunkWJH6IYU2_cjs = require('./chunk-WJH6IYU2.cjs');
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var chunkYEVCD6DR_cjs = require('./chunk-YEVCD6DR.cjs');
|
|
15
|
+
var chunkUTZR7P7E_cjs = require('./chunk-UTZR7P7E.cjs');
|
|
16
16
|
var chunkGML3FBOT_cjs = require('./chunk-GML3FBOT.cjs');
|
|
17
|
-
var
|
|
17
|
+
var chunkWZOKY3PW_cjs = require('./chunk-WZOKY3PW.cjs');
|
|
18
18
|
require('./chunk-NZ72VDNY.cjs');
|
|
19
19
|
require('./chunk-UY3UYPBZ.cjs');
|
|
20
20
|
var chunkD5LMF53P_cjs = require('./chunk-D5LMF53P.cjs');
|
|
21
21
|
var chunkJSNUWSBH_cjs = require('./chunk-JSNUWSBH.cjs');
|
|
22
22
|
var chunkHZ3FYBJG_cjs = require('./chunk-HZ3FYBJG.cjs');
|
|
23
|
-
var
|
|
24
|
-
require('./chunk-
|
|
25
|
-
require('./chunk-
|
|
23
|
+
var chunk563EL6O6_cjs = require('./chunk-563EL6O6.cjs');
|
|
24
|
+
require('./chunk-OC6X2VIN.cjs');
|
|
25
|
+
require('./chunk-CEAQK2QY.cjs');
|
|
26
26
|
var chunkZNMBW67B_cjs = require('./chunk-ZNMBW67B.cjs');
|
|
27
27
|
var chunkIOYFAFHJ_cjs = require('./chunk-IOYFAFHJ.cjs');
|
|
28
|
-
var
|
|
28
|
+
var chunkCMNGGTQL_cjs = require('./chunk-CMNGGTQL.cjs');
|
|
29
29
|
require('./chunk-CU6IDACR.cjs');
|
|
30
30
|
var chunk6S5RUKU3_cjs = require('./chunk-6S5RUKU3.cjs');
|
|
31
31
|
require('./chunk-YS6C2YJE.cjs');
|
|
32
|
-
var
|
|
33
|
-
require('./chunk-
|
|
32
|
+
var chunkVH77IPJN_cjs = require('./chunk-VH77IPJN.cjs');
|
|
33
|
+
require('./chunk-FU6R566Y.cjs');
|
|
34
34
|
require('./chunk-ESLWRGAG.cjs');
|
|
35
35
|
var chunkYREV3LGG_cjs = require('./chunk-YREV3LGG.cjs');
|
|
36
36
|
require('./chunk-JEQ2X3Z6.cjs');
|
|
37
37
|
var async_hooks = require('async_hooks');
|
|
38
38
|
var api = require('@opentelemetry/api');
|
|
39
|
+
var sdkMetrics = require('@opentelemetry/sdk-metrics');
|
|
39
40
|
|
|
40
41
|
// src/shutdown.ts
|
|
41
42
|
async function flush(options) {
|
|
42
43
|
const timeout = options?.timeout ?? 2e3;
|
|
43
44
|
const forShutdown = options?.forShutdown ?? false;
|
|
44
45
|
const doFlush = async () => {
|
|
45
|
-
const eventsQueue =
|
|
46
|
+
const eventsQueue = chunkUTZR7P7E_cjs.getEventQueue();
|
|
46
47
|
if (eventsQueue) {
|
|
47
48
|
if (forShutdown) {
|
|
48
49
|
await eventsQueue.shutdown();
|
|
@@ -50,7 +51,7 @@ async function flush(options) {
|
|
|
50
51
|
await eventsQueue.flush();
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
|
-
const sdk =
|
|
54
|
+
const sdk = chunk563EL6O6_cjs.getSdk();
|
|
54
55
|
if (sdk) {
|
|
55
56
|
try {
|
|
56
57
|
const sdkAny = sdk;
|
|
@@ -84,7 +85,7 @@ async function flush(options) {
|
|
|
84
85
|
if (timeoutHandle) {
|
|
85
86
|
clearTimeout(timeoutHandle);
|
|
86
87
|
}
|
|
87
|
-
const logger =
|
|
88
|
+
const logger = chunk563EL6O6_cjs.getLogger();
|
|
88
89
|
logger.error(
|
|
89
90
|
{
|
|
90
91
|
err: error instanceof Error ? error : new Error(String(error))
|
|
@@ -95,7 +96,7 @@ async function flush(options) {
|
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
async function shutdown() {
|
|
98
|
-
const logger =
|
|
99
|
+
const logger = chunk563EL6O6_cjs.getLogger();
|
|
99
100
|
let shutdownError = null;
|
|
100
101
|
try {
|
|
101
102
|
await flush({ forShutdown: true });
|
|
@@ -110,7 +111,7 @@ async function shutdown() {
|
|
|
110
111
|
);
|
|
111
112
|
}
|
|
112
113
|
try {
|
|
113
|
-
const sdk =
|
|
114
|
+
const sdk = chunk563EL6O6_cjs.getSdk();
|
|
114
115
|
if (sdk) {
|
|
115
116
|
await sdk.shutdown();
|
|
116
117
|
}
|
|
@@ -124,14 +125,14 @@ async function shutdown() {
|
|
|
124
125
|
logger.error({ err }, "[autotel] SDK shutdown failed");
|
|
125
126
|
}
|
|
126
127
|
} finally {
|
|
127
|
-
await
|
|
128
|
-
const eventsQueue =
|
|
128
|
+
await chunk563EL6O6_cjs._closeEmbeddedDevtools();
|
|
129
|
+
const eventsQueue = chunkUTZR7P7E_cjs.getEventQueue();
|
|
129
130
|
if (eventsQueue && typeof eventsQueue.cleanup === "function") {
|
|
130
131
|
eventsQueue.cleanup();
|
|
131
132
|
}
|
|
132
|
-
|
|
133
|
+
chunkWZOKY3PW_cjs.resetEvents();
|
|
133
134
|
chunkTC5ZPWM4_cjs.resetMetrics();
|
|
134
|
-
|
|
135
|
+
chunkUTZR7P7E_cjs.resetEventQueue();
|
|
135
136
|
}
|
|
136
137
|
if (shutdownError) {
|
|
137
138
|
throw shutdownError;
|
|
@@ -146,7 +147,7 @@ function registerShutdownHooks() {
|
|
|
146
147
|
if (shuttingDown) return;
|
|
147
148
|
shuttingDown = true;
|
|
148
149
|
if (process.env.NODE_ENV !== "test") {
|
|
149
|
-
|
|
150
|
+
chunk563EL6O6_cjs.getLogger().info(
|
|
150
151
|
{},
|
|
151
152
|
`[autotel] Received ${signal}, flushing telemetry...`
|
|
152
153
|
);
|
|
@@ -154,7 +155,7 @@ function registerShutdownHooks() {
|
|
|
154
155
|
try {
|
|
155
156
|
await shutdown();
|
|
156
157
|
} catch (error) {
|
|
157
|
-
|
|
158
|
+
chunk563EL6O6_cjs.getLogger().error(
|
|
158
159
|
{
|
|
159
160
|
err: error instanceof Error ? error : void 0
|
|
160
161
|
},
|
|
@@ -224,6 +225,7 @@ function flattenToAttributes(fields, prefix = "") {
|
|
|
224
225
|
}
|
|
225
226
|
|
|
226
227
|
// src/structured-error.ts
|
|
228
|
+
var internalKey = /* @__PURE__ */ Symbol.for("autotel.error.internal");
|
|
227
229
|
function createStructuredError(input) {
|
|
228
230
|
const error = new Error(input.message, {
|
|
229
231
|
cause: input.cause
|
|
@@ -235,6 +237,21 @@ function createStructuredError(input) {
|
|
|
235
237
|
if (input.code !== void 0) error.code = input.code;
|
|
236
238
|
if (input.status !== void 0) error.status = input.status;
|
|
237
239
|
if (input.details !== void 0) error.details = input.details;
|
|
240
|
+
if (input.internal !== void 0) {
|
|
241
|
+
Object.defineProperty(error, internalKey, {
|
|
242
|
+
value: input.internal,
|
|
243
|
+
enumerable: false,
|
|
244
|
+
writable: false,
|
|
245
|
+
configurable: true
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
Object.defineProperty(error, "internal", {
|
|
249
|
+
get() {
|
|
250
|
+
return this[internalKey];
|
|
251
|
+
},
|
|
252
|
+
enumerable: false,
|
|
253
|
+
configurable: true
|
|
254
|
+
});
|
|
238
255
|
error.toString = () => {
|
|
239
256
|
const lines = [`${error.name}: ${error.message}`];
|
|
240
257
|
if (error.why) lines.push(` Why: ${error.why}`);
|
|
@@ -242,11 +259,34 @@ function createStructuredError(input) {
|
|
|
242
259
|
if (error.link) lines.push(` Link: ${error.link}`);
|
|
243
260
|
if (error.code !== void 0) lines.push(` Code: ${error.code}`);
|
|
244
261
|
if (error.status !== void 0) lines.push(` Status: ${error.status}`);
|
|
245
|
-
if (error.cause)
|
|
262
|
+
if (error.cause) {
|
|
263
|
+
const cause = error.cause;
|
|
264
|
+
lines.push(` Caused by: ${cause.name}: ${cause.message}`);
|
|
265
|
+
}
|
|
246
266
|
return lines.join("\n");
|
|
247
267
|
};
|
|
248
268
|
return error;
|
|
249
269
|
}
|
|
270
|
+
function structuredErrorToJSON(error) {
|
|
271
|
+
const result = {
|
|
272
|
+
name: error.name,
|
|
273
|
+
message: error.message
|
|
274
|
+
};
|
|
275
|
+
if (error.status !== void 0) result.status = error.status;
|
|
276
|
+
if (error.why || error.fix || error.link) {
|
|
277
|
+
result.data = {
|
|
278
|
+
...error.why && { why: error.why },
|
|
279
|
+
...error.fix && { fix: error.fix },
|
|
280
|
+
...error.link && { link: error.link }
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
if (error.code !== void 0) result.code = error.code;
|
|
284
|
+
if (error.details) result.details = error.details;
|
|
285
|
+
if (error.cause instanceof Error) {
|
|
286
|
+
result.cause = { name: error.cause.name, message: error.cause.message };
|
|
287
|
+
}
|
|
288
|
+
return result;
|
|
289
|
+
}
|
|
250
290
|
function getStructuredErrorAttributes(error) {
|
|
251
291
|
const structured = error;
|
|
252
292
|
const attributes = {
|
|
@@ -281,6 +321,29 @@ function recordStructuredError(ctx2, error) {
|
|
|
281
321
|
}
|
|
282
322
|
|
|
283
323
|
// src/request-logger.ts
|
|
324
|
+
var POST_EMIT_FORK_HINT = "For intentional background work tied to this request, use log.fork('label', fn) when available.";
|
|
325
|
+
function warnPostEmit(method, detail) {
|
|
326
|
+
console.warn(
|
|
327
|
+
`[autotel] ${method} called after the wide event was emitted \u2014 ${detail} This data will not appear in observability. ${POST_EMIT_FORK_HINT}`
|
|
328
|
+
);
|
|
329
|
+
}
|
|
330
|
+
function mergeInto(target, source) {
|
|
331
|
+
for (const key in source) {
|
|
332
|
+
const sourceVal = source[key];
|
|
333
|
+
if (sourceVal === void 0) continue;
|
|
334
|
+
const targetVal = target[key];
|
|
335
|
+
if (sourceVal !== null && typeof sourceVal === "object" && !Array.isArray(sourceVal) && targetVal !== null && typeof targetVal === "object" && !Array.isArray(targetVal)) {
|
|
336
|
+
mergeInto(
|
|
337
|
+
targetVal,
|
|
338
|
+
sourceVal
|
|
339
|
+
);
|
|
340
|
+
} else if (Array.isArray(targetVal) && Array.isArray(sourceVal)) {
|
|
341
|
+
target[key] = [...targetVal, ...sourceVal];
|
|
342
|
+
} else {
|
|
343
|
+
target[key] = sourceVal;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
284
347
|
var requestContextStore = new async_hooks.AsyncLocalStorage();
|
|
285
348
|
function runWithRequestContext(ctx2, fn) {
|
|
286
349
|
return requestContextStore.run(ctx2, fn);
|
|
@@ -300,6 +363,8 @@ function resolveContext(ctx2) {
|
|
|
300
363
|
function getRequestLogger(ctx2, options) {
|
|
301
364
|
const activeContext = resolveContext(ctx2);
|
|
302
365
|
let contextState = {};
|
|
366
|
+
let emitted = false;
|
|
367
|
+
let lastSnapshot = null;
|
|
303
368
|
const addLogEvent = (level, message, fields) => {
|
|
304
369
|
const attrs2 = fields ? flattenToAttributes(fields) : void 0;
|
|
305
370
|
activeContext.addEvent(`log.${level}`, {
|
|
@@ -307,44 +372,51 @@ function getRequestLogger(ctx2, options) {
|
|
|
307
372
|
...attrs2
|
|
308
373
|
});
|
|
309
374
|
};
|
|
375
|
+
const sealCheck = (method, keys) => {
|
|
376
|
+
if (emitted) {
|
|
377
|
+
warnPostEmit(
|
|
378
|
+
method,
|
|
379
|
+
`Keys dropped: ${keys.length ? keys.join(", ") : "(empty)"}.`
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
};
|
|
310
383
|
return {
|
|
311
384
|
set(fields) {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
};
|
|
385
|
+
sealCheck("log.set()", Object.keys(fields));
|
|
386
|
+
if (emitted) return;
|
|
387
|
+
mergeInto(contextState, fields);
|
|
316
388
|
activeContext.setAttributes(flattenToAttributes(fields));
|
|
317
389
|
},
|
|
318
390
|
info(message, fields) {
|
|
391
|
+
const keys = fields ? ["message", ...Object.keys(fields).filter((k) => k !== "requestLogs")] : ["message"];
|
|
392
|
+
sealCheck("log.info()", keys);
|
|
393
|
+
if (emitted) return;
|
|
319
394
|
addLogEvent("info", message, fields);
|
|
320
395
|
if (fields) {
|
|
321
|
-
contextState
|
|
322
|
-
...contextState,
|
|
323
|
-
...fields
|
|
324
|
-
};
|
|
396
|
+
mergeInto(contextState, fields);
|
|
325
397
|
activeContext.setAttributes(flattenToAttributes(fields));
|
|
326
398
|
}
|
|
327
399
|
},
|
|
328
400
|
warn(message, fields) {
|
|
401
|
+
const keys = fields ? ["message", ...Object.keys(fields).filter((k) => k !== "requestLogs")] : ["message"];
|
|
402
|
+
sealCheck("log.warn()", keys);
|
|
403
|
+
if (emitted) return;
|
|
329
404
|
addLogEvent("warn", message, fields);
|
|
330
405
|
activeContext.setAttribute("autotel.log.level", "warn");
|
|
331
406
|
if (fields) {
|
|
332
|
-
contextState
|
|
333
|
-
...contextState,
|
|
334
|
-
...fields
|
|
335
|
-
};
|
|
407
|
+
mergeInto(contextState, fields);
|
|
336
408
|
activeContext.setAttributes(flattenToAttributes(fields));
|
|
337
409
|
}
|
|
338
410
|
},
|
|
339
411
|
error(error, fields) {
|
|
412
|
+
const keys = fields ? [...Object.keys(fields), "error"] : ["error"];
|
|
413
|
+
sealCheck("log.error()", keys);
|
|
414
|
+
if (emitted) return;
|
|
340
415
|
const err = typeof error === "string" ? new Error(error) : error;
|
|
341
416
|
recordStructuredError(activeContext, err);
|
|
342
417
|
addLogEvent("error", err.message, fields);
|
|
343
418
|
if (fields) {
|
|
344
|
-
contextState
|
|
345
|
-
...contextState,
|
|
346
|
-
...fields
|
|
347
|
-
};
|
|
419
|
+
mergeInto(contextState, fields);
|
|
348
420
|
activeContext.setAttributes(flattenToAttributes(fields));
|
|
349
421
|
}
|
|
350
422
|
activeContext.setAttribute("autotel.log.level", "error");
|
|
@@ -353,6 +425,10 @@ function getRequestLogger(ctx2, options) {
|
|
|
353
425
|
return { ...contextState };
|
|
354
426
|
},
|
|
355
427
|
emitNow(overrides) {
|
|
428
|
+
if (emitted) {
|
|
429
|
+
warnPostEmit("log.emitNow()", "Ignoring duplicate emit.");
|
|
430
|
+
return lastSnapshot;
|
|
431
|
+
}
|
|
356
432
|
const mergedContext = {
|
|
357
433
|
...contextState,
|
|
358
434
|
...overrides ?? {}
|
|
@@ -374,10 +450,158 @@ function getRequestLogger(ctx2, options) {
|
|
|
374
450
|
console.warn("[autotel] request logger onEmit failed:", error);
|
|
375
451
|
});
|
|
376
452
|
}
|
|
453
|
+
emitted = true;
|
|
454
|
+
lastSnapshot = snapshot;
|
|
377
455
|
return snapshot;
|
|
456
|
+
},
|
|
457
|
+
fork(label, fn) {
|
|
458
|
+
const parentRequestId = activeContext.correlationId;
|
|
459
|
+
if (typeof parentRequestId !== "string" || parentRequestId.length === 0) {
|
|
460
|
+
throw new Error(
|
|
461
|
+
"[autotel] log.fork() requires the parent logger to have a correlationId. Ensure the request was created by autotel middleware."
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
const tracer = api.trace.getTracer("autotel.request-logger");
|
|
465
|
+
void tracer.startActiveSpan(`request.fork:${label}`, (childSpan) => {
|
|
466
|
+
const childContext = {
|
|
467
|
+
...chunkHZ3FYBJG_cjs.createTraceContext(childSpan),
|
|
468
|
+
correlationId: crypto.randomUUID()
|
|
469
|
+
};
|
|
470
|
+
requestContextStore.run(childContext, () => {
|
|
471
|
+
const childLog = getRequestLogger(childContext);
|
|
472
|
+
childLog.set({
|
|
473
|
+
operation: label,
|
|
474
|
+
_parentCorrelationId: parentRequestId
|
|
475
|
+
});
|
|
476
|
+
void Promise.resolve().then(() => fn()).then(() => {
|
|
477
|
+
childLog.emitNow();
|
|
478
|
+
}).catch((err) => {
|
|
479
|
+
const error = err instanceof Error ? err : new Error(String(err));
|
|
480
|
+
childLog.error(error);
|
|
481
|
+
childLog.emitNow();
|
|
482
|
+
}).finally(() => {
|
|
483
|
+
childSpan.end();
|
|
484
|
+
});
|
|
485
|
+
});
|
|
486
|
+
});
|
|
378
487
|
}
|
|
379
488
|
};
|
|
380
489
|
}
|
|
490
|
+
var GEN_AI_DURATION_BUCKETS_SECONDS = Object.freeze(
|
|
491
|
+
[0.01, 0.05, 0.1, 0.25, 0.5, 1, 2, 5, 10, 20, 30, 60, 120, 300]
|
|
492
|
+
);
|
|
493
|
+
var GEN_AI_TOKEN_USAGE_BUCKETS = Object.freeze([
|
|
494
|
+
1,
|
|
495
|
+
4,
|
|
496
|
+
16,
|
|
497
|
+
64,
|
|
498
|
+
256,
|
|
499
|
+
1024,
|
|
500
|
+
4096,
|
|
501
|
+
16384,
|
|
502
|
+
65536,
|
|
503
|
+
262144,
|
|
504
|
+
1048576,
|
|
505
|
+
4194304
|
|
506
|
+
]);
|
|
507
|
+
var GEN_AI_COST_USD_BUCKETS = Object.freeze([
|
|
508
|
+
1e-5,
|
|
509
|
+
1e-4,
|
|
510
|
+
1e-3,
|
|
511
|
+
5e-3,
|
|
512
|
+
0.01,
|
|
513
|
+
0.05,
|
|
514
|
+
0.1,
|
|
515
|
+
0.5,
|
|
516
|
+
1,
|
|
517
|
+
5,
|
|
518
|
+
10,
|
|
519
|
+
50
|
|
520
|
+
]);
|
|
521
|
+
function llmHistogramAdvice(kind) {
|
|
522
|
+
const boundaries = kind === "duration" ? GEN_AI_DURATION_BUCKETS_SECONDS : kind === "tokens" ? GEN_AI_TOKEN_USAGE_BUCKETS : GEN_AI_COST_USD_BUCKETS;
|
|
523
|
+
return { advice: { explicitBucketBoundaries: [...boundaries] } };
|
|
524
|
+
}
|
|
525
|
+
function genAiMetricViews(extra = []) {
|
|
526
|
+
const defaults = [
|
|
527
|
+
{ instrumentName: "gen_ai.client.operation.duration", kind: "duration" },
|
|
528
|
+
{ instrumentName: "gen_ai.client.token.usage", kind: "tokens" },
|
|
529
|
+
// Autotel-emitted cost metric. No-op if you don't emit it.
|
|
530
|
+
{ instrumentName: "gen_ai.client.cost.usd", kind: "cost" }
|
|
531
|
+
];
|
|
532
|
+
return [...defaults, ...extra].map(
|
|
533
|
+
({ instrumentName, kind }) => ({
|
|
534
|
+
instrumentName,
|
|
535
|
+
aggregation: {
|
|
536
|
+
type: sdkMetrics.AggregationType.EXPLICIT_BUCKET_HISTOGRAM,
|
|
537
|
+
options: {
|
|
538
|
+
boundaries: kind === "duration" ? [...GEN_AI_DURATION_BUCKETS_SECONDS] : kind === "tokens" ? [...GEN_AI_TOKEN_USAGE_BUCKETS] : [...GEN_AI_COST_USD_BUCKETS]
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
})
|
|
542
|
+
);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
// src/gen-ai-events.ts
|
|
546
|
+
function recordPromptSent(ctx2, event = {}) {
|
|
547
|
+
ctx2.addEvent("gen_ai.prompt.sent", buildPromptSentAttrs(event));
|
|
548
|
+
}
|
|
549
|
+
function recordResponseReceived(ctx2, event = {}) {
|
|
550
|
+
ctx2.addEvent("gen_ai.response.received", buildResponseAttrs(event));
|
|
551
|
+
}
|
|
552
|
+
function recordRetry(ctx2, event) {
|
|
553
|
+
ctx2.addEvent("gen_ai.retry", buildRetryAttrs(event));
|
|
554
|
+
}
|
|
555
|
+
function recordToolCall(ctx2, event) {
|
|
556
|
+
ctx2.addEvent("gen_ai.tool.call", buildToolCallAttrs(event));
|
|
557
|
+
}
|
|
558
|
+
function recordStreamFirstToken(ctx2, event = {}) {
|
|
559
|
+
ctx2.addEvent("gen_ai.stream.first_token", buildStreamFirstTokenAttrs(event));
|
|
560
|
+
}
|
|
561
|
+
function buildPromptSentAttrs(event) {
|
|
562
|
+
const attrs2 = {};
|
|
563
|
+
if (event.model) attrs2["gen_ai.request.model"] = event.model;
|
|
564
|
+
if (event.promptTokens !== void 0)
|
|
565
|
+
attrs2["gen_ai.usage.input_tokens"] = event.promptTokens;
|
|
566
|
+
if (event.messageCount !== void 0)
|
|
567
|
+
attrs2["gen_ai.request.message_count"] = event.messageCount;
|
|
568
|
+
if (event.operation) attrs2["gen_ai.operation.name"] = event.operation;
|
|
569
|
+
return attrs2;
|
|
570
|
+
}
|
|
571
|
+
function buildResponseAttrs(event) {
|
|
572
|
+
const attrs2 = {};
|
|
573
|
+
if (event.model) attrs2["gen_ai.response.model"] = event.model;
|
|
574
|
+
if (event.promptTokens !== void 0)
|
|
575
|
+
attrs2["gen_ai.usage.input_tokens"] = event.promptTokens;
|
|
576
|
+
if (event.completionTokens !== void 0)
|
|
577
|
+
attrs2["gen_ai.usage.output_tokens"] = event.completionTokens;
|
|
578
|
+
if (event.totalTokens !== void 0)
|
|
579
|
+
attrs2["gen_ai.usage.total_tokens"] = event.totalTokens;
|
|
580
|
+
if (event.finishReasons && event.finishReasons.length > 0) {
|
|
581
|
+
attrs2["gen_ai.response.finish_reasons"] = event.finishReasons.join(",");
|
|
582
|
+
}
|
|
583
|
+
return attrs2;
|
|
584
|
+
}
|
|
585
|
+
function buildRetryAttrs(event) {
|
|
586
|
+
const attrs2 = { "retry.attempt": event.attempt };
|
|
587
|
+
if (event.reason) attrs2["retry.reason"] = event.reason;
|
|
588
|
+
if (event.delayMs !== void 0) attrs2["retry.delay_ms"] = event.delayMs;
|
|
589
|
+
if (event.statusCode !== void 0)
|
|
590
|
+
attrs2["http.response.status_code"] = event.statusCode;
|
|
591
|
+
return attrs2;
|
|
592
|
+
}
|
|
593
|
+
function buildToolCallAttrs(event) {
|
|
594
|
+
const attrs2 = { "gen_ai.tool.name": event.toolName };
|
|
595
|
+
if (event.toolCallId) attrs2["gen_ai.tool.call.id"] = event.toolCallId;
|
|
596
|
+
if (event.arguments) attrs2["gen_ai.tool.arguments"] = event.arguments;
|
|
597
|
+
return attrs2;
|
|
598
|
+
}
|
|
599
|
+
function buildStreamFirstTokenAttrs(event) {
|
|
600
|
+
const attrs2 = {};
|
|
601
|
+
if (event.tokensSoFar !== void 0)
|
|
602
|
+
attrs2["gen_ai.stream.tokens_so_far"] = event.tokensSoFar;
|
|
603
|
+
return attrs2;
|
|
604
|
+
}
|
|
381
605
|
|
|
382
606
|
Object.defineProperty(exports, "createDrainPipeline", {
|
|
383
607
|
enumerable: true,
|
|
@@ -385,83 +609,83 @@ Object.defineProperty(exports, "createDrainPipeline", {
|
|
|
385
609
|
});
|
|
386
610
|
Object.defineProperty(exports, "getCurrentWorkflowContext", {
|
|
387
611
|
enumerable: true,
|
|
388
|
-
get: function () { return
|
|
612
|
+
get: function () { return chunk6YGUN7IY_cjs.getCurrentWorkflowContext; }
|
|
389
613
|
});
|
|
390
614
|
Object.defineProperty(exports, "isInWorkflow", {
|
|
391
615
|
enumerable: true,
|
|
392
|
-
get: function () { return
|
|
616
|
+
get: function () { return chunk6YGUN7IY_cjs.isInWorkflow; }
|
|
393
617
|
});
|
|
394
618
|
Object.defineProperty(exports, "traceStep", {
|
|
395
619
|
enumerable: true,
|
|
396
|
-
get: function () { return
|
|
620
|
+
get: function () { return chunk6YGUN7IY_cjs.traceStep; }
|
|
397
621
|
});
|
|
398
622
|
Object.defineProperty(exports, "traceWorkflow", {
|
|
399
623
|
enumerable: true,
|
|
400
|
-
get: function () { return
|
|
624
|
+
get: function () { return chunk6YGUN7IY_cjs.traceWorkflow; }
|
|
401
625
|
});
|
|
402
626
|
Object.defineProperty(exports, "attrs", {
|
|
403
627
|
enumerable: true,
|
|
404
|
-
get: function () { return
|
|
628
|
+
get: function () { return chunkJKIMEPI2_cjs.attrs; }
|
|
405
629
|
});
|
|
406
630
|
Object.defineProperty(exports, "autoRedactPII", {
|
|
407
631
|
enumerable: true,
|
|
408
|
-
get: function () { return
|
|
632
|
+
get: function () { return chunkJKIMEPI2_cjs.autoRedactPII; }
|
|
409
633
|
});
|
|
410
634
|
Object.defineProperty(exports, "dbClient", {
|
|
411
635
|
enumerable: true,
|
|
412
|
-
get: function () { return
|
|
636
|
+
get: function () { return chunkJKIMEPI2_cjs.dbClient; }
|
|
413
637
|
});
|
|
414
638
|
Object.defineProperty(exports, "httpClient", {
|
|
415
639
|
enumerable: true,
|
|
416
|
-
get: function () { return
|
|
640
|
+
get: function () { return chunkJKIMEPI2_cjs.httpClient; }
|
|
417
641
|
});
|
|
418
642
|
Object.defineProperty(exports, "httpServer", {
|
|
419
643
|
enumerable: true,
|
|
420
|
-
get: function () { return
|
|
644
|
+
get: function () { return chunkJKIMEPI2_cjs.httpServer; }
|
|
421
645
|
});
|
|
422
646
|
Object.defineProperty(exports, "identify", {
|
|
423
647
|
enumerable: true,
|
|
424
|
-
get: function () { return
|
|
648
|
+
get: function () { return chunkJKIMEPI2_cjs.identify; }
|
|
425
649
|
});
|
|
426
650
|
Object.defineProperty(exports, "mergeAttrs", {
|
|
427
651
|
enumerable: true,
|
|
428
|
-
get: function () { return
|
|
652
|
+
get: function () { return chunkJKIMEPI2_cjs.mergeAttrs; }
|
|
429
653
|
});
|
|
430
654
|
Object.defineProperty(exports, "mergeServiceResource", {
|
|
431
655
|
enumerable: true,
|
|
432
|
-
get: function () { return
|
|
656
|
+
get: function () { return chunkJKIMEPI2_cjs.mergeServiceResource; }
|
|
433
657
|
});
|
|
434
658
|
Object.defineProperty(exports, "request", {
|
|
435
659
|
enumerable: true,
|
|
436
|
-
get: function () { return
|
|
660
|
+
get: function () { return chunkJKIMEPI2_cjs.request; }
|
|
437
661
|
});
|
|
438
662
|
Object.defineProperty(exports, "safeSetAttributes", {
|
|
439
663
|
enumerable: true,
|
|
440
|
-
get: function () { return
|
|
664
|
+
get: function () { return chunkJKIMEPI2_cjs.safeSetAttributes; }
|
|
441
665
|
});
|
|
442
666
|
Object.defineProperty(exports, "setDevice", {
|
|
443
667
|
enumerable: true,
|
|
444
|
-
get: function () { return
|
|
668
|
+
get: function () { return chunkJKIMEPI2_cjs.setDevice; }
|
|
445
669
|
});
|
|
446
670
|
Object.defineProperty(exports, "setError", {
|
|
447
671
|
enumerable: true,
|
|
448
|
-
get: function () { return
|
|
672
|
+
get: function () { return chunkJKIMEPI2_cjs.setError; }
|
|
449
673
|
});
|
|
450
674
|
Object.defineProperty(exports, "setException", {
|
|
451
675
|
enumerable: true,
|
|
452
|
-
get: function () { return
|
|
676
|
+
get: function () { return chunkJKIMEPI2_cjs.setException; }
|
|
453
677
|
});
|
|
454
678
|
Object.defineProperty(exports, "setSession", {
|
|
455
679
|
enumerable: true,
|
|
456
|
-
get: function () { return
|
|
680
|
+
get: function () { return chunkJKIMEPI2_cjs.setSession; }
|
|
457
681
|
});
|
|
458
682
|
Object.defineProperty(exports, "setUser", {
|
|
459
683
|
enumerable: true,
|
|
460
|
-
get: function () { return
|
|
684
|
+
get: function () { return chunkJKIMEPI2_cjs.setUser; }
|
|
461
685
|
});
|
|
462
686
|
Object.defineProperty(exports, "validateAttribute", {
|
|
463
687
|
enumerable: true,
|
|
464
|
-
get: function () { return
|
|
688
|
+
get: function () { return chunkJKIMEPI2_cjs.validateAttribute; }
|
|
465
689
|
});
|
|
466
690
|
Object.defineProperty(exports, "httpRequestHeaderAttribute", {
|
|
467
691
|
enumerable: true,
|
|
@@ -489,11 +713,11 @@ Object.defineProperty(exports, "parseError", {
|
|
|
489
713
|
});
|
|
490
714
|
Object.defineProperty(exports, "traceConsumer", {
|
|
491
715
|
enumerable: true,
|
|
492
|
-
get: function () { return
|
|
716
|
+
get: function () { return chunkOBWXM4NN_cjs.traceConsumer; }
|
|
493
717
|
});
|
|
494
718
|
Object.defineProperty(exports, "traceProducer", {
|
|
495
719
|
enumerable: true,
|
|
496
|
-
get: function () { return
|
|
720
|
+
get: function () { return chunkOBWXM4NN_cjs.traceProducer; }
|
|
497
721
|
});
|
|
498
722
|
Object.defineProperty(exports, "BusinessBaggage", {
|
|
499
723
|
enumerable: true,
|
|
@@ -537,55 +761,55 @@ Object.defineProperty(exports, "getMeter", {
|
|
|
537
761
|
});
|
|
538
762
|
Object.defineProperty(exports, "traceDB", {
|
|
539
763
|
enumerable: true,
|
|
540
|
-
get: function () { return
|
|
764
|
+
get: function () { return chunkYEVCD6DR_cjs.traceDB; }
|
|
541
765
|
});
|
|
542
766
|
Object.defineProperty(exports, "traceHTTP", {
|
|
543
767
|
enumerable: true,
|
|
544
|
-
get: function () { return
|
|
768
|
+
get: function () { return chunkYEVCD6DR_cjs.traceHTTP; }
|
|
545
769
|
});
|
|
546
770
|
Object.defineProperty(exports, "traceLLM", {
|
|
547
771
|
enumerable: true,
|
|
548
|
-
get: function () { return
|
|
772
|
+
get: function () { return chunkYEVCD6DR_cjs.traceLLM; }
|
|
549
773
|
});
|
|
550
774
|
Object.defineProperty(exports, "traceMessaging", {
|
|
551
775
|
enumerable: true,
|
|
552
|
-
get: function () { return
|
|
776
|
+
get: function () { return chunkYEVCD6DR_cjs.traceMessaging; }
|
|
553
777
|
});
|
|
554
778
|
Object.defineProperty(exports, "ctx", {
|
|
555
779
|
enumerable: true,
|
|
556
|
-
get: function () { return
|
|
780
|
+
get: function () { return chunkUTZR7P7E_cjs.ctx; }
|
|
557
781
|
});
|
|
558
782
|
Object.defineProperty(exports, "getEventQueue", {
|
|
559
783
|
enumerable: true,
|
|
560
|
-
get: function () { return
|
|
784
|
+
get: function () { return chunkUTZR7P7E_cjs.getEventQueue; }
|
|
561
785
|
});
|
|
562
786
|
Object.defineProperty(exports, "instrument", {
|
|
563
787
|
enumerable: true,
|
|
564
|
-
get: function () { return
|
|
788
|
+
get: function () { return chunkUTZR7P7E_cjs.instrument; }
|
|
565
789
|
});
|
|
566
790
|
Object.defineProperty(exports, "span", {
|
|
567
791
|
enumerable: true,
|
|
568
|
-
get: function () { return
|
|
792
|
+
get: function () { return chunkUTZR7P7E_cjs.span; }
|
|
569
793
|
});
|
|
570
794
|
Object.defineProperty(exports, "trace", {
|
|
571
795
|
enumerable: true,
|
|
572
|
-
get: function () { return
|
|
796
|
+
get: function () { return chunkUTZR7P7E_cjs.trace; }
|
|
573
797
|
});
|
|
574
798
|
Object.defineProperty(exports, "track", {
|
|
575
799
|
enumerable: true,
|
|
576
|
-
get: function () { return
|
|
800
|
+
get: function () { return chunkUTZR7P7E_cjs.track; }
|
|
577
801
|
});
|
|
578
802
|
Object.defineProperty(exports, "withBaggage", {
|
|
579
803
|
enumerable: true,
|
|
580
|
-
get: function () { return
|
|
804
|
+
get: function () { return chunkUTZR7P7E_cjs.withBaggage; }
|
|
581
805
|
});
|
|
582
806
|
Object.defineProperty(exports, "withNewContext", {
|
|
583
807
|
enumerable: true,
|
|
584
|
-
get: function () { return
|
|
808
|
+
get: function () { return chunkUTZR7P7E_cjs.withNewContext; }
|
|
585
809
|
});
|
|
586
810
|
Object.defineProperty(exports, "withTracing", {
|
|
587
811
|
enumerable: true,
|
|
588
|
-
get: function () { return
|
|
812
|
+
get: function () { return chunkUTZR7P7E_cjs.withTracing; }
|
|
589
813
|
});
|
|
590
814
|
Object.defineProperty(exports, "createDeterministicTraceId", {
|
|
591
815
|
enumerable: true,
|
|
@@ -633,15 +857,15 @@ Object.defineProperty(exports, "runWithSpan", {
|
|
|
633
857
|
});
|
|
634
858
|
Object.defineProperty(exports, "Event", {
|
|
635
859
|
enumerable: true,
|
|
636
|
-
get: function () { return
|
|
860
|
+
get: function () { return chunkWZOKY3PW_cjs.Event; }
|
|
637
861
|
});
|
|
638
862
|
Object.defineProperty(exports, "getEvents", {
|
|
639
863
|
enumerable: true,
|
|
640
|
-
get: function () { return
|
|
864
|
+
get: function () { return chunkWZOKY3PW_cjs.getEvents; }
|
|
641
865
|
});
|
|
642
866
|
Object.defineProperty(exports, "resetEvents", {
|
|
643
867
|
enumerable: true,
|
|
644
|
-
get: function () { return
|
|
868
|
+
get: function () { return chunkWZOKY3PW_cjs.resetEvents; }
|
|
645
869
|
});
|
|
646
870
|
Object.defineProperty(exports, "getOperationContext", {
|
|
647
871
|
enumerable: true,
|
|
@@ -685,15 +909,23 @@ Object.defineProperty(exports, "defineBaggageSchema", {
|
|
|
685
909
|
});
|
|
686
910
|
Object.defineProperty(exports, "BaggageSpanProcessor", {
|
|
687
911
|
enumerable: true,
|
|
688
|
-
get: function () { return
|
|
912
|
+
get: function () { return chunk563EL6O6_cjs.BaggageSpanProcessor; }
|
|
689
913
|
});
|
|
690
914
|
Object.defineProperty(exports, "createStringRedactor", {
|
|
691
915
|
enumerable: true,
|
|
692
|
-
get: function () { return
|
|
916
|
+
get: function () { return chunk563EL6O6_cjs.createStringRedactor; }
|
|
693
917
|
});
|
|
694
918
|
Object.defineProperty(exports, "init", {
|
|
695
919
|
enumerable: true,
|
|
696
|
-
get: function () { return
|
|
920
|
+
get: function () { return chunk563EL6O6_cjs.init; }
|
|
921
|
+
});
|
|
922
|
+
Object.defineProperty(exports, "isLoggerLocked", {
|
|
923
|
+
enumerable: true,
|
|
924
|
+
get: function () { return chunk563EL6O6_cjs.isLoggerLocked; }
|
|
925
|
+
});
|
|
926
|
+
Object.defineProperty(exports, "lockLogger", {
|
|
927
|
+
enumerable: true,
|
|
928
|
+
get: function () { return chunk563EL6O6_cjs.lockLogger; }
|
|
697
929
|
});
|
|
698
930
|
Object.defineProperty(exports, "FilteringSpanProcessor", {
|
|
699
931
|
enumerable: true,
|
|
@@ -713,23 +945,23 @@ Object.defineProperty(exports, "SpanNameNormalizingProcessor", {
|
|
|
713
945
|
});
|
|
714
946
|
Object.defineProperty(exports, "AttributeRedactingProcessor", {
|
|
715
947
|
enumerable: true,
|
|
716
|
-
get: function () { return
|
|
948
|
+
get: function () { return chunkCMNGGTQL_cjs.AttributeRedactingProcessor; }
|
|
717
949
|
});
|
|
718
950
|
Object.defineProperty(exports, "REDACTOR_PATTERNS", {
|
|
719
951
|
enumerable: true,
|
|
720
|
-
get: function () { return
|
|
952
|
+
get: function () { return chunkCMNGGTQL_cjs.REDACTOR_PATTERNS; }
|
|
721
953
|
});
|
|
722
954
|
Object.defineProperty(exports, "REDACTOR_PRESETS", {
|
|
723
955
|
enumerable: true,
|
|
724
|
-
get: function () { return
|
|
956
|
+
get: function () { return chunkCMNGGTQL_cjs.REDACTOR_PRESETS; }
|
|
725
957
|
});
|
|
726
958
|
Object.defineProperty(exports, "createAttributeRedactor", {
|
|
727
959
|
enumerable: true,
|
|
728
|
-
get: function () { return
|
|
960
|
+
get: function () { return chunkCMNGGTQL_cjs.createAttributeRedactor; }
|
|
729
961
|
});
|
|
730
962
|
Object.defineProperty(exports, "createRedactedSpan", {
|
|
731
963
|
enumerable: true,
|
|
732
|
-
get: function () { return
|
|
964
|
+
get: function () { return chunkCMNGGTQL_cjs.createRedactedSpan; }
|
|
733
965
|
});
|
|
734
966
|
Object.defineProperty(exports, "formatDuration", {
|
|
735
967
|
enumerable: true,
|
|
@@ -737,47 +969,47 @@ Object.defineProperty(exports, "formatDuration", {
|
|
|
737
969
|
});
|
|
738
970
|
Object.defineProperty(exports, "AUTOTEL_SAMPLING_TAIL_EVALUATED", {
|
|
739
971
|
enumerable: true,
|
|
740
|
-
get: function () { return
|
|
972
|
+
get: function () { return chunkVH77IPJN_cjs.AUTOTEL_SAMPLING_TAIL_EVALUATED; }
|
|
741
973
|
});
|
|
742
974
|
Object.defineProperty(exports, "AUTOTEL_SAMPLING_TAIL_KEEP", {
|
|
743
975
|
enumerable: true,
|
|
744
|
-
get: function () { return
|
|
976
|
+
get: function () { return chunkVH77IPJN_cjs.AUTOTEL_SAMPLING_TAIL_KEEP; }
|
|
745
977
|
});
|
|
746
978
|
Object.defineProperty(exports, "AdaptiveSampler", {
|
|
747
979
|
enumerable: true,
|
|
748
|
-
get: function () { return
|
|
980
|
+
get: function () { return chunkVH77IPJN_cjs.AdaptiveSampler; }
|
|
749
981
|
});
|
|
750
982
|
Object.defineProperty(exports, "AlwaysSampler", {
|
|
751
983
|
enumerable: true,
|
|
752
|
-
get: function () { return
|
|
984
|
+
get: function () { return chunkVH77IPJN_cjs.AlwaysSampler; }
|
|
753
985
|
});
|
|
754
986
|
Object.defineProperty(exports, "NeverSampler", {
|
|
755
987
|
enumerable: true,
|
|
756
|
-
get: function () { return
|
|
988
|
+
get: function () { return chunkVH77IPJN_cjs.NeverSampler; }
|
|
757
989
|
});
|
|
758
990
|
Object.defineProperty(exports, "RandomSampler", {
|
|
759
991
|
enumerable: true,
|
|
760
|
-
get: function () { return
|
|
992
|
+
get: function () { return chunkVH77IPJN_cjs.RandomSampler; }
|
|
761
993
|
});
|
|
762
994
|
Object.defineProperty(exports, "UserIdSampler", {
|
|
763
995
|
enumerable: true,
|
|
764
|
-
get: function () { return
|
|
996
|
+
get: function () { return chunkVH77IPJN_cjs.UserIdSampler; }
|
|
765
997
|
});
|
|
766
998
|
Object.defineProperty(exports, "createLinkFromHeaders", {
|
|
767
999
|
enumerable: true,
|
|
768
|
-
get: function () { return
|
|
1000
|
+
get: function () { return chunkVH77IPJN_cjs.createLinkFromHeaders; }
|
|
769
1001
|
});
|
|
770
1002
|
Object.defineProperty(exports, "extractLinksFromBatch", {
|
|
771
1003
|
enumerable: true,
|
|
772
|
-
get: function () { return
|
|
1004
|
+
get: function () { return chunkVH77IPJN_cjs.extractLinksFromBatch; }
|
|
773
1005
|
});
|
|
774
1006
|
Object.defineProperty(exports, "resolveSamplingPreset", {
|
|
775
1007
|
enumerable: true,
|
|
776
|
-
get: function () { return
|
|
1008
|
+
get: function () { return chunkVH77IPJN_cjs.resolveSamplingPreset; }
|
|
777
1009
|
});
|
|
778
1010
|
Object.defineProperty(exports, "samplingPresets", {
|
|
779
1011
|
enumerable: true,
|
|
780
|
-
get: function () { return
|
|
1012
|
+
get: function () { return chunkVH77IPJN_cjs.samplingPresets; }
|
|
781
1013
|
});
|
|
782
1014
|
Object.defineProperty(exports, "getAutotelTracer", {
|
|
783
1015
|
enumerable: true,
|
|
@@ -815,14 +1047,25 @@ Object.defineProperty(exports, "propagation", {
|
|
|
815
1047
|
enumerable: true,
|
|
816
1048
|
get: function () { return api.propagation; }
|
|
817
1049
|
});
|
|
1050
|
+
exports.GEN_AI_COST_USD_BUCKETS = GEN_AI_COST_USD_BUCKETS;
|
|
1051
|
+
exports.GEN_AI_DURATION_BUCKETS_SECONDS = GEN_AI_DURATION_BUCKETS_SECONDS;
|
|
1052
|
+
exports.GEN_AI_TOKEN_USAGE_BUCKETS = GEN_AI_TOKEN_USAGE_BUCKETS;
|
|
818
1053
|
exports.createStructuredError = createStructuredError;
|
|
819
1054
|
exports.flattenToAttributes = flattenToAttributes;
|
|
820
1055
|
exports.flush = flush;
|
|
1056
|
+
exports.genAiMetricViews = genAiMetricViews;
|
|
821
1057
|
exports.getRequestLogger = getRequestLogger;
|
|
822
1058
|
exports.getStructuredErrorAttributes = getStructuredErrorAttributes;
|
|
1059
|
+
exports.llmHistogramAdvice = llmHistogramAdvice;
|
|
1060
|
+
exports.recordPromptSent = recordPromptSent;
|
|
1061
|
+
exports.recordResponseReceived = recordResponseReceived;
|
|
1062
|
+
exports.recordRetry = recordRetry;
|
|
1063
|
+
exports.recordStreamFirstToken = recordStreamFirstToken;
|
|
823
1064
|
exports.recordStructuredError = recordStructuredError;
|
|
1065
|
+
exports.recordToolCall = recordToolCall;
|
|
824
1066
|
exports.runWithRequestContext = runWithRequestContext;
|
|
825
1067
|
exports.shutdown = shutdown;
|
|
1068
|
+
exports.structuredErrorToJSON = structuredErrorToJSON;
|
|
826
1069
|
exports.toAttributeValue = toAttributeValue;
|
|
827
1070
|
//# sourceMappingURL=index.cjs.map
|
|
828
1071
|
//# sourceMappingURL=index.cjs.map
|