@cat-factory/observability-otel 0.5.2 → 0.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,16 +4,16 @@ Opt-in [OpenTelemetry](https://opentelemetry.io) (OTLP) trace + metrics publishe
|
|
|
4
4
|
Agent Architecture Board.
|
|
5
5
|
|
|
6
6
|
It implements the runtime-neutral `LlmTraceSink` port from `@cat-factory/kernel`, so when
|
|
7
|
-
wired into a facade every LLM call
|
|
8
|
-
inline calls (requirements review, document planner, fragment selector, inline agent)
|
|
7
|
+
wired into a facade every LLM call: container-agent calls (through the LLM proxy) **and**
|
|
8
|
+
inline calls (requirements review, document planner, fragment selector, inline agent):
|
|
9
9
|
is exported to any **OTLP/HTTP** backend (Grafana Tempo/Mimir, Honeycomb, Datadog OTLP,
|
|
10
10
|
Jaeger, an OpenTelemetry Collector, …) as:
|
|
11
11
|
|
|
12
12
|
- **a trace span per generation**, plus a span per container tool call, all grouped under a
|
|
13
|
-
shared per-run trace id (they are sibling spans sharing the trace, not parent/child
|
|
13
|
+
shared per-run trace id (they are sibling spans sharing the trace, not parent/child:
|
|
14
14
|
generations and tool calls arrive as independent, stateless emissions); and
|
|
15
|
-
- **metrics
|
|
16
|
-
`gen_ai.client.operation.duration` histogram
|
|
15
|
+
- **metrics**: a `gen_ai.client.token.usage` counter (input/output) and a
|
|
16
|
+
`gen_ai.client.operation.duration` histogram: following the OpenTelemetry GenAI
|
|
17
17
|
semantic conventions.
|
|
18
18
|
|
|
19
19
|
## Two transports, one behaviour
|
|
@@ -29,7 +29,7 @@ port:
|
|
|
29
29
|
|
|
30
30
|
Both map events through the **same** `src/mapping.ts` layer, so they emit identical span
|
|
31
31
|
names, attributes, trace-id grouping and metric names/units. `src/conformity.test.ts`
|
|
32
|
-
feeds the same events through both and asserts the emitted telemetry matches
|
|
32
|
+
feeds the same events through both and asserts the emitted telemetry matches: the guard
|
|
33
33
|
that the transports never drift.
|
|
34
34
|
|
|
35
35
|
The Worker entry (`.`) never imports `@opentelemetry/*`, so the SDK is kept out of the
|
|
@@ -43,7 +43,7 @@ workerd bundle; it depends only on the `fetch`/`crypto` globals.
|
|
|
43
43
|
prompt recording is off, spans carry usage/timing/attributes but no prompt or response
|
|
44
44
|
bodies.
|
|
45
45
|
- Composes **alongside** the Langfuse sink (`@cat-factory/observability-langfuse`) via the
|
|
46
|
-
kernel `composeTraceSinks` fan-out
|
|
46
|
+
kernel `composeTraceSinks` fan-out: a deployment can export to both at once.
|
|
47
47
|
|
|
48
48
|
## Usage
|
|
49
49
|
|
|
@@ -75,11 +75,11 @@ The per-call sink above answers "what did THIS run do". The **`PlatformMetricsOt
|
|
|
75
75
|
(`createPlatformMetricsOtelExporter`, the `.` entry) answers "how is the WHOLE deployment
|
|
76
76
|
doing": a periodic sweep (Worker `scheduled` cron ⇄ Node interval, runtime-symmetric) computes
|
|
77
77
|
the platform-observability projection per account and this exporter pushes it to the same
|
|
78
|
-
OTLP endpoint as OpenTelemetry **gauge** metrics
|
|
78
|
+
OTLP endpoint as OpenTelemetry **gauge** metrics, so an operator watches deployment health in
|
|
79
79
|
their own metrics backend, the dual of the `post-release-health` gate that watches the
|
|
80
80
|
_user's_ release.
|
|
81
81
|
|
|
82
|
-
Metrics (`cat_factory.platform.*`, all gauges
|
|
82
|
+
Metrics (`cat_factory.platform.*`, all gauges: the OTel backend trends the series over time):
|
|
83
83
|
|
|
84
84
|
| Metric | Unit | Split dimension |
|
|
85
85
|
| --------------------------------------- | ------- | --------------------------- |
|
|
@@ -89,7 +89,7 @@ Metrics (`cat_factory.platform.*`, all gauges — the OTel backend trends the se
|
|
|
89
89
|
| `cat_factory.platform.live_runs` | `{run}` | `cat_factory.run_state` |
|
|
90
90
|
| `cat_factory.platform.run_duration` | `s` | `cat_factory.duration_stat` |
|
|
91
91
|
|
|
92
|
-
Every point carries `cat_factory.account_id` (the bounded tenant scope
|
|
92
|
+
Every point carries `cat_factory.account_id` (the bounded tenant scope: safe on a metric,
|
|
93
93
|
unlike the unbounded workspace id excluded from the per-call metrics); the windowed gauges
|
|
94
94
|
also carry `cat_factory.window`. Null aggregates (a success rate / percentiles with no
|
|
95
95
|
terminal runs) are omitted rather than emitted as a misleading zero.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cat-factory/observability-otel",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.3",
|
|
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.215.0",
|
|
39
|
+
"@cat-factory/kernel": "0.218.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"typescript": "7.0.2",
|