@cat-factory/observability-otel 0.8.5 → 0.9.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/README.md +107 -2
- package/dist/index.d.ts +20 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -1
- package/dist/logs.d.ts +83 -0
- package/dist/logs.d.ts.map +1 -0
- package/dist/logs.js +193 -0
- package/dist/logs.js.map +1 -0
- package/dist/mapping.d.ts +89 -3
- package/dist/mapping.d.ts.map +1 -1
- package/dist/mapping.js +155 -0
- package/dist/mapping.js.map +1 -1
- package/dist/otlp.d.ts +3 -1
- package/dist/otlp.d.ts.map +1 -1
- package/dist/otlp.js +2 -0
- package/dist/otlp.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# @cat-factory/observability-otel
|
|
2
2
|
|
|
3
|
-
Opt-in [OpenTelemetry](https://opentelemetry.io) (OTLP) trace + metrics publisher for
|
|
4
|
-
Agent Architecture Board.
|
|
3
|
+
Opt-in [OpenTelemetry](https://opentelemetry.io) (OTLP) trace + metrics + logs publisher for
|
|
4
|
+
the Agent Architecture Board.
|
|
5
5
|
|
|
6
6
|
It implements the runtime-neutral `LlmTraceSink` port from `@cat-factory/kernel`, so when
|
|
7
7
|
wired into a facade every LLM call: container-agent calls (through the LLM proxy) **and**
|
|
@@ -15,6 +15,11 @@ Jaeger, an OpenTelemetry Collector, …) as:
|
|
|
15
15
|
`gen_ai.client.operation.duration` histogram: following the OpenTelemetry GenAI
|
|
16
16
|
semantic conventions.
|
|
17
17
|
|
|
18
|
+
Two further exporters ship beside it, each its own opt-in: the deployment-level
|
|
19
|
+
[platform-operator metrics](#platform-operator-metrics-deployment-health), and the
|
|
20
|
+
[log export](#log-export-the-third-signal) that carries the platform's own structured log
|
|
21
|
+
lines to the same endpoint.
|
|
22
|
+
|
|
18
23
|
## Span hierarchy
|
|
19
24
|
|
|
20
25
|
A run's spans form a tree, not a flat set of siblings sharing a trace id:
|
|
@@ -244,3 +249,103 @@ exporter serves both facades and is tested once.
|
|
|
244
249
|
`OTEL_PLATFORM_METRICS_INTERVAL_MS` (default 60s) sets the sweep cadence (the Worker is
|
|
245
250
|
cron-driven). The runtime-neutral `sweepPlatformMetrics` driver + `distinctAccountIds`
|
|
246
251
|
account enumeration live in `@cat-factory/orchestration`.
|
|
252
|
+
|
|
253
|
+
## Log export (the third signal)
|
|
254
|
+
|
|
255
|
+
The two exporters above answer "what did this run do" and "how is the deployment doing". The
|
|
256
|
+
**`OtelLogExporter`** (`createOtelLogExporter`, the `.` entry) carries the platform's own
|
|
257
|
+
**structured log lines** to `{endpoint}/v1/logs`, so an operator reads logs beside the traces
|
|
258
|
+
and metrics they already correlate with, in one backend, instead of tailing a Worker and
|
|
259
|
+
grepping a container's stdout.
|
|
260
|
+
|
|
261
|
+
It implements the kernel **`LogSink`** port, and `@cat-factory/server`'s logging adapter
|
|
262
|
+
(`observability/logger.ts`, the one place a logging library is named) copies every emitted line
|
|
263
|
+
to whichever sink a facade installed. Nothing in the domain changes: packages keep logging
|
|
264
|
+
through the one `Logger` port and never learn a second destination exists.
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
import { createOtelLogExporter } from '@cat-factory/observability-otel'
|
|
268
|
+
import { setLogSink } from '@cat-factory/server'
|
|
269
|
+
|
|
270
|
+
setLogSink(createOtelLogExporter({ endpoint, headers, serviceName, maxBatchSize, logger }))
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
**What a record carries.** The message is the OTLP `body`; the level maps onto the base
|
|
274
|
+
`SeverityNumber` of its range (`debug` 5, `info` 9, `warn` 13, `error` 17), so a backend's
|
|
275
|
+
`severity >= WARN` filter means what an operator reading `LOG_LEVEL` expects. The line's fields
|
|
276
|
+
become attributes under **the names they already have** (`workspaceId`, `executionId`, `jobId`,
|
|
277
|
+
`scope`, …) rather than being renamed into the `cat_factory.*` namespace the spans use: one key
|
|
278
|
+
works against stdout and the collector, which is worth more than symmetry with a signal whose
|
|
279
|
+
attribute names this package chose in the first place. `child`-bound fields are folded in, so a
|
|
280
|
+
line keeps the correlation the emitting scope gave it.
|
|
281
|
+
|
|
282
|
+
**Logs and traces meet structurally.** A line naming an `executionId` is stamped with the SAME
|
|
283
|
+
derived trace id that run's spans carry, so a backend links them without either side matching an
|
|
284
|
+
attribute, and the record marks that trace SAMPLED so a backend knows the id it is pointed at is
|
|
285
|
+
one it should have. A line with no run claims no trace (and no flags), rather than pointing at
|
|
286
|
+
one nobody will emit (the same rule the standalone inline call follows above).
|
|
287
|
+
|
|
288
|
+
That sharing is a **call** to the same `deriveTraceId` the spans go through, never a second copy
|
|
289
|
+
of the derivation, and the test asserts a log record's trace id against a **span's**. Both matter:
|
|
290
|
+
the two signals agreeing is the whole feature, nothing else enforces it, and a re-derivation plus
|
|
291
|
+
a test comparing one log record to another would let the span side drift with every test green.
|
|
292
|
+
|
|
293
|
+
**Draining is the facade's job, and the two runtimes differ only there:**
|
|
294
|
+
|
|
295
|
+
| Runtime | When the buffer is drained |
|
|
296
|
+
| ----------------- | ----------------------------------------------------------------------------------------------------- |
|
|
297
|
+
| Node / local | An interval (`OTEL_LOGS_FLUSH_INTERVAL_MS`, default 5s), plus a final flush on shutdown bounded to 5s |
|
|
298
|
+
| Cloudflare Worker | The end of every invocation, as a `waitUntil` after the response |
|
|
299
|
+
|
|
300
|
+
A Worker's module state is per ISOLATE and an isolate is discarded whenever the runtime decides,
|
|
301
|
+
so a buffered line has no later tick guaranteed to reach it: the same reasoning (and the same
|
|
302
|
+
per-invocation cost, stated rather than assumed) as the operational-metrics flush beside it. A
|
|
303
|
+
full batch also sends on its own, so a burst does not wait for the next tick.
|
|
304
|
+
|
|
305
|
+
**What it does with what it cannot deliver**, each of which was a way to make observability the
|
|
306
|
+
new failure class:
|
|
307
|
+
|
|
308
|
+
- **A failed POST is logged and dropped**, never thrown: `record` only buffers and `flush`
|
|
309
|
+
resolves even when the delivery failed.
|
|
310
|
+
- **The exporter refuses to export its own failure reports.** They are logged through a logger
|
|
311
|
+
bound with `otelLogExport: true` and records carrying that field are dropped, or a collector
|
|
312
|
+
outage becomes an ever-growing batch of lines about a collector outage. The warning still
|
|
313
|
+
reaches the local writer, which is where an operator whose collector is down can read it.
|
|
314
|
+
- **The buffer is bounded** (`maxBatchSize` × 8) and drops the OLDEST beyond it, because during
|
|
315
|
+
an outage the newest lines are the ones being looked at. **The drop count rides the next
|
|
316
|
+
batch out** as its own record: a silently short stream reads exactly like a quiet one.
|
|
317
|
+
- **An oversized field is capped at 8 KiB and says how much it cut.** A collector rejects an
|
|
318
|
+
oversized batch whole, so one field carrying captured command output would otherwise drop
|
|
319
|
+
every line beside it.
|
|
320
|
+
- **A field that cannot be serialised degrades to a note naming the problem**, never taking the
|
|
321
|
+
line with it. Absent and empty stay distinct: a `null`/`undefined` field is omitted rather
|
|
322
|
+
than exported as `""`.
|
|
323
|
+
- **A field that cannot even be READ degrades the same way, per field.** `LogFields` is
|
|
324
|
+
`Record<string, unknown>`, so a value can throw on access (an accessor property, a Proxy trap).
|
|
325
|
+
This runs on the DRAIN path, past the try/catch the logging adapter wraps `record` in, so the
|
|
326
|
+
mapping owes its own guards: an unreadable value is reported under its own key (the key's
|
|
327
|
+
presence is what says the emitter had something there) and its neighbours are unaffected.
|
|
328
|
+
- **The send chain is terminated**, so `flush` cannot reject however the drain path fails. Sends
|
|
329
|
+
are serialised behind one promise tail, and an escaped rejection there is not one lost batch:
|
|
330
|
+
every later send would inherit it, the exporter would go permanently silent, and on Node the
|
|
331
|
+
flush interval's un-awaited call would become an unhandled rejection that the process failure
|
|
332
|
+
guards answer by exiting. Observability may not take the deployment down.
|
|
333
|
+
|
|
334
|
+
**Opt-in on top of the base exporter** (it adds an egress POST per batch of lines): off unless
|
|
335
|
+
`OTEL_ENABLED=true` + an endpoint AND `OTEL_LOGS=true`. `OTEL_LOGS_MAX_BATCH_SIZE` (default 128)
|
|
336
|
+
sets the lines per POST and, with the multiplier above, the buffer bound; on Node
|
|
337
|
+
`OTEL_LOGS_FLUSH_INTERVAL_MS` (default 5s) sets the cadence (the Worker flushes per invocation).
|
|
338
|
+
|
|
339
|
+
**`LOG_LEVEL` governs both destinations.** The export sits behind the same threshold as the
|
|
340
|
+
local writer, so an operator has one dial rather than two that can disagree; there is
|
|
341
|
+
deliberately no separate export level.
|
|
342
|
+
|
|
343
|
+
**Two things are NOT exported, and both are stated here rather than left to be discovered:**
|
|
344
|
+
|
|
345
|
+
- **Lines emitted before config is resolved** (the `LOG_LEVEL` read, the process guards, config
|
|
346
|
+
validation, migrations) reach the local writer only. The endpoint IS config, and buffering
|
|
347
|
+
against one that may never arrive would be a leak on exactly the boots that fail.
|
|
348
|
+
- **Nothing is scrubbed here.** A field carrying command output, a URL or model text goes
|
|
349
|
+
through `redactSecrets` at its emit site (`backend/docs/logging.md`); this exporter carries
|
|
350
|
+
what the local writer already got, and adding a second scrub would state a guarantee the
|
|
351
|
+
stdout stream does not have.
|
package/dist/index.d.ts
CHANGED
|
@@ -35,6 +35,7 @@ export declare class OtelTraceSink implements LlmTraceSink {
|
|
|
35
35
|
/** Build a fetch-based {@link OtelTraceSink}. The workerd-safe opt-in OTLP exporter. */
|
|
36
36
|
export declare function createOtelSink(config: OtelSinkConfig): OtelTraceSink;
|
|
37
37
|
export { PlatformMetricsOtelExporter, type PlatformMetricsOtelExporterConfig, createPlatformMetricsOtelExporter, } from './platform.js';
|
|
38
|
+
export { DEFAULT_LOG_BATCH_SIZE, OtelLogExporter, type OtelLogExporterConfig, SELF_LOG_FIELD, createOtelLogExporter, } from './logs.js';
|
|
38
39
|
/**
|
|
39
40
|
* Parse the OTLP `OTEL_EXPORTER_OTLP_HEADERS` convention — comma-separated `key=value`
|
|
40
41
|
* pairs (e.g. `x-api-key=abc,x-tenant=42`) — into a header map, or undefined when
|
|
@@ -58,4 +59,23 @@ export declare function parsePlatformMetricsIntervalMs(raw: string | undefined):
|
|
|
58
59
|
* gauge series). Shared so both facades default + validate identically.
|
|
59
60
|
*/
|
|
60
61
|
export declare function parsePlatformMetricsWindow(raw: string | undefined): PlatformMetricsWindow;
|
|
62
|
+
/**
|
|
63
|
+
* Default log-export flush cadence (Node timer). Short enough that a line is queryable while
|
|
64
|
+
* an operator is still watching the incident that produced it, long enough that a busy
|
|
65
|
+
* deployment batches rather than posting per line. The Worker flushes per invocation instead,
|
|
66
|
+
* so this does not apply there.
|
|
67
|
+
*/
|
|
68
|
+
export declare const LOG_EXPORT_DEFAULT_FLUSH_INTERVAL_MS = 5000;
|
|
69
|
+
/**
|
|
70
|
+
* Parse `OTEL_LOGS_FLUSH_INTERVAL_MS` into a positive integer ms, falling back to
|
|
71
|
+
* {@link LOG_EXPORT_DEFAULT_FLUSH_INTERVAL_MS} for unset / non-numeric / non-positive values.
|
|
72
|
+
*/
|
|
73
|
+
export declare function parseLogExportFlushIntervalMs(raw: string | undefined): number;
|
|
74
|
+
/**
|
|
75
|
+
* Parse `OTEL_LOGS_MAX_BATCH_SIZE` into a positive integer, falling back to
|
|
76
|
+
* {@link DEFAULT_LOG_BATCH_SIZE}. It bounds both the POST size and (with the exporter's queue
|
|
77
|
+
* multiplier) how much a collector outage may hold in memory, so an operator turning it up
|
|
78
|
+
* for a chatty deployment is raising both together, deliberately.
|
|
79
|
+
*/
|
|
80
|
+
export declare function parseLogExportBatchSize(raw: string | undefined): number;
|
|
61
81
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,WAAW,EACX,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,MAAM,EACP,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],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AAG,aAAa,CAEpE;AAKD,OAAO,EACL,2BAA2B,EAC3B,KAAK,iCAAiC,EACtC,iCAAiC,GAClC,MAAM,eAAe,CAAA;AAKtB,OAAO,EACL,sBAAsB,EACtB,eAAe,EACf,KAAK,qBAAqB,EAC1B,cAAc,EACd,qBAAqB,GACtB,MAAM,WAAW,CAAA;AAElB;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAY5F;AAID,uFAAuF;AACvF,eAAO,MAAM,oCAAoC,QAAS,CAAA;AAE1D,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB,YAAI,IAAI,EAAE,KAAK,EAAE,IAAI,CAAU,CAAA;AACpE,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAA;AAE7E;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAG9E;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,qBAAqB,CAGzF;AAID;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,OAAQ,CAAA;AAEzD;;;GAGG;AACH,wBAAgB,6BAA6B,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAG7E;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAGvE"}
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ATTR, DEFAULT_SERVICE_NAME, DURATION_UNIT, METRIC, SCOPE_NAME, TOKEN_UNIT, mapGeneration, mapGenerationMetrics, mapRunSpan, mapStepSpan, mapToolSpan, toUnixNano, } from './mapping.js';
|
|
2
2
|
import { keyValues, postOtlp } from './otlp.js';
|
|
3
|
+
import { DEFAULT_LOG_BATCH_SIZE } from './logs.js';
|
|
3
4
|
// A fetch-based OpenTelemetry exporter that speaks OTLP/HTTP with the **JSON** encoding
|
|
4
5
|
// (`POST {endpoint}/v1/traces` and `/v1/metrics`) using only the global `fetch`/`crypto`.
|
|
5
6
|
// It deliberately does NOT depend on `@opentelemetry/*` — the SDK relies on Node-only APIs
|
|
@@ -169,6 +170,10 @@ export function createOtelSink(config) {
|
|
|
169
170
|
// sink above. Fetch-based on both runtimes (see `./platform`), so it lives in this
|
|
170
171
|
// workerd-safe entry rather than the SDK `./node` one.
|
|
171
172
|
export { PlatformMetricsOtelExporter, createPlatformMetricsOtelExporter, } from './platform.js';
|
|
173
|
+
// The LOG exporter (`/v1/logs`): the kernel `LogSink` the server's logging adapter fans
|
|
174
|
+
// emitted lines into. Fetch-based on both runtimes like the platform exporter (see `./logs`),
|
|
175
|
+
// so it too lives in this workerd-safe entry rather than the SDK `./node` one.
|
|
176
|
+
export { DEFAULT_LOG_BATCH_SIZE, OtelLogExporter, SELF_LOG_FIELD, createOtelLogExporter, } from './logs.js';
|
|
172
177
|
/**
|
|
173
178
|
* Parse the OTLP `OTEL_EXPORTER_OTLP_HEADERS` convention — comma-separated `key=value`
|
|
174
179
|
* pairs (e.g. `x-api-key=abc,x-tenant=42`) — into a header map, or undefined when
|
|
@@ -213,4 +218,30 @@ export function parsePlatformMetricsWindow(raw) {
|
|
|
213
218
|
const w = raw?.trim();
|
|
214
219
|
return w === '24h' || w === '7d' ? w : '1h';
|
|
215
220
|
}
|
|
221
|
+
// ---- log-export config parsing (shared by both facades) -------------------
|
|
222
|
+
/**
|
|
223
|
+
* Default log-export flush cadence (Node timer). Short enough that a line is queryable while
|
|
224
|
+
* an operator is still watching the incident that produced it, long enough that a busy
|
|
225
|
+
* deployment batches rather than posting per line. The Worker flushes per invocation instead,
|
|
226
|
+
* so this does not apply there.
|
|
227
|
+
*/
|
|
228
|
+
export const LOG_EXPORT_DEFAULT_FLUSH_INTERVAL_MS = 5_000;
|
|
229
|
+
/**
|
|
230
|
+
* Parse `OTEL_LOGS_FLUSH_INTERVAL_MS` into a positive integer ms, falling back to
|
|
231
|
+
* {@link LOG_EXPORT_DEFAULT_FLUSH_INTERVAL_MS} for unset / non-numeric / non-positive values.
|
|
232
|
+
*/
|
|
233
|
+
export function parseLogExportFlushIntervalMs(raw) {
|
|
234
|
+
const n = Number(raw?.trim());
|
|
235
|
+
return Number.isFinite(n) && n > 0 ? Math.floor(n) : LOG_EXPORT_DEFAULT_FLUSH_INTERVAL_MS;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Parse `OTEL_LOGS_MAX_BATCH_SIZE` into a positive integer, falling back to
|
|
239
|
+
* {@link DEFAULT_LOG_BATCH_SIZE}. It bounds both the POST size and (with the exporter's queue
|
|
240
|
+
* multiplier) how much a collector outage may hold in memory, so an operator turning it up
|
|
241
|
+
* for a chatty deployment is raising both together, deliberately.
|
|
242
|
+
*/
|
|
243
|
+
export function parseLogExportBatchSize(raw) {
|
|
244
|
+
const n = Number(raw?.trim());
|
|
245
|
+
return Number.isFinite(n) && n > 0 ? Math.floor(n) : DEFAULT_LOG_BATCH_SIZE;
|
|
246
|
+
}
|
|
216
247
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,IAAI,EACJ,oBAAoB,EACpB,aAAa,EACb,MAAM,EACN,UAAU,EACV,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,UAAU,EACV,WAAW,EACX,WAAW,EACX,UAAU,GACX,MAAM,cAAc,CAAA;AACrB,OAAO,EAAiB,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,OAAO,EA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E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,KAAK,CAAA;AAEzD;;;GAGG;AACH,MAAM,UAAU,6BAA6B,CAAC,GAAuB;IACnE,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAA;IAC7B,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,oCAAoC,CAAA;AAC3F,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAuB;IAC7D,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,EAAE,IAAI,EAAE,CAAC,CAAA;IAC7B,OAAO,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAA;AAC7E,CAAC"}
|
package/dist/logs.d.ts
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { type LogRecord, type LogSink, type Logger } from '@cat-factory/kernel';
|
|
2
|
+
/**
|
|
3
|
+
* The field this exporter binds onto the logger it reports its OWN failures through, and
|
|
4
|
+
* refuses to export.
|
|
5
|
+
*
|
|
6
|
+
* Without it the pipeline feeds itself: a failed POST logs a warning, the adapter fans that
|
|
7
|
+
* warning back into this buffer, the next flush fails the same way, and a collector outage
|
|
8
|
+
* becomes an ever-growing batch of lines about a collector outage. The warning still reaches
|
|
9
|
+
* the LOCAL writer, which is where an operator whose collector is down can actually read it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const SELF_LOG_FIELD = "otelLogExport";
|
|
12
|
+
/** Default lines per POST; also the size at which a full buffer triggers a send. */
|
|
13
|
+
export declare const DEFAULT_LOG_BATCH_SIZE = 128;
|
|
14
|
+
export interface OtelLogExporterConfig {
|
|
15
|
+
/** OTLP/HTTP base URL, e.g. `http://collector:4318` (`/v1/logs` is appended). */
|
|
16
|
+
endpoint: string;
|
|
17
|
+
/** Extra headers merged onto every request (auth tokens, tenant ids, …). */
|
|
18
|
+
headers?: Record<string, string>;
|
|
19
|
+
/** OTLP resource `service.name`; defaults to `cat-factory`. */
|
|
20
|
+
serviceName?: string;
|
|
21
|
+
/** Lines per POST; defaults to {@link DEFAULT_LOG_BATCH_SIZE}. */
|
|
22
|
+
maxBatchSize?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Logger for this exporter's own swallowed failures. Bound with {@link SELF_LOG_FIELD}, so
|
|
25
|
+
* those lines reach the local writer and are refused by the buffer (see the constant).
|
|
26
|
+
*/
|
|
27
|
+
logger?: Logger;
|
|
28
|
+
/** Injectable fetch (tests); defaults to the global `fetch`. */
|
|
29
|
+
fetchImpl?: typeof fetch;
|
|
30
|
+
}
|
|
31
|
+
export declare class OtelLogExporter implements LogSink {
|
|
32
|
+
private readonly logsEndpoint;
|
|
33
|
+
private readonly headers;
|
|
34
|
+
private readonly serviceName;
|
|
35
|
+
private readonly maxBatchSize;
|
|
36
|
+
private readonly logger?;
|
|
37
|
+
private readonly fetchImpl;
|
|
38
|
+
/** Lines accepted but not yet POSTed. Bounded by `maxBatchSize * MAX_QUEUED_BATCHES`. */
|
|
39
|
+
private buffer;
|
|
40
|
+
/** Lines dropped by the bound above since the last time the drop was reported. */
|
|
41
|
+
private dropped;
|
|
42
|
+
/**
|
|
43
|
+
* The tail of the send chain. Sends are SERIALISED rather than issued concurrently, so a
|
|
44
|
+
* batch-size trigger and a flush can never interleave two POSTs that both drained part of
|
|
45
|
+
* the buffer. `flush()` awaiting this tail is also what lets a Worker's `waitUntil` cover a
|
|
46
|
+
* send that started while the request was still being served.
|
|
47
|
+
*/
|
|
48
|
+
private inFlight;
|
|
49
|
+
constructor(config: OtelLogExporterConfig);
|
|
50
|
+
/**
|
|
51
|
+
* Buffer one line, and start a send once a full batch has accumulated. Never throws and
|
|
52
|
+
* never awaits: this runs inside `logger.info(…)`, so anything slower than an array push
|
|
53
|
+
* would put the collector's latency on the caller's path.
|
|
54
|
+
*/
|
|
55
|
+
record(record: LogRecord): void;
|
|
56
|
+
/**
|
|
57
|
+
* Deliver everything buffered. Called on an interval by the Node facade and once per
|
|
58
|
+
* invocation by the Worker; resolves once every send it started (and any already in flight)
|
|
59
|
+
* has settled. Best-effort: it resolves rather than rejecting when delivery failed.
|
|
60
|
+
*/
|
|
61
|
+
flush(): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* Queue a drain behind whatever is already sending, keeping POSTs strictly serial.
|
|
64
|
+
*
|
|
65
|
+
* The chain is TERMINATED here, and that catch is the port's `flush` obligation made
|
|
66
|
+
* structural rather than merely intended. A rejection left on `this.inFlight` is not one bad
|
|
67
|
+
* batch: every later `kick` chains onto the rejected tail and inherits it, so the exporter
|
|
68
|
+
* would never deliver another line, `flush()` would reject forever, and on Node the
|
|
69
|
+
* interval's `void flush()` would become an unhandled rejection that the process failure
|
|
70
|
+
* guards answer by EXITING. Observability would have taken the deployment down.
|
|
71
|
+
*
|
|
72
|
+
* Nothing on the drain path is expected to throw (the mapping is total and `postOtlp`
|
|
73
|
+
* swallows), so this catch should stay unreachable. It is here because "unreachable" is a
|
|
74
|
+
* property of today's code, and the cost of being wrong about it is the whole process.
|
|
75
|
+
*/
|
|
76
|
+
private kick;
|
|
77
|
+
private drain;
|
|
78
|
+
private post;
|
|
79
|
+
private resourceAttributes;
|
|
80
|
+
}
|
|
81
|
+
/** Build a fetch-based {@link OtelLogExporter}. The workerd-safe opt-in log sink. */
|
|
82
|
+
export declare function createOtelLogExporter(config: OtelLogExporterConfig): OtelLogExporter;
|
|
83
|
+
//# sourceMappingURL=logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../src/logs.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,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L,IAAI;IAiBlB,OAAO,CAAC,kBAAkB;CAG3B;AAmBD,qFAAqF;AACrF,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,qBAAqB,GAAG,eAAe,CAEpF"}
|
package/dist/logs.js
ADDED
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { ATTR, DEFAULT_SERVICE_NAME, SCOPE_NAME, mapLogRecord, toUnixNano, } from './mapping.js';
|
|
2
|
+
import { keyValues, postOtlp } from './otlp.js';
|
|
3
|
+
import { describeError } from '@cat-factory/kernel';
|
|
4
|
+
// A fetch-based OpenTelemetry exporter for the platform's own LOG lines: the third OTLP
|
|
5
|
+
// signal this package publishes, beside the per-call traces/metrics (`./index`) and the
|
|
6
|
+
// deployment-level metrics (`./platform`). It implements the kernel `LogSink` port, so
|
|
7
|
+
// `@cat-factory/server`'s logging adapter fans every emitted line here in addition to
|
|
8
|
+
// writing it locally, and nothing in the domain learns that a second destination exists.
|
|
9
|
+
//
|
|
10
|
+
// Fetch on BOTH runtimes, like the platform exporter and for the same reason: the OTLP/HTTP
|
|
11
|
+
// logs encoding is a plain JSON POST, so the official SDK's log-record processor would buy
|
|
12
|
+
// nothing that this cannot do while ruling out the Worker (workerd cannot run it).
|
|
13
|
+
//
|
|
14
|
+
// Two shapes here are NOT the SDK's defaults, and both follow from the runtimes:
|
|
15
|
+
//
|
|
16
|
+
// - **The buffer is drained by whoever holds it, not by a timer this owns.** Node runs an
|
|
17
|
+
// interval; a Worker isolate flushes at the end of each invocation, because module state
|
|
18
|
+
// there is per isolate and an isolate is discarded without notice. A timer started inside
|
|
19
|
+
// the exporter would be the one thing a Worker cannot honour.
|
|
20
|
+
// - **Delivery failures never reach the caller.** `record` only buffers (it runs on the emit
|
|
21
|
+
// path of every line, including lines already reporting a failure) and `flush` resolves
|
|
22
|
+
// even when the POST failed. A dropped batch is the documented worst case; the alternative
|
|
23
|
+
// is observability that can break the thing it observes.
|
|
24
|
+
/**
|
|
25
|
+
* The field this exporter binds onto the logger it reports its OWN failures through, and
|
|
26
|
+
* refuses to export.
|
|
27
|
+
*
|
|
28
|
+
* Without it the pipeline feeds itself: a failed POST logs a warning, the adapter fans that
|
|
29
|
+
* warning back into this buffer, the next flush fails the same way, and a collector outage
|
|
30
|
+
* becomes an ever-growing batch of lines about a collector outage. The warning still reaches
|
|
31
|
+
* the LOCAL writer, which is where an operator whose collector is down can actually read it.
|
|
32
|
+
*/
|
|
33
|
+
export const SELF_LOG_FIELD = 'otelLogExport';
|
|
34
|
+
/** Default lines per POST; also the size at which a full buffer triggers a send. */
|
|
35
|
+
export const DEFAULT_LOG_BATCH_SIZE = 128;
|
|
36
|
+
/**
|
|
37
|
+
* How many batches may sit unsent before the oldest lines are dropped. The buffer is the one
|
|
38
|
+
* unbounded thing in this design (a collector that stops answering must not turn into a heap
|
|
39
|
+
* that ends the process), so it is bounded here and the drop is REPORTED on the next batch out
|
|
40
|
+
* rather than passing silently. A batch the collector then rejects takes its own drop note with
|
|
41
|
+
* it, which loses nothing a reader had: that batch's lines are gone by the same failure.
|
|
42
|
+
*/
|
|
43
|
+
const MAX_QUEUED_BATCHES = 8;
|
|
44
|
+
/** Encode one mapped record as an OTLP/JSON `LogRecord`. */
|
|
45
|
+
function encodeLogRecord(record) {
|
|
46
|
+
const time = toUnixNano(record.timeMs);
|
|
47
|
+
return {
|
|
48
|
+
// Both stamps carry the emit time: the platform's lines are exported from the process
|
|
49
|
+
// that produced them, so there is no collection lag to state as a separate observation.
|
|
50
|
+
timeUnixNano: time,
|
|
51
|
+
observedTimeUnixNano: time,
|
|
52
|
+
severityNumber: record.severityNumber,
|
|
53
|
+
severityText: record.severityText,
|
|
54
|
+
body: { stringValue: record.body },
|
|
55
|
+
attributes: keyValues(record.attributes),
|
|
56
|
+
...(record.traceId ? { traceId: record.traceId, flags: record.traceFlags } : {}),
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
export class OtelLogExporter {
|
|
60
|
+
logsEndpoint;
|
|
61
|
+
headers;
|
|
62
|
+
serviceName;
|
|
63
|
+
maxBatchSize;
|
|
64
|
+
logger;
|
|
65
|
+
fetchImpl;
|
|
66
|
+
/** Lines accepted but not yet POSTed. Bounded by `maxBatchSize * MAX_QUEUED_BATCHES`. */
|
|
67
|
+
buffer = [];
|
|
68
|
+
/** Lines dropped by the bound above since the last time the drop was reported. */
|
|
69
|
+
dropped = 0;
|
|
70
|
+
/**
|
|
71
|
+
* The tail of the send chain. Sends are SERIALISED rather than issued concurrently, so a
|
|
72
|
+
* batch-size trigger and a flush can never interleave two POSTs that both drained part of
|
|
73
|
+
* the buffer. `flush()` awaiting this tail is also what lets a Worker's `waitUntil` cover a
|
|
74
|
+
* send that started while the request was still being served.
|
|
75
|
+
*/
|
|
76
|
+
inFlight = Promise.resolve();
|
|
77
|
+
constructor(config) {
|
|
78
|
+
const base = config.endpoint.replace(/\/+$/, '');
|
|
79
|
+
this.logsEndpoint = `${base}/v1/logs`;
|
|
80
|
+
this.headers = { 'content-type': 'application/json', ...config.headers };
|
|
81
|
+
this.serviceName = config.serviceName || DEFAULT_SERVICE_NAME;
|
|
82
|
+
this.maxBatchSize =
|
|
83
|
+
config.maxBatchSize && config.maxBatchSize > 0 ? config.maxBatchSize : DEFAULT_LOG_BATCH_SIZE;
|
|
84
|
+
this.logger = config.logger?.child({ [SELF_LOG_FIELD]: true });
|
|
85
|
+
this.fetchImpl = config.fetchImpl ?? fetch;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Buffer one line, and start a send once a full batch has accumulated. Never throws and
|
|
89
|
+
* never awaits: this runs inside `logger.info(…)`, so anything slower than an array push
|
|
90
|
+
* would put the collector's latency on the caller's path.
|
|
91
|
+
*/
|
|
92
|
+
record(record) {
|
|
93
|
+
if (record.fields[SELF_LOG_FIELD] === true)
|
|
94
|
+
return;
|
|
95
|
+
const capacity = this.maxBatchSize * MAX_QUEUED_BATCHES;
|
|
96
|
+
if (this.buffer.length >= capacity) {
|
|
97
|
+
// Drop the OLDEST: during an outage the newest lines are the ones an operator is
|
|
98
|
+
// looking at, and the local writer still holds every one of them either way.
|
|
99
|
+
const overflow = this.buffer.length - capacity + 1;
|
|
100
|
+
this.buffer.splice(0, overflow);
|
|
101
|
+
this.dropped += overflow;
|
|
102
|
+
}
|
|
103
|
+
this.buffer.push(record);
|
|
104
|
+
if (this.buffer.length >= this.maxBatchSize)
|
|
105
|
+
this.kick();
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Deliver everything buffered. Called on an interval by the Node facade and once per
|
|
109
|
+
* invocation by the Worker; resolves once every send it started (and any already in flight)
|
|
110
|
+
* has settled. Best-effort: it resolves rather than rejecting when delivery failed.
|
|
111
|
+
*/
|
|
112
|
+
async flush() {
|
|
113
|
+
this.kick();
|
|
114
|
+
await this.inFlight;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Queue a drain behind whatever is already sending, keeping POSTs strictly serial.
|
|
118
|
+
*
|
|
119
|
+
* The chain is TERMINATED here, and that catch is the port's `flush` obligation made
|
|
120
|
+
* structural rather than merely intended. A rejection left on `this.inFlight` is not one bad
|
|
121
|
+
* batch: every later `kick` chains onto the rejected tail and inherits it, so the exporter
|
|
122
|
+
* would never deliver another line, `flush()` would reject forever, and on Node the
|
|
123
|
+
* interval's `void flush()` would become an unhandled rejection that the process failure
|
|
124
|
+
* guards answer by EXITING. Observability would have taken the deployment down.
|
|
125
|
+
*
|
|
126
|
+
* Nothing on the drain path is expected to throw (the mapping is total and `postOtlp`
|
|
127
|
+
* swallows), so this catch should stay unreachable. It is here because "unreachable" is a
|
|
128
|
+
* property of today's code, and the cost of being wrong about it is the whole process.
|
|
129
|
+
*/
|
|
130
|
+
kick() {
|
|
131
|
+
this.inFlight = this.inFlight
|
|
132
|
+
.then(() => this.drain())
|
|
133
|
+
.catch((error) => {
|
|
134
|
+
this.logger?.warn('otel: log export drain failed', {
|
|
135
|
+
scope: 'otel-logs',
|
|
136
|
+
...describeError(error),
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
async drain() {
|
|
141
|
+
while (this.buffer.length > 0) {
|
|
142
|
+
const batch = this.buffer.splice(0, this.maxBatchSize);
|
|
143
|
+
// The drop note rides the NEXT batch out rather than a POST of its own: it is a fact
|
|
144
|
+
// about this exporter, so it is worth exactly one line, next to the lines that survived.
|
|
145
|
+
const dropped = this.dropped;
|
|
146
|
+
this.dropped = 0;
|
|
147
|
+
const mapped = batch.map(mapLogRecord);
|
|
148
|
+
if (dropped > 0)
|
|
149
|
+
mapped.push(droppedNote(dropped, batch[batch.length - 1].timeMs));
|
|
150
|
+
await this.post(mapped);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
async post(records) {
|
|
154
|
+
await postOtlp({
|
|
155
|
+
fetchImpl: this.fetchImpl,
|
|
156
|
+
endpoint: this.logsEndpoint,
|
|
157
|
+
headers: this.headers,
|
|
158
|
+
payload: {
|
|
159
|
+
resourceLogs: [
|
|
160
|
+
{
|
|
161
|
+
resource: { attributes: this.resourceAttributes() },
|
|
162
|
+
scopeLogs: [{ scope: { name: SCOPE_NAME }, logRecords: records.map(encodeLogRecord) }],
|
|
163
|
+
},
|
|
164
|
+
],
|
|
165
|
+
},
|
|
166
|
+
logger: this.logger,
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
resourceAttributes() {
|
|
170
|
+
return [{ key: ATTR.serviceName, value: { stringValue: this.serviceName } }];
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* The record standing in for what the buffer bound above discarded. Emitted INTO the export
|
|
175
|
+
* rather than only logged locally, because a reader querying the collector is exactly the
|
|
176
|
+
* reader who would otherwise take an incomplete stream for a complete one.
|
|
177
|
+
*/
|
|
178
|
+
function droppedNote(dropped, timeMs) {
|
|
179
|
+
return mapLogRecord({
|
|
180
|
+
level: 'warn',
|
|
181
|
+
msg: 'otel: dropped buffered log records (export buffer full)',
|
|
182
|
+
fields: { scope: 'otel-logs', dropped },
|
|
183
|
+
// Stamped with the last line of the batch it rides out on rather than a clock read here:
|
|
184
|
+
// the exporter reads no clock of its own (a Worker's is frozen between I/O anyway), and
|
|
185
|
+
// the batch's own time is when the drop was actually happening.
|
|
186
|
+
timeMs,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
/** Build a fetch-based {@link OtelLogExporter}. The workerd-safe opt-in log sink. */
|
|
190
|
+
export function createOtelLogExporter(config) {
|
|
191
|
+
return new OtelLogExporter(config);
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=logs.js.map
|
package/dist/logs.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.js","sourceRoot":"","sources":["../src/logs.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,IAAI,EACJ,oBAAoB,EACpB,UAAU,EACV,YAAY,EACZ,UAAU,GACX,MAAM,cAAc,CAAA;AACrB,OAAO,EAAiB,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC9D,OAAO,EAA6C,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAE9F,wFAAwF;AACxF,wFAAwF;AACxF,uFAAuF;AACvF,sFAAsF;AACtF,yFAAyF;AACzF,EAAE;AACF,4FAA4F;AAC5F,2FAA2F;AAC3F,mFAAmF;AACnF,EAAE;AACF,iFAAiF;AACjF,EAAE;AACF,4FAA4F;AAC5F,6FAA6F;AAC7F,8FAA8F;AAC9F,kEAAkE;AAClE,+FAA+F;AAC/F,4FAA4F;AAC5F,+FAA+F;AAC/F,6DAA6D;AAE7D;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,eAAe,CAAA;AAE7C,oFAAoF;AACpF,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;AAEzC;;;;;;GAMG;AACH,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAoB5B,4DAA4D;AAC5D,SAAS,eAAe,CAAC,MAAuB;IAC9C,MAAM,IAAI,G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BACF;aACF;YACD,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC,CAAA;IACJ,CAAC;IAEO,kBAAkB;QACxB,OAAO,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,CAAA;IAC9E,CAAC;CACF;AAED;;;;GAIG;AACH,SAAS,WAAW,CAAC,OAAe,EAAE,MAAc;IAClD,OAAO,YAAY,CAAC;QAClB,KAAK,EAAE,MAAM;QACb,GAAG,EAAE,yDAAyD;QAC9D,MAAM,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE;QACvC,yFAAyF;QACzF,wFAAwF;QACxF,gEAAgE;QAChE,MAAM;KACP,CAAC,CAAA;AACJ,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,qBAAqB,CAAC,MAA6B;IACjE,OAAO,IAAI,eAAe,CAAC,MAAM,CAAC,CAAA;AACpC,CAAC"}
|
package/dist/mapping.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LlmGenerationEvent, LlmRunSpan, LlmStepSpan, LlmToolSpan, LlmToolSpanContext, OperationalCounter, OperationalCounterSample, OperationalGauge, OperationalGaugeSample } from '@cat-factory/kernel';
|
|
1
|
+
import type { LlmGenerationEvent, LlmRunSpan, LlmStepSpan, LlmToolSpan, LlmToolSpanContext, LogLevel, LogRecord, OperationalCounter, OperationalCounterSample, OperationalGauge, OperationalGaugeSample } from '@cat-factory/kernel';
|
|
2
2
|
import type { PlatformObservability } from '@cat-factory/contracts';
|
|
3
3
|
/** Default OTLP resource `service.name`; overridable via `OTEL_SERVICE_NAME`. */
|
|
4
4
|
export declare const DEFAULT_SERVICE_NAME = "cat-factory";
|
|
@@ -55,8 +55,13 @@ export declare const METRIC: {
|
|
|
55
55
|
};
|
|
56
56
|
export declare const TOKEN_UNIT = "{token}";
|
|
57
57
|
export declare const DURATION_UNIT = "s";
|
|
58
|
-
/**
|
|
59
|
-
|
|
58
|
+
/**
|
|
59
|
+
* A neutral attribute value both transports understand (string / number / boolean / string
|
|
60
|
+
* list). Booleans arrive only from LOG fields, which are free-form where a span's attributes
|
|
61
|
+
* are ours to choose; they are carried as a native OTLP `boolValue` rather than stringified,
|
|
62
|
+
* because a backend filters `ok = false` and `ok = "false"` differently.
|
|
63
|
+
*/
|
|
64
|
+
export type AttributeValue = string | number | boolean | string[];
|
|
60
65
|
export type AttributeMap = Record<string, AttributeValue>;
|
|
61
66
|
interface MappedEvent {
|
|
62
67
|
name: string;
|
|
@@ -251,5 +256,86 @@ export interface MappedCounter {
|
|
|
251
256
|
export declare function mapOperationalCounters(samples: OperationalCounterSample[]): MappedCounter[];
|
|
252
257
|
/** Map probed gauge readings onto OTLP gauges, one metric per gauge. */
|
|
253
258
|
export declare function mapOperationalGauges(samples: OperationalGaugeSample[]): MappedGauge[];
|
|
259
|
+
/**
|
|
260
|
+
* OTLP `SeverityNumber` per level. The platform's vocabulary is four levels (kernel's
|
|
261
|
+
* `LogLevel`), each landing on the BASE number of its OTLP range (DEBUG=5, INFO=9, WARN=13,
|
|
262
|
+
* ERROR=17) rather than a mid-range value, so a backend's `severity >= WARN` filter means
|
|
263
|
+
* exactly what an operator reading `LOG_LEVEL` expects. Exhaustive over the union, so adding
|
|
264
|
+
* a level fails the build here rather than exporting an unmapped line as severity 0.
|
|
265
|
+
*/
|
|
266
|
+
export declare const LOG_SEVERITY_NUMBER: Record<LogLevel, number>;
|
|
267
|
+
/** The matching `SeverityText`, upper-cased per the OTLP convention. */
|
|
268
|
+
export declare const LOG_SEVERITY_TEXT: Record<LogLevel, string>;
|
|
269
|
+
/**
|
|
270
|
+
* Coerce one arbitrary log-field value into a neutral attribute value, or `undefined` to omit
|
|
271
|
+
* the attribute entirely.
|
|
272
|
+
*
|
|
273
|
+
* `LogFields` is `Record<string, unknown>`: a call site may pass anything, including a value
|
|
274
|
+
* that cannot be serialised. Nothing here may throw (this runs on the emit path of a line that
|
|
275
|
+
* is often already reporting a failure), so an unserialisable value degrades to a note
|
|
276
|
+
* naming the problem rather than taking the line down with it.
|
|
277
|
+
*
|
|
278
|
+
* `null`/`undefined` are OMITTED rather than sent as an empty string: an absent attribute and
|
|
279
|
+
* one holding `""` are different facts, and only the absence states "the emitter had nothing".
|
|
280
|
+
*/
|
|
281
|
+
export declare function logAttributeValue(value: unknown): AttributeValue | undefined;
|
|
282
|
+
/**
|
|
283
|
+
* Map a whole field bag, dropping the keys whose value carries nothing.
|
|
284
|
+
*
|
|
285
|
+
* TOTAL by construction, which is the same promise {@link logAttributeValue} makes and for a
|
|
286
|
+
* stronger reason: this runs on the exporter's DRAIN path, downstream of the try/catch the
|
|
287
|
+
* logging adapter wraps `record` in, so a throw here escapes into the send chain rather than
|
|
288
|
+
* costing one line. `LogFields` is `Record<string, unknown>`, so both halves of the read can
|
|
289
|
+
* throw on a value a call site is free to pass: enumerating the keys (a Proxy trap) and
|
|
290
|
+
* reading one (an accessor property). Each is guarded separately so a single unreadable field
|
|
291
|
+
* costs THAT field and nothing else.
|
|
292
|
+
*
|
|
293
|
+
* A field that cannot be read is REPORTED under its own key rather than omitted: the key's
|
|
294
|
+
* presence is what tells a reader the emitter had something to say there, which an absent
|
|
295
|
+
* attribute would not.
|
|
296
|
+
*/
|
|
297
|
+
export declare function logAttributes(fields: Record<string, unknown>): AttributeMap;
|
|
298
|
+
/** A transport-neutral OTLP log record. */
|
|
299
|
+
export interface MappedLogRecord {
|
|
300
|
+
/** Epoch ms the line was emitted at. */
|
|
301
|
+
timeMs: number;
|
|
302
|
+
severityNumber: number;
|
|
303
|
+
severityText: string;
|
|
304
|
+
/** The line's fixed message; everything variable is an attribute. */
|
|
305
|
+
body: string;
|
|
306
|
+
attributes: AttributeMap;
|
|
307
|
+
/**
|
|
308
|
+
* The trace this line belongs to, when it named a run. Set through the SAME `deriveTraceId`
|
|
309
|
+
* the run's spans go through (never a second copy of the derivation), so a backend joins
|
|
310
|
+
* logs to the trace structurally rather than by matching an attribute; absent for a line
|
|
311
|
+
* with no run (most boot, sweep and request lines).
|
|
312
|
+
*/
|
|
313
|
+
traceId?: string;
|
|
314
|
+
/**
|
|
315
|
+
* W3C trace flags for {@link traceId}, present only alongside it. Always SAMPLED, because
|
|
316
|
+
* this pipeline has no sampler: a line that reached the exporter is a line the deployment
|
|
317
|
+
* chose to export. Spans carry no `flags` and need none (a span's presence in the batch
|
|
318
|
+
* states its own sampling); a log record is the side that has to state it, since a backend
|
|
319
|
+
* decides from these flags whether the trace it points at is one it should have.
|
|
320
|
+
*/
|
|
321
|
+
traceFlags?: number;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Map one emitted line to a neutral OTLP log record.
|
|
325
|
+
*
|
|
326
|
+
* Fields are exported under the names they already carry on the local writer (`workspaceId`,
|
|
327
|
+
* `executionId`, `jobId`, `scope`, …) rather than being renamed into the `cat_factory.*`
|
|
328
|
+
* namespace the spans use. An operator greps stdout and queries the collector with the same
|
|
329
|
+
* key, which is worth more than symmetry with a signal whose attribute names this package
|
|
330
|
+
* chose in the first place. The one thing the two signals DO share is the trace id, and it is
|
|
331
|
+
* shared structurally: a line carrying an `executionId` is stamped with the run's derived
|
|
332
|
+
* trace id, so a run's logs and its spans meet in the backend without either naming the other.
|
|
333
|
+
*
|
|
334
|
+
* That sharing is a CALL to `deriveTraceId`, not a second copy of what it does. The two signals
|
|
335
|
+
* agreeing is the whole feature and nothing else enforces it: a re-derivation here would let a
|
|
336
|
+
* change to the span side pass every test in this package while silently unjoining every log
|
|
337
|
+
* line from the run it belongs to.
|
|
338
|
+
*/
|
|
339
|
+
export declare function mapLogRecord(record: LogRecord): MappedLogRecord;
|
|
254
340
|
export {};
|
|
255
341
|
//# sourceMappingURL=mapping.d.ts.map
|
package/dist/mapping.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../src/mapping.ts"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gB,EAAE,CAAA;CAC3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,wBAAwB,EAAE,GAAG,aAAa,EAAE,CAgB3F;AAED,wEAAwE;AACxE,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,sBAAsB,EAAE,GAAG,WAAW,EAAE,CAgBrF;AAUD;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAKxD,CAAA;AAED,wEAAwE;AACxE,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,QAAQ,EAAE,MAAM,CAKtD,CAAA;AAmBD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,cAAc,GAAG,SAAS,CAkB5E;AAOD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,YAAY,CAoB3E;AAED,2CAA2C;AAC3C,MAAM,WAAW,eAAe;IAC9B,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,MAAM,CAAA;IACpB,qEAAqE;IACrE,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,YAAY,CAAA;IACxB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB;AAKD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,SAAS,GAAG,eAAe,CAgB/D"}
|
package/dist/mapping.js
CHANGED
|
@@ -650,4 +650,159 @@ export function mapOperationalGauges(samples) {
|
|
|
650
650
|
points,
|
|
651
651
|
}));
|
|
652
652
|
}
|
|
653
|
+
// ---- LOG RECORDS ----------------------------------------------------------
|
|
654
|
+
//
|
|
655
|
+
// The third OTLP signal this package publishes (`/v1/logs`), beside the per-call traces and
|
|
656
|
+
// the metrics above. Its input is the kernel `LogRecord`, one emitted `Logger` line with its
|
|
657
|
+
// `child`-bound correlation fields already folded in, so this mapping is the one place that
|
|
658
|
+
// decides how a platform log line becomes an OTLP log record: severity, body, attributes, and
|
|
659
|
+
// the trace it belongs to.
|
|
660
|
+
/**
|
|
661
|
+
* OTLP `SeverityNumber` per level. The platform's vocabulary is four levels (kernel's
|
|
662
|
+
* `LogLevel`), each landing on the BASE number of its OTLP range (DEBUG=5, INFO=9, WARN=13,
|
|
663
|
+
* ERROR=17) rather than a mid-range value, so a backend's `severity >= WARN` filter means
|
|
664
|
+
* exactly what an operator reading `LOG_LEVEL` expects. Exhaustive over the union, so adding
|
|
665
|
+
* a level fails the build here rather than exporting an unmapped line as severity 0.
|
|
666
|
+
*/
|
|
667
|
+
export const LOG_SEVERITY_NUMBER = {
|
|
668
|
+
debug: 5,
|
|
669
|
+
info: 9,
|
|
670
|
+
warn: 13,
|
|
671
|
+
error: 17,
|
|
672
|
+
};
|
|
673
|
+
/** The matching `SeverityText`, upper-cased per the OTLP convention. */
|
|
674
|
+
export const LOG_SEVERITY_TEXT = {
|
|
675
|
+
debug: 'DEBUG',
|
|
676
|
+
info: 'INFO',
|
|
677
|
+
warn: 'WARN',
|
|
678
|
+
error: 'ERROR',
|
|
679
|
+
};
|
|
680
|
+
/**
|
|
681
|
+
* Ceiling on one stringified attribute value. A log field can carry captured command output
|
|
682
|
+
* or model text, and a collector rejects an oversized batch WHOLE, so one 2 MB field would drop
|
|
683
|
+
* every line beside it. Truncation states what it cut (see the "every cap records what it
|
|
684
|
+
* dropped" rule) rather than silently shortening.
|
|
685
|
+
*/
|
|
686
|
+
const MAX_ATTRIBUTE_CHARS = 8192;
|
|
687
|
+
/** The field name a log record's own truncation note lands under. */
|
|
688
|
+
const TRUNCATION_SUFFIX = (dropped) => `…[truncated ${dropped} chars]`;
|
|
689
|
+
function cap(value) {
|
|
690
|
+
return value.length <= MAX_ATTRIBUTE_CHARS
|
|
691
|
+
? value
|
|
692
|
+
: value.slice(0, MAX_ATTRIBUTE_CHARS) + TRUNCATION_SUFFIX(value.length - MAX_ATTRIBUTE_CHARS);
|
|
693
|
+
}
|
|
694
|
+
/**
|
|
695
|
+
* Coerce one arbitrary log-field value into a neutral attribute value, or `undefined` to omit
|
|
696
|
+
* the attribute entirely.
|
|
697
|
+
*
|
|
698
|
+
* `LogFields` is `Record<string, unknown>`: a call site may pass anything, including a value
|
|
699
|
+
* that cannot be serialised. Nothing here may throw (this runs on the emit path of a line that
|
|
700
|
+
* is often already reporting a failure), so an unserialisable value degrades to a note
|
|
701
|
+
* naming the problem rather than taking the line down with it.
|
|
702
|
+
*
|
|
703
|
+
* `null`/`undefined` are OMITTED rather than sent as an empty string: an absent attribute and
|
|
704
|
+
* one holding `""` are different facts, and only the absence states "the emitter had nothing".
|
|
705
|
+
*/
|
|
706
|
+
export function logAttributeValue(value) {
|
|
707
|
+
if (value === null || value === undefined)
|
|
708
|
+
return undefined;
|
|
709
|
+
if (typeof value === 'string')
|
|
710
|
+
return cap(value);
|
|
711
|
+
if (typeof value === 'boolean')
|
|
712
|
+
return value;
|
|
713
|
+
if (typeof value === 'number')
|
|
714
|
+
return Number.isFinite(value) ? value : cap(String(value));
|
|
715
|
+
if (typeof value === 'bigint')
|
|
716
|
+
return cap(value.toString());
|
|
717
|
+
if (Array.isArray(value) && value.every((v) => typeof v === 'string')) {
|
|
718
|
+
return value.map((v) => cap(v));
|
|
719
|
+
}
|
|
720
|
+
try {
|
|
721
|
+
const json = JSON.stringify(value);
|
|
722
|
+
return json === undefined ? cap(String(value)) : cap(json);
|
|
723
|
+
}
|
|
724
|
+
catch (error) {
|
|
725
|
+
// A cycle, a BigInt inside an object, a throwing `toJSON`: the same class the pino
|
|
726
|
+
// browser writer guards against, for the same reason: a field bag we cannot render must
|
|
727
|
+
// not remove the line, which is the only evidence that the code path ran at all.
|
|
728
|
+
return `[unserializable: ${error instanceof Error ? error.message : String(error)}]`;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
/** Render a value this mapping could not read at all, in the `logAttributeValue` vocabulary. */
|
|
732
|
+
function unreadable(error) {
|
|
733
|
+
return `[unreadable: ${error instanceof Error ? error.message : String(error)}]`;
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Map a whole field bag, dropping the keys whose value carries nothing.
|
|
737
|
+
*
|
|
738
|
+
* TOTAL by construction, which is the same promise {@link logAttributeValue} makes and for a
|
|
739
|
+
* stronger reason: this runs on the exporter's DRAIN path, downstream of the try/catch the
|
|
740
|
+
* logging adapter wraps `record` in, so a throw here escapes into the send chain rather than
|
|
741
|
+
* costing one line. `LogFields` is `Record<string, unknown>`, so both halves of the read can
|
|
742
|
+
* throw on a value a call site is free to pass: enumerating the keys (a Proxy trap) and
|
|
743
|
+
* reading one (an accessor property). Each is guarded separately so a single unreadable field
|
|
744
|
+
* costs THAT field and nothing else.
|
|
745
|
+
*
|
|
746
|
+
* A field that cannot be read is REPORTED under its own key rather than omitted: the key's
|
|
747
|
+
* presence is what tells a reader the emitter had something to say there, which an absent
|
|
748
|
+
* attribute would not.
|
|
749
|
+
*/
|
|
750
|
+
export function logAttributes(fields) {
|
|
751
|
+
const attributes = {};
|
|
752
|
+
let keys;
|
|
753
|
+
try {
|
|
754
|
+
keys = Object.keys(fields);
|
|
755
|
+
}
|
|
756
|
+
catch (error) {
|
|
757
|
+
// The whole bag is unreadable. One sentinel attribute, because a line exported with no
|
|
758
|
+
// attributes at all reads as a line that carried none.
|
|
759
|
+
return { fields: unreadable(error) };
|
|
760
|
+
}
|
|
761
|
+
for (const key of keys) {
|
|
762
|
+
let value;
|
|
763
|
+
try {
|
|
764
|
+
value = logAttributeValue(fields[key]);
|
|
765
|
+
}
|
|
766
|
+
catch (error) {
|
|
767
|
+
value = unreadable(error);
|
|
768
|
+
}
|
|
769
|
+
if (value !== undefined)
|
|
770
|
+
attributes[key] = value;
|
|
771
|
+
}
|
|
772
|
+
return attributes;
|
|
773
|
+
}
|
|
774
|
+
/** W3C `sampled` trace flag, the only one this exporter ever sets. */
|
|
775
|
+
const TRACE_FLAG_SAMPLED = 0x01;
|
|
776
|
+
/**
|
|
777
|
+
* Map one emitted line to a neutral OTLP log record.
|
|
778
|
+
*
|
|
779
|
+
* Fields are exported under the names they already carry on the local writer (`workspaceId`,
|
|
780
|
+
* `executionId`, `jobId`, `scope`, …) rather than being renamed into the `cat_factory.*`
|
|
781
|
+
* namespace the spans use. An operator greps stdout and queries the collector with the same
|
|
782
|
+
* key, which is worth more than symmetry with a signal whose attribute names this package
|
|
783
|
+
* chose in the first place. The one thing the two signals DO share is the trace id, and it is
|
|
784
|
+
* shared structurally: a line carrying an `executionId` is stamped with the run's derived
|
|
785
|
+
* trace id, so a run's logs and its spans meet in the backend without either naming the other.
|
|
786
|
+
*
|
|
787
|
+
* That sharing is a CALL to `deriveTraceId`, not a second copy of what it does. The two signals
|
|
788
|
+
* agreeing is the whole feature and nothing else enforces it: a re-derivation here would let a
|
|
789
|
+
* change to the span side pass every test in this package while silently unjoining every log
|
|
790
|
+
* line from the run it belongs to.
|
|
791
|
+
*/
|
|
792
|
+
export function mapLogRecord(record) {
|
|
793
|
+
const executionId = record.fields.executionId;
|
|
794
|
+
// `deriveTraceId(null)` mints a RANDOM id, which is right for a span (it still needs a trace
|
|
795
|
+
// of its own) and wrong for a line: a run-less line belongs to no trace, and inventing one
|
|
796
|
+
// per line would fill the backend with single-entry traces. So the run-less case is the
|
|
797
|
+
// absent field, and only the derivation itself is shared.
|
|
798
|
+
const runTraceId = typeof executionId === 'string' && executionId ? deriveTraceId(executionId) : null;
|
|
799
|
+
return {
|
|
800
|
+
timeMs: record.timeMs,
|
|
801
|
+
severityNumber: LOG_SEVERITY_NUMBER[record.level],
|
|
802
|
+
severityText: LOG_SEVERITY_TEXT[record.level],
|
|
803
|
+
body: cap(record.msg),
|
|
804
|
+
attributes: logAttributes(record.fields),
|
|
805
|
+
...(runTraceId ? { traceId: runTraceId, traceFlags: TRACE_FLAG_SAMPLED } : {}),
|
|
806
|
+
};
|
|
807
|
+
}
|
|
653
808
|
//# sourceMappingURL=mapping.js.map
|
package/dist/mapping.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mapping.js","sourceRoot":"","sources":["../src/mapping.ts"],"names":[],"mappings":"AAaA,+EAA+E;AAC/E,qFAAqF;AACrF,yFAAyF;AACzF,iFAAiF;AACjF,yFAAyF;AACzF,4EAA4E;AAC5E,EAAE;AACF,uFAAuF;AACvF,yFAAyF;AACzF,+DAA+D;AAE/D,iFAAiF;AACjF,MAAM,CAAC,MAAM,oBAAoB,GAAG,aAAa,CAAA;AAEjD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,UAAU,GAAG,iCAAiC,CAAA;AAE3D;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,MAAM,EAAE,eAAe;IACvB,aAAa,EAAE,uBAAuB;IACtC,YAAY,EAAE,sBAAsB;IACpC,WAAW,EAAE,2BAA2B;IACxC,eAAe,EAAE,sCAAsC;IACvD,gBAAgB,EAAE,0CAA0C;IAC5D,YAAY,EAAE,4BAA4B;IAC1C,aAAa,EAAE,gCAAgC;IAC/C,SAAS,EAAE,mBAAmB;IAC9B,SAAS,EAAE,mBAAmB;IAC9B,QAAQ,EAAE,kBAAkB;IAC5B,WAAW,EAAE,0BAA0B;IACvC,SAAS,EAAE,wBAAwB;IACnC,WAAW,EAAE,0BAA0B;IACvC,QAAQ,EAAE,sBAAsB;IAChC,SAAS,EAAE,wBAAwB;IACnC,YAAY,EAAE,2BAA2B;IACzC,WAAW,EAAE,cAAc;CACnB,CAAA;AAEV;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,cAAc;CACnB,CAAA;AAEV;;;GAGG;AACH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';
|
|
3
|
-
/** An OTLP `AnyValue` in the JSON encoding (string / int / double / string list). */
|
|
3
|
+
/** An OTLP `AnyValue` in the JSON encoding (string / bool / int / double / string list). */
|
|
4
4
|
export type AnyValue = {
|
|
5
5
|
stringValue: string;
|
|
6
|
+
} | {
|
|
7
|
+
boolValue: boolean;
|
|
6
8
|
} | {
|
|
7
9
|
intValue: string;
|
|
8
10
|
} | {
|
package/dist/otlp.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otlp.d.ts","sourceRoot":"","sources":["../src/otlp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAWjD,
|
|
1
|
+
{"version":3,"file":"otlp.d.ts","sourceRoot":"","sources":["../src/otlp.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAkB,MAAM,cAAc,CAAA;AAChE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAWjD,4FAA4F;AAC5F,MAAM,MAAM,QAAQ,GAChB;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GACvB;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,GACtB;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,GACpB;IAAE,WAAW,EAAE,MAAM,CAAA;CAAE,GACvB;IAAE,UAAU,EAAE;QAAE,MAAM,EAAE,QAAQ,EAAE,CAAA;KAAE,CAAA;CAAE,CAAA;AAE1C,8CAA8C;AAC9C,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,QAAQ,CAAA;CAChB;AAcD,8DAA8D;AAC9D,wBAAgB,SAAS,CAAC,KAAK,EAAE,YAAY,GAAG,QAAQ,EAAE,CAEzD;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE;IACnC,SAAS,EAAE,OAAO,KAAK,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBhB"}
|
package/dist/otlp.js
CHANGED
|
@@ -13,6 +13,8 @@ function anyValue(value) {
|
|
|
13
13
|
if (typeof value === 'number') {
|
|
14
14
|
return Number.isInteger(value) ? { intValue: String(value) } : { doubleValue: value };
|
|
15
15
|
}
|
|
16
|
+
if (typeof value === 'boolean')
|
|
17
|
+
return { boolValue: value };
|
|
16
18
|
return { stringValue: value };
|
|
17
19
|
}
|
|
18
20
|
/** Encode a neutral attribute map as an OTLP `KeyValue[]`. */
|
package/dist/otlp.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"otlp.js","sourceRoot":"","sources":["../src/otlp.ts"],"names":[],"mappings":"AAGA,wFAAwF;AACxF,wFAAwF;AACxF,uFAAuF;AACvF,+EAA+E;AAC/E,mFAAmF;AAEnF,uFAAuF;AACvF,MAAM,eAAe,GAAG,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"otlp.js","sourceRoot":"","sources":["../src/otlp.ts"],"names":[],"mappings":"AAGA,wFAAwF;AACxF,wFAAwF;AACxF,uFAAuF;AACvF,+EAA+E;AAC/E,mFAAmF;AAEnF,uFAAuF;AACvF,MAAM,eAAe,GAAG,MAAM,CAAA;AAgB9B,gEAAgE;AAChE,SAAS,QAAQ,CAAC,KAAqB;IACrC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,EAAE,UAAU,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC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I,CAAC,oCAAoC,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAA;QAChG,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,iCAAiC,EAAE;YACnD,KAAK,EAAE,MAAM;YACb,GAAG,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;SACtD,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/observability-otel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Opt-in OpenTelemetry (OTLP) trace + metrics publisher for the Agent Architecture Board. Streams LLM generations and container tool spans to any OTLP/HTTP backend — the workerd-safe fetch exporter on the Cloudflare Worker facade, the official @opentelemetry/* SDK on Node — kept conformant by a shared mapping layer + tests. Also publishes deployment-level (platform-operator) run-health aggregates as OTLP gauge metrics.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"@opentelemetry/sdk-metrics": "^2.10.0",
|
|
36
36
|
"@opentelemetry/sdk-trace-base": "^2.10.0",
|
|
37
37
|
"@opentelemetry/sdk-trace-node": "^2.10.0",
|
|
38
|
-
"@cat-factory/contracts": "0.
|
|
39
|
-
"@cat-factory/kernel": "0.
|
|
38
|
+
"@cat-factory/contracts": "0.231.0",
|
|
39
|
+
"@cat-factory/kernel": "0.233.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"typescript": "7.0.2",
|