@cat-factory/observability-otel 0.5.7 → 0.7.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 CHANGED
@@ -9,13 +9,75 @@ inline calls (requirements review, document planner, fragment selector, inline a
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
- - **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:
14
- generations and tool calls arrive as independent, stateless emissions); and
12
+ - **a trace span per generation**, plus a span per container tool call, arranged into a
13
+ per-run **hierarchy** (`run agent kind generations + tool calls`); and
15
14
  - **metrics**: a `gen_ai.client.token.usage` counter (input/output) and a
16
15
  `gen_ai.client.operation.duration` histogram: following the OpenTelemetry GenAI
17
16
  semantic conventions.
18
17
 
18
+ ## Span hierarchy
19
+
20
+ A run's spans form a tree, not a flat set of siblings sharing a trace id:
21
+
22
+ ```
23
+ run (root; the whole execution, INTERNAL)
24
+ ├── invoke_agent coder (one per agent KIND that ran, INTERNAL)
25
+ │ ├── chat claude-sonnet-4-5 (one per LLM call, CLIENT)
26
+ │ ├── execute_tool edit_file (one per container tool call, INTERNAL)
27
+ │ └── execute_tool run_command
28
+ └── invoke_agent ci (a gate step)
29
+ └── invoke_agent ci-fixer (a HELPER the gate escalated to, nested under it)
30
+ └── chat claude-sonnet-4-5
31
+ ```
32
+
33
+ Nothing is buffered to build it. **Every parent id is a pure function of the run id**
34
+ (`deriveRunSpanId` / `deriveStepSpanId` in `src/mapping.ts`), so a generation recorded by the
35
+ LLM proxy on one isolate and a tool span drained by the engine on another both name the same
36
+ parent without either having seen it, and a durable replay re-derives the identical tree
37
+ rather than a duplicate one. The parents themselves are emitted **once, when the run settles**
38
+ (`LlmTraceSink.recordRunSpans`, driven from the engine's single terminal hook), which is when
39
+ its boundaries are first known. Children therefore export before their parent: the ordinary
40
+ OpenTelemetry ordering, where a parent outlives what it contains, just over a longer span of
41
+ time than usual.
42
+
43
+ Two consequences worth knowing:
44
+
45
+ - **The step level's grain is `(run, agent kind)`, not `(run, step index)`**, because the agent
46
+ kind is the finest thing an `LlmGenerationEvent` can name — a per-step parent would be
47
+ unaddressable from the very spans meant to hang under it. It is also the grain the rest of the
48
+ LLM telemetry buckets by (the prompt-chain key, the `(agentKind, phase)` rollup). A pipeline
49
+ running two `coder` steps folds them into one span carrying `cat_factory.step_count: 2`, so a
50
+ reader is told about the fold rather than seeing one long step.
51
+ - **A standalone inline call stays a root.** Requirements review, the doc planner and the
52
+ fragment selector run outside any execution, so they have no run to hang under and no parent
53
+ is claimed — rather than pointing at one that will never be emitted.
54
+ - **A HELPER kind gets its own span, nested under the step that dispatched it.** A step often
55
+ runs work under a kind that is not its own: a gate escalating to `ci-fixer` /
56
+ `conflict-resolver` / `on-call`, a Tester handing off to the fixer, a two-phase coder's
57
+ `fork-proposer`. Every telemetry row that work produces is tagged with the HELPER's kind, so
58
+ without a span of its own each of those would name a parent nobody emits and dangle inside its
59
+ own run's trace. The run records what it dispatched (`PipelineStep.dispatches`), and the helper
60
+ inherits its host step's window: a parent is required to contain its children, and the host's
61
+ window is the tightest bound the run actually recorded.
62
+
63
+ ### Cycles: counted, not separated
64
+
65
+ The repetition these runs actually contain is cyclical rather than duplicated. A pipeline with
66
+ two steps of one kind is rare (no built-in has one); a review that spawns fixes four times, a
67
+ Ralph loop that iterates seven, a bounced step re-run on a judge's verdict are all ordinary.
68
+
69
+ A span cannot separate those rounds, because the events hanging under it carry no attempt ordinal
70
+ to be separated BY — threading one reaches the proxy URL contract and the harness, so it is a
71
+ deliberate non-goal here. What is NOT acceptable is letting the fold pass silently, so each step
72
+ span states both of its collapses: `cat_factory.step_count` (steps of this kind) and
73
+ `cat_factory.attempt_count` (dispatches inside them). Converging in one round and thrashing
74
+ through six are otherwise the same picture, and that picture is what an operator is looking for.
75
+
76
+ The extent is stated honestly across rounds too: a re-run step's span starts at
77
+ `PipelineStep.firstStartedAt`, which survives the reset that re-stamps `startedAt`. Without it a
78
+ bounced step's parent would begin AFTER the generations of its own earlier attempts, which still
79
+ name it.
80
+
19
81
  ## Two transports, one behaviour
20
82
 
21
83
  The Cloudflare Worker runtime (workerd) cannot run the official `@opentelemetry/*` SDK
@@ -69,6 +131,83 @@ Wired into a facade via its container's `buildTraceSink(config)`; absent config
69
131
  `OTEL_ENABLED=true` + endpoint) ⇒ the sink is never built and there is no external
70
132
  emission or behaviour change.
71
133
 
134
+ ## GenAI semantic-convention coverage
135
+
136
+ The OpenTelemetry GenAI semantic conventions are still **experimental**, so this section states
137
+ exactly what is claimed rather than leaving a reader to diff the emitted attributes against a
138
+ moving spec. `src/mapping.ts`'s `ATTR` object and this table are edited together.
139
+
140
+ **Emitted, per the convention:**
141
+
142
+ | Attribute / signal | Where | Notes |
143
+ | ---------------------------------- | ------------------------- | --------------------------------------------------------------- |
144
+ | `gen_ai.operation.name` | generation / tool / step | `chat` / `execute_tool` / `invoke_agent` |
145
+ | `gen_ai.system` | generation span + metrics | the provider (`anthropic`, `openai`, `workers-ai`, …) |
146
+ | `gen_ai.request.model` | generation span + metrics | the model asked for |
147
+ | `gen_ai.usage.input_tokens` | generation span | FRESH input only; the cache classes are separate (see below) |
148
+ | `gen_ai.usage.output_tokens` | generation span | |
149
+ | `gen_ai.response.finish_reasons` | generation span | a one-element list; omitted when upstream reported none |
150
+ | `gen_ai.agent.name` | step span | the agent kind |
151
+ | `gen_ai.tool.name` | tool span | |
152
+ | `gen_ai.client.token.usage` | counter, `{token}`, DELTA | split by `gen_ai.token.type` |
153
+ | `gen_ai.client.operation.duration` | histogram, `s`, DELTA | |
154
+ | span name `{operation} {model}` | generation span | e.g. `chat claude-sonnet-4-5`; other names stay low-cardinality |
155
+
156
+ **Extended beyond the convention**, because the convention has no equivalent and the fact is
157
+ load-bearing here:
158
+
159
+ | Attribute | Why it exists |
160
+ | ------------------------------------------------------- | ----------------------------------------------------------------------------------- |
161
+ | `gen_ai.usage.cache_read_input_tokens` | The convention lumps input into one count. These are priced ~0.1x and ~1.25–2x |
162
+ | `gen_ai.usage.cache_creation_input_tokens` | base input, so summing them hides whether a loop rides a warm cache or rewrites it. |
163
+ | `gen_ai.token.type` values `cache_read` / `cache_write` | The same split on the counter's dimension. |
164
+ | `cat_factory.workspace_id` | Tenant scope. Spans only — unbounded, so never a metric dimension. |
165
+ | `cat_factory.execution_id` | The run. Searchable, since the trace id is a hash of it rather than the id itself. |
166
+ | `cat_factory.agent_kind` | Kept beside `gen_ai.agent.name` because it is also a bounded METRIC dimension. |
167
+ | `cat_factory.pipeline` / `cat_factory.step_count` | The run span's pipeline, and the step span's fold size. |
168
+ | `cat_factory.attempt_count` | Dispatches folded into a step span: the rounds of a loop, stated since not split. |
169
+
170
+ **Deliberately NOT emitted**, each for a reason rather than an oversight:
171
+
172
+ - **`gen_ai.request.*` sampling parameters** (`temperature`, `top_p`, `max_tokens`, …). The event
173
+ that reaches this package carries none of them: the proxied path records what the upstream
174
+ returned, and the subscription harnesses lift metrics off a CLI's event stream, which never
175
+ reports the ceiling it applied. Emitting defaults would state a request nobody made.
176
+ - **`gen_ai.response.model` / `gen_ai.response.id`.** A single `model` field rides the event, and
177
+ it is the model the provider says SERVED the call where the transport reports one. Emitting it
178
+ as both request and response would fabricate agreement between two facts we only have one of.
179
+ - **`gen_ai.conversation.id`.** `cat_factory.execution_id` already scopes it, and the run is the
180
+ unit the rest of the platform threads a conversation by.
181
+ - **The log-based `gen_ai.client.inference.operation.details` event.** Prompt and completion
182
+ bodies ride the older span events `gen_ai.content.prompt` / `gen_ai.content.completion`, which
183
+ every OTLP backend in the compatibility list above renders today. They are emitted only when
184
+ `LLM_RECORD_PROMPTS` is on; an empty body is omitted rather than sent blank.
185
+ - **`gen_ai.operation.name` on the RUN span.** A pipeline run is orchestration: it spends most of
186
+ its wall clock waiting on CI and on humans. Claiming a GenAI operation for it would put that
187
+ wait onto an operator's GenAI dashboards.
188
+ - **The pipeline name in the run span's NAME.** The root span is named the bare `run`, with the
189
+ pipeline as `cat_factory.pipeline`. A span name is the one field a backend treats as a
190
+ low-cardinality class (it keys the RED metrics a span-metrics connector derives), which is the
191
+ trace-side counterpart of the rule that a metric dimension must be bounded. Every other name
192
+ here is a closed vocabulary (an operation, a model, an agent kind, a tool); a pipeline is
193
+ workspace-authored free text, so interpolating it would let a tenant mint unbounded series on
194
+ an operator's backend just by renaming pipelines.
195
+
196
+ ## Replaying a settled run
197
+
198
+ The parents are emitted from the engine's terminal hook, which fires again for a run that has
199
+ already settled (a durable re-drive, a decision resolved against a finished run). That is safe by
200
+ construction rather than by a claim table, and both halves are load-bearing:
201
+
202
+ - **The ids are derived**, so a re-emission names the same spans rather than minting a second
203
+ tree beside the first.
204
+ - **The extent is folded from stamps the run recorded** (`buildRunTraceSpans` in orchestration),
205
+ never from a clock read at emit time. Both are set-once so a replay cannot move them: a `done`
206
+ run is bounded by its last step's `finishedAt`, a failed one by `AgentFailure.occurredAt`, and a
207
+ step still in flight by its heartbeat. Pairing stable span ids with a duration that changed
208
+ between emissions would give a backend a contradiction to store where it can collapse a
209
+ byte-identical duplicate.
210
+
72
211
  ## Platform-operator metrics (deployment health)
73
212
 
74
213
  The per-call sink above answers "what did THIS run do". The **`PlatformMetricsOtelExporter`**
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { LlmGenerationEvent, LlmToolSpan, LlmToolSpanContext, LlmTraceSink, Logger } from '@cat-factory/kernel';
1
+ import type { LlmGenerationEvent, LlmRunSpan, LlmStepSpan, LlmToolSpan, LlmToolSpanContext, LlmTraceSink, Logger } from '@cat-factory/kernel';
2
2
  export interface OtelSinkConfig {
3
3
  /** OTLP/HTTP base URL, e.g. `http://collector:4318` (the `/v1/*` paths are appended). */
4
4
  endpoint: string;
@@ -22,6 +22,12 @@ export declare class OtelTraceSink implements LlmTraceSink {
22
22
  private resourceAttributes;
23
23
  recordGeneration(event: LlmGenerationEvent): Promise<void>;
24
24
  recordToolSpans(context: LlmToolSpanContext, spans: LlmToolSpan[]): Promise<void>;
25
+ /**
26
+ * The settled run's root + step spans, in ONE POST: they are the parents the run's already
27
+ * exported generations and tool spans named, so splitting them across requests would let a
28
+ * partial failure leave a trace whose steps point at a root that never arrives.
29
+ */
30
+ recordRunSpans(run: LlmRunSpan, steps: LlmStepSpan[]): Promise<void>;
25
31
  private sendSpans;
26
32
  private sendMetrics;
27
33
  private send;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,MAAM,EACP,MAAM,qBAAqB,CAAA;AAyC5B,MAAM,WAAW,cAAc;IAC7B,yFAAyF;IACzF,QAAQ,EAAE,MAAM,CAAA;IAChB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gEAAgE;IAChE,SAAS,CAAC,EAAE,OAAO,KAAK,CAAA;CACzB;AAwBD,qBAAa,aAAc,YAAW,YAAY;IAChD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAQ;IACvC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAQ;IACxC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAChD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAQ;IACpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAQ;IAChC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAc;IAExC,YAAY,MAAM,EAAE,cAAc,EAQjC;IAED,OAAO,CAAC,kBAAkB;IAIpB,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CA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AE1D,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"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ATTR, DEFAULT_SERVICE_NAME, DURATION_UNIT, METRIC, SCOPE_NAME, TOKEN_UNIT, mapGeneration, mapGenerationMetrics, mapToolSpan, randomSpanId, toUnixNano, } from './mapping.js';
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
3
  // A fetch-based OpenTelemetry exporter that speaks OTLP/HTTP with the **JSON** encoding
4
4
  // (`POST {endpoint}/v1/traces` and `/v1/metrics`) using only the global `fetch`/`crypto`.
@@ -16,19 +16,19 @@ import { keyValues, postOtlp } from './otlp.js';
16
16
  // emitted with DELTA temporality so a single call is a valid, self-contained data point.
17
17
  /** OTLP `AggregationTemporality.DELTA` (proto enum value). */
18
18
  const TEMPORALITY_DELTA = 1;
19
- /** OTLP span kind CLIENT / INTERNAL (proto enum values). */
20
- const SPAN_KIND_CLIENT = 3;
21
- const SPAN_KIND_INTERNAL = 1;
19
+ /** OTLP span-kind proto enum values, per the neutral kind the mapping layer decides. */
20
+ const SPAN_KIND = { internal: 1, client: 3 };
22
21
  /** OTLP status codes: UNSET / ERROR. */
23
22
  const STATUS_UNSET = 0;
24
23
  const STATUS_ERROR = 2;
25
24
  // ---- OTLP/JSON encoding helpers -------------------------------------------
26
- function encodeSpan(span, kind) {
25
+ function encodeSpan(span) {
27
26
  return {
28
27
  traceId: span.traceId,
29
- spanId: randomSpanId(),
28
+ spanId: span.spanId,
29
+ ...(span.parentSpanId ? { parentSpanId: span.parentSpanId } : {}),
30
30
  name: span.name,
31
- kind,
31
+ kind: SPAN_KIND[span.kind],
32
32
  startTimeUnixNano: toUnixNano(span.startTimeMs),
33
33
  endTimeUnixNano: toUnixNano(span.endTimeMs),
34
34
  attributes: keyValues(span.attributes),
@@ -65,15 +65,23 @@ export class OtelTraceSink {
65
65
  const span = mapGeneration(event);
66
66
  const metrics = mapGenerationMetrics(event);
67
67
  // Traces and metrics go to distinct OTLP endpoints (two POSTs), each best-effort.
68
- await Promise.all([this.sendSpans([span], SPAN_KIND_CLIENT), this.sendMetrics(metrics)]);
68
+ await Promise.all([this.sendSpans([span]), this.sendMetrics(metrics)]);
69
69
  }
70
70
  async recordToolSpans(context, spans) {
71
71
  // Tool spans are only meaningful as children of a run's trace.
72
72
  if (!context.executionId || spans.length === 0)
73
73
  return;
74
- await this.sendSpans(spans.map((span) => mapToolSpan(context, span)), SPAN_KIND_INTERNAL);
74
+ await this.sendSpans(spans.map((span) => mapToolSpan(context, span)));
75
75
  }
76
- async sendSpans(spans, kind) {
76
+ /**
77
+ * The settled run's root + step spans, in ONE POST: they are the parents the run's already
78
+ * exported generations and tool spans named, so splitting them across requests would let a
79
+ * partial failure leave a trace whose steps point at a root that never arrives.
80
+ */
81
+ async recordRunSpans(run, steps) {
82
+ await this.sendSpans([mapRunSpan(run), ...steps.map(mapStepSpan)]);
83
+ }
84
+ async sendSpans(spans) {
77
85
  const payload = {
78
86
  resourceSpans: [
79
87
  {
@@ -81,7 +89,7 @@ export class OtelTraceSink {
81
89
  scopeSpans: [
82
90
  {
83
91
  scope: { name: SCOPE_NAME },
84
- spans: spans.map((span) => encodeSpan(span, kind)),
92
+ spans: spans.map(encodeSpan),
85
93
  },
86
94
  ],
87
95
  },
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAEL,IAAI,EACJ,oBAAoB,EACpB,aAAa,EACb,MAAM,EACN,UAAU,EACV,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,UAAU,GACX,MAAM,cAAc,CAAA;AACrB,OAAO,EAAiB,SAAS,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAE9D,wFAAwF;AACxF,0FAA0F;AAC1F,2FAA2F;AAC3F,uFAAuF;AACvF,0FAA0F;AAC1F,0FAA0F;AAC1F,mFAAmF;AACnF,EAAE;AACF,yFAAyF;AACzF,uFAAuF;AACvF,uFAAuF;AACvF,0FAA0F;AAC1F,uFAAuF;AACvF,yFAAyF;AAEzF,8DAA8D;AAC9D,MAAM,iBAAiB,GAAG,CAAC,CAAA;AAC3B,4DAA4D;AAC5D,MAAM,gBAAgB,GAAG,CAAC,CAAA;AAC1B,MAAM,kBAAkB,GAAG,CAAC,CAAA;AAC5B,wCAAwC;AACxC,MAAM,YAAY,GAAG,CAAC,CAAA;AACtB,MAAM,YAAY,GAAG,CAAC,CAAA;AAetB,8EAA8E;AAE9E,SAAS,UAAU,CAAC,IAAgB,EAAE,IAAY;IAChD,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,MAAM,EAAE,YAAY,EAAE;QACtB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,IAAI;QACJ,iBAAiB,EAAE,UAAU,CAAC,IAAI,CAAC,WAAW,CAAC;QAC/C,eAAe,EAAE,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC;QAC3C,UAAU,EAAE,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC;QACtC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAA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C,OAAO,CAAC,CAAC,CAAC,SAAS,CAAA;AAC1D,CAAC;AAED,+EAA+E;AAE/E,uFAAuF;AACvF,MAAM,CAAC,MAAM,oCAAoC,GAAG,MAAM,CAAA;AAE1D,0EAA0E;AAC1E,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAU,CAAA;AAGpE;;;;GAIG;AACH,MAAM,UAAU,8BAA8B,CAAC,GAAuB;IACpE,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;;;;GAIG;AACH,MAAM,UAAU,0BAA0B,CAAC,GAAuB;IAChE,MAAM,CAAC,GAAG,GAAG,EAAE,IAAI,EAAE,CAAA;IACrB,OAAO,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAC7C,CAAC"}
package/dist/mapping.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { LlmGenerationEvent, LlmToolSpan, LlmToolSpanContext, OperationalCounter, OperationalCounterSample, OperationalGauge, OperationalGaugeSample } from '@cat-factory/kernel';
1
+ import type { LlmGenerationEvent, LlmRunSpan, LlmStepSpan, LlmToolSpan, LlmToolSpanContext, 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";
@@ -7,10 +7,13 @@ export declare const SCOPE_NAME = "@cat-factory/observability-otel";
7
7
  /**
8
8
  * Attribute keys, following the OpenTelemetry GenAI semantic conventions where they exist
9
9
  * (`gen_ai.*`) plus a small `cat_factory.*` namespace for our own dimensions. Centralised
10
- * so the two transports can never disagree on a key.
10
+ * so the two transports can never disagree on a key. What of the convention we cover, what
11
+ * we deliberately omit, and where we extend it is documented per key in the README's "GenAI
12
+ * semantic-convention coverage" table — that table and this object are edited together.
11
13
  */
12
14
  export declare const ATTR: {
13
15
  readonly system: 'gen_ai.system';
16
+ readonly operationName: 'gen_ai.operation.name';
14
17
  readonly requestModel: 'gen_ai.request.model';
15
18
  readonly inputTokens: 'gen_ai.usage.input_tokens';
16
19
  readonly cacheReadTokens: 'gen_ai.usage.cache_read_input_tokens';
@@ -18,10 +21,33 @@ export declare const ATTR: {
18
21
  readonly outputTokens: 'gen_ai.usage.output_tokens';
19
22
  readonly finishReasons: 'gen_ai.response.finish_reasons';
20
23
  readonly tokenType: 'gen_ai.token.type';
24
+ readonly agentName: 'gen_ai.agent.name';
25
+ readonly toolName: 'gen_ai.tool.name';
21
26
  readonly workspaceId: 'cat_factory.workspace_id';
22
27
  readonly agentKind: 'cat_factory.agent_kind';
28
+ readonly executionId: 'cat_factory.execution_id';
29
+ readonly pipeline: 'cat_factory.pipeline';
30
+ readonly stepCount: 'cat_factory.step_count';
31
+ readonly attemptCount: 'cat_factory.attempt_count';
23
32
  readonly serviceName: 'service.name';
24
33
  };
34
+ /**
35
+ * The `gen_ai.operation.name` values we emit. The convention's registry is open, but every
36
+ * value here is one of its own: `chat` for a model call, `execute_tool` for a tool
37
+ * invocation, `invoke_agent` for an agent's whole turn (our step span). A run's ROOT span
38
+ * carries none of them on purpose — a pipeline run is not a GenAI operation, so claiming one
39
+ * would put non-model work on an operator's GenAI dashboards.
40
+ */
41
+ export declare const OPERATION: {
42
+ readonly chat: 'chat';
43
+ readonly executeTool: 'execute_tool';
44
+ readonly invokeAgent: 'invoke_agent';
45
+ };
46
+ /**
47
+ * The run root span's name. A constant rather than an interpolation, because a span name is a
48
+ * low-cardinality CLASS; see {@link mapRunSpan} for why the pipeline stays an attribute.
49
+ */
50
+ export declare const RUN_SPAN_NAME = "run";
25
51
  /** Metric names + units (OTel GenAI client metrics). */
26
52
  export declare const METRIC: {
27
53
  readonly tokenUsage: 'gen_ai.client.token.usage';
@@ -38,11 +64,26 @@ interface MappedEvent {
38
64
  timeMs: number;
39
65
  attributes: AttributeMap;
40
66
  }
67
+ /**
68
+ * Which OTel span kind a mapped span carries, named neutrally so the two transports each
69
+ * translate it into their own enum instead of the caller passing a proto number to one and an
70
+ * SDK enum to the other (which is a way for them to silently disagree).
71
+ */
72
+ export type MappedSpanKind = 'client' | 'internal';
41
73
  /** A transport-neutral span, ready to encode as OTLP JSON or feed the SDK tracer. */
42
74
  export interface MappedSpan {
43
- /** 32-hex trace id (a run's calls share one; standalone calls get a random one). */
75
+ /** 32-hex trace id (a run's spans share one; standalone calls get a random one). */
44
76
  traceId: string;
77
+ /** 16-hex span id. Random for a leaf; DERIVED for a parent (see {@link deriveRunSpanId}). */
78
+ spanId: string;
79
+ /**
80
+ * 16-hex id of this span's parent, or undefined for a root. A leaf names its parent by
81
+ * DERIVING the id rather than by having been told it, which is what lets a stateless
82
+ * per-call emission take part in a hierarchy assembled by the backend.
83
+ */
84
+ parentSpanId?: string;
45
85
  name: string;
86
+ kind: MappedSpanKind;
46
87
  /** Epoch ms. */
47
88
  startTimeMs: number;
48
89
  /** Epoch ms. */
@@ -70,6 +111,14 @@ export interface MappedMetrics {
70
111
  }
71
112
  export declare function randomTraceId(): string;
72
113
  export declare function randomSpanId(): string;
114
+ /** The DERIVED span id of a run's root span. */
115
+ export declare function deriveRunSpanId(executionId: string): string;
116
+ /**
117
+ * The DERIVED span id of one `(run, agent kind)` step span — the parent every generation and
118
+ * tool span of that kind hangs under. Keyed on the agent kind because that is all a generation
119
+ * event carries; see `LlmStepSpan` for why that grain is the right one rather than a compromise.
120
+ */
121
+ export declare function deriveStepSpanId(executionId: string, agentKind: string): string;
73
122
  /** Epoch ms → OTLP unix-nano string (string arithmetic avoids float precision loss). */
74
123
  export declare function toUnixNano(ms: number): string;
75
124
  /** Map one completed LLM call to a neutral span. */
@@ -88,6 +137,18 @@ export declare const PLATFORM_METRIC: {
88
137
  readonly liveRuns: 'cat_factory.platform.live_runs';
89
138
  /** Windowed wall-clock run duration (seconds), split by statistic (avg/min/max/pNN). */
90
139
  readonly runDuration: 'cat_factory.platform.run_duration';
140
+ /**
141
+ * Windowed count of SETTLED polling gates, split by gate kind and how it settled
142
+ * (`passed` / `exhausted` / `clean`, the last being a pass that spun up no helper at all,
143
+ * which is a separate series precisely because it is the one the precheck-first design is
144
+ * supposed to maximise).
145
+ */
146
+ readonly gates: 'cat_factory.platform.gates';
147
+ /**
148
+ * Windowed count of helper-agent dispatches those gates spent (the CI-fixer attempt count),
149
+ * split by gate kind and by whether the helper's own job succeeded or failed.
150
+ */
151
+ readonly gateAttempts: 'cat_factory.platform.gate_attempts';
91
152
  };
92
153
  /**
93
154
  * Attribute keys for the platform metrics. `account_id` is the tenant scope (bounded — the
@@ -102,9 +163,16 @@ export declare const PLATFORM_ATTR: {
102
163
  readonly runState: 'cat_factory.run_state';
103
164
  readonly failureKind: 'cat_factory.failure_kind';
104
165
  readonly durationStat: 'cat_factory.duration_stat';
166
+ /** The gate step's agent kind (`ci` / `conflicts` / …): a registry key, so bounded. */
167
+ readonly gateKind: 'cat_factory.gate_kind';
168
+ /** How a settled gate ended, or how a helper dispatch did. A closed vocabulary. */
169
+ readonly gateOutcome: 'cat_factory.gate_outcome';
105
170
  };
106
171
  /** Metric units: a dimensionless run count, a dimensionless ratio, and seconds. */
107
172
  export declare const RUN_UNIT = "{run}";
173
+ /** The unit of the settled-gate gauges (a gate, and a helper dispatch against one). */
174
+ export declare const GATE_UNIT = "{gate}";
175
+ export declare const GATE_ATTEMPT_UNIT = "{attempt}";
108
176
  export declare const RATIO_UNIT = "1";
109
177
  /** The unit of the operational queue-depth gauge (live, dead-lettered, or otherwise). */
110
178
  export declare const JOB_UNIT = "{job}";
@@ -131,8 +199,32 @@ export interface MappedGauge {
131
199
  export declare function mapPlatformMetrics(snapshot: PlatformObservability, dims: {
132
200
  accountId: string;
133
201
  }): MappedGauge[];
134
- /** Map one container tool call to a neutral span under its run's trace. */
202
+ /** Map one container tool call to a neutral span under its agent kind's step span. */
135
203
  export declare function mapToolSpan(context: LlmToolSpanContext, span: LlmToolSpan): MappedSpan;
204
+ /**
205
+ * Map a settled run to its ROOT span: the ancestor of every step span, and transitively of
206
+ * every generation and tool span the run emitted.
207
+ *
208
+ * It carries no `gen_ai.operation.name`. A pipeline run is orchestration, not a model
209
+ * operation, and stamping one would file the wait on a human decision as GenAI activity.
210
+ *
211
+ * The name is the bare `run`, with the pipeline riding as `cat_factory.pipeline` rather than
212
+ * interpolated into it. A span name is the one field a backend treats as a low-cardinality
213
+ * CLASS: it keys the RED metrics a span-metrics connector derives, and the trace-side
214
+ * counterpart of the rule that a metric dimension must be BOUNDED. Every other name here is a
215
+ * closed vocabulary (an operation, a model, an agent kind, a tool), but a pipeline is
216
+ * workspace-authored free text, so interpolating it would let a tenant mint an unbounded
217
+ * number of series on an operator's backend by renaming pipelines.
218
+ */
219
+ export declare function mapRunSpan(run: LlmRunSpan): MappedSpan;
220
+ /**
221
+ * Map one `(run, agent kind)` slice to the step span its generations and tool calls hang under.
222
+ *
223
+ * A HELPER kind (a gate's `ci-fixer`, a Tester's fixer, a `fork-proposer`) names its hosting
224
+ * kind as parent instead of the run, so an escalation reads as what it is rather than as a
225
+ * pipeline step of its own.
226
+ */
227
+ export declare function mapStepSpan(step: LlmStepSpan): MappedSpan;
136
228
  /**
137
229
  * Metric name per operational counter. An exhaustive `Record` over the kernel union, so
138
230
  * adding a counter there fails to compile until it is named here — the same guard the
@@ -1 +1 @@
1
- {"version":3,"file":"mapping.d.ts","sourceRoot":"","sources":["../src/mapping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX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AA;IACZ,MAAM,EAAE,gBAAgB,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"}
package/dist/mapping.js CHANGED
@@ -15,10 +15,13 @@ export const SCOPE_NAME = '@cat-factory/observability-otel';
15
15
  /**
16
16
  * Attribute keys, following the OpenTelemetry GenAI semantic conventions where they exist
17
17
  * (`gen_ai.*`) plus a small `cat_factory.*` namespace for our own dimensions. Centralised
18
- * so the two transports can never disagree on a key.
18
+ * so the two transports can never disagree on a key. What of the convention we cover, what
19
+ * we deliberately omit, and where we extend it is documented per key in the README's "GenAI
20
+ * semantic-convention coverage" table — that table and this object are edited together.
19
21
  */
20
22
  export const ATTR = {
21
23
  system: 'gen_ai.system',
24
+ operationName: 'gen_ai.operation.name',
22
25
  requestModel: 'gen_ai.request.model',
23
26
  inputTokens: 'gen_ai.usage.input_tokens',
24
27
  cacheReadTokens: 'gen_ai.usage.cache_read_input_tokens',
@@ -26,10 +29,33 @@ export const ATTR = {
26
29
  outputTokens: 'gen_ai.usage.output_tokens',
27
30
  finishReasons: 'gen_ai.response.finish_reasons',
28
31
  tokenType: 'gen_ai.token.type',
32
+ agentName: 'gen_ai.agent.name',
33
+ toolName: 'gen_ai.tool.name',
29
34
  workspaceId: 'cat_factory.workspace_id',
30
35
  agentKind: 'cat_factory.agent_kind',
36
+ executionId: 'cat_factory.execution_id',
37
+ pipeline: 'cat_factory.pipeline',
38
+ stepCount: 'cat_factory.step_count',
39
+ attemptCount: 'cat_factory.attempt_count',
31
40
  serviceName: 'service.name',
32
41
  };
42
+ /**
43
+ * The `gen_ai.operation.name` values we emit. The convention's registry is open, but every
44
+ * value here is one of its own: `chat` for a model call, `execute_tool` for a tool
45
+ * invocation, `invoke_agent` for an agent's whole turn (our step span). A run's ROOT span
46
+ * carries none of them on purpose — a pipeline run is not a GenAI operation, so claiming one
47
+ * would put non-model work on an operator's GenAI dashboards.
48
+ */
49
+ export const OPERATION = {
50
+ chat: 'chat',
51
+ executeTool: 'execute_tool',
52
+ invokeAgent: 'invoke_agent',
53
+ };
54
+ /**
55
+ * The run root span's name. A constant rather than an interpolation, because a span name is a
56
+ * low-cardinality CLASS; see {@link mapRunSpan} for why the pipeline stays an attribute.
57
+ */
58
+ export const RUN_SPAN_NAME = 'run';
33
59
  /** Metric names + units (OTel GenAI client metrics). */
34
60
  export const METRIC = {
35
61
  tokenUsage: 'gen_ai.client.token.usage',
@@ -60,6 +86,14 @@ function randomHex(bytes) {
60
86
  * SAME trace id and the backend groups them into one trace — the fetch and SDK transports
61
87
  * therefore agree without sharing state. FNV-1a, re-hashed with a counter salt to fill the
62
88
  * width. Guaranteed non-zero (OTLP rejects an all-zero id).
89
+ *
90
+ * A SPREADING function, not a cryptographic one, and the ids it derives are chosen so that is
91
+ * enough: the only ones that must not collide are the handful within a single trace (one run
92
+ * span plus one step span per agent kind, each keyed on a distinct prefixed string), and a
93
+ * trace id collides only across two different execution ids over the full 128 bits. Nothing
94
+ * here is a security boundary, and no leaf span id comes from it: those are `randomSpanId`.
95
+ * A collision-resistant hash would be the right answer the moment an id is derived from
96
+ * something an untrusted party chooses.
63
97
  */
64
98
  function hashHex(input, bytes) {
65
99
  let out = '';
@@ -85,6 +119,28 @@ export function randomSpanId() {
85
119
  function deriveTraceId(executionId) {
86
120
  return executionId ? hashHex(executionId, 16) : randomTraceId();
87
121
  }
122
+ // The span hierarchy is `run → agent-kind step → (generations, tool calls)`, and it is built
123
+ // WITHOUT any shared state: the two parent ids are pure functions of ids every emitter already
124
+ // holds, so a generation recorded by the LLM proxy on one isolate and a tool span drained by the
125
+ // engine on another both name the same parent without either having seen it. The parents
126
+ // themselves are emitted once, when the run settles (`mapRunSpan` / `mapStepSpan`) — the same
127
+ // ordering any OTel SDK produces, where a parent exports after the children it outlives.
128
+ //
129
+ // The prefixes matter: without them a run and its step of the same id string would hash to the
130
+ // same span id, and a run whose agent kind happened to equal its own id would collide with its
131
+ // own root.
132
+ /** The DERIVED span id of a run's root span. */
133
+ export function deriveRunSpanId(executionId) {
134
+ return hashHex(`run:${executionId}`, 8);
135
+ }
136
+ /**
137
+ * The DERIVED span id of one `(run, agent kind)` step span — the parent every generation and
138
+ * tool span of that kind hangs under. Keyed on the agent kind because that is all a generation
139
+ * event carries; see `LlmStepSpan` for why that grain is the right one rather than a compromise.
140
+ */
141
+ export function deriveStepSpanId(executionId, agentKind) {
142
+ return hashHex(`step:${executionId}:${agentKind}`, 8);
143
+ }
88
144
  /** Epoch ms → OTLP unix-nano string (string arithmetic avoids float precision loss). */
89
145
  export function toUnixNano(ms) {
90
146
  return `${Math.round(ms)}000000`;
@@ -103,17 +159,23 @@ function metricDimensions(event) {
103
159
  [ATTR.agentKind]: event.agentKind,
104
160
  };
105
161
  }
106
- /** The dimensions on a generation's SPAN: the metric dimensions plus the workspace id. */
162
+ /**
163
+ * The dimensions on a generation's SPAN: the metric dimensions plus the ids too
164
+ * high-cardinality for a metric time series but exactly what a trace is searched by.
165
+ */
107
166
  function generationDimensions(event) {
108
167
  const attrs = metricDimensions(event);
109
168
  if (event.workspaceId)
110
169
  attrs[ATTR.workspaceId] = event.workspaceId;
170
+ if (event.executionId)
171
+ attrs[ATTR.executionId] = event.executionId;
111
172
  return attrs;
112
173
  }
113
174
  /** Map one completed LLM call to a neutral span. */
114
175
  export function mapGeneration(event) {
115
176
  const attributes = {
116
177
  ...generationDimensions(event),
178
+ [ATTR.operationName]: OPERATION.chat,
117
179
  // The three input classes stay APART on the span: they are priced ~0.1× / 1.25–2× / 1×
118
180
  // base input respectively, so a consumer that sums them loses the only signal that says
119
181
  // whether a long run is riding a warm cache or re-writing it every turn.
@@ -143,7 +205,18 @@ export function mapGeneration(event) {
143
205
  }
144
206
  return {
145
207
  traceId: deriveTraceId(event.executionId),
146
- name: event.agentKind,
208
+ spanId: randomSpanId(),
209
+ // A run-scoped call hangs under its agent kind's step span; a standalone inline call
210
+ // (requirements review, doc planner, fragment selector) has no run and stays a ROOT, which
211
+ // is the honest shape — there is no hierarchy above it to point at.
212
+ ...(event.executionId
213
+ ? { parentSpanId: deriveStepSpanId(event.executionId, event.agentKind) }
214
+ : {}),
215
+ // The convention's span name is `{operation} {request model}`. The agent kind that used to
216
+ // name this span is now the STEP span's name one level up, so nothing was lost by adopting
217
+ // it — and it still rides here as `cat_factory.agent_kind`.
218
+ name: `${OPERATION.chat} ${event.model}`,
219
+ kind: 'client',
147
220
  startTimeMs: event.startedAt,
148
221
  endTimeMs: event.endedAt,
149
222
  ok: event.ok,
@@ -191,6 +264,18 @@ export const PLATFORM_METRIC = {
191
264
  liveRuns: 'cat_factory.platform.live_runs',
192
265
  /** Windowed wall-clock run duration (seconds), split by statistic (avg/min/max/pNN). */
193
266
  runDuration: 'cat_factory.platform.run_duration',
267
+ /**
268
+ * Windowed count of SETTLED polling gates, split by gate kind and how it settled
269
+ * (`passed` / `exhausted` / `clean`, the last being a pass that spun up no helper at all,
270
+ * which is a separate series precisely because it is the one the precheck-first design is
271
+ * supposed to maximise).
272
+ */
273
+ gates: 'cat_factory.platform.gates',
274
+ /**
275
+ * Windowed count of helper-agent dispatches those gates spent (the CI-fixer attempt count),
276
+ * split by gate kind and by whether the helper's own job succeeded or failed.
277
+ */
278
+ gateAttempts: 'cat_factory.platform.gate_attempts',
194
279
  };
195
280
  /**
196
281
  * Attribute keys for the platform metrics. `account_id` is the tenant scope (bounded — the
@@ -205,9 +290,16 @@ export const PLATFORM_ATTR = {
205
290
  runState: 'cat_factory.run_state',
206
291
  failureKind: 'cat_factory.failure_kind',
207
292
  durationStat: 'cat_factory.duration_stat',
293
+ /** The gate step's agent kind (`ci` / `conflicts` / …): a registry key, so bounded. */
294
+ gateKind: 'cat_factory.gate_kind',
295
+ /** How a settled gate ended, or how a helper dispatch did. A closed vocabulary. */
296
+ gateOutcome: 'cat_factory.gate_outcome',
208
297
  };
209
298
  /** Metric units: a dimensionless run count, a dimensionless ratio, and seconds. */
210
299
  export const RUN_UNIT = '{run}';
300
+ /** The unit of the settled-gate gauges (a gate, and a helper dispatch against one). */
301
+ export const GATE_UNIT = '{gate}';
302
+ export const GATE_ATTEMPT_UNIT = '{attempt}';
211
303
  export const RATIO_UNIT = '1';
212
304
  /** The unit of the operational queue-depth gauge (live, dead-lettered, or otherwise). */
213
305
  export const JOB_UNIT = '{job}';
@@ -294,17 +386,73 @@ export function mapPlatformMetrics(snapshot, dims) {
294
386
  if (durationPoints.length > 0) {
295
387
  gauges.push({ name: PLATFORM_METRIC.runDuration, unit: DURATION_UNIT, points: durationPoints });
296
388
  }
389
+ // Gate statistics. Emitted only when a gate actually settled in the window: an empty series
390
+ // and a zero are different facts, and only the absence states "nothing settled" honestly
391
+ // (the same rule the failure taxonomy above follows).
392
+ if (snapshot.gates.length > 0) {
393
+ gauges.push({
394
+ name: PLATFORM_METRIC.gates,
395
+ unit: GATE_UNIT,
396
+ points: snapshot.gates.flatMap((g) => {
397
+ const at = (outcome, value) => ({
398
+ attributes: {
399
+ ...windowed,
400
+ [PLATFORM_ATTR.gateKind]: g.gateKind,
401
+ [PLATFORM_ATTR.gateOutcome]: outcome,
402
+ },
403
+ value,
404
+ isInt: true,
405
+ });
406
+ // `clean` is a SUBSET of `passed`, not a sibling: summing the three would double-count
407
+ // every precheck-clean gate. Kept as its own series anyway because "passed without
408
+ // spinning anything up" is the number the precheck-first design exists to move.
409
+ return [at('passed', g.passed), at('exhausted', g.exhausted), at('clean', g.cleanPasses)];
410
+ }),
411
+ });
412
+ gauges.push({
413
+ name: PLATFORM_METRIC.gateAttempts,
414
+ unit: GATE_ATTEMPT_UNIT,
415
+ points: snapshot.gates.flatMap((g) => {
416
+ const at = (outcome, value) => ({
417
+ attributes: {
418
+ ...windowed,
419
+ [PLATFORM_ATTR.gateKind]: g.gateKind,
420
+ [PLATFORM_ATTR.gateOutcome]: outcome,
421
+ },
422
+ value,
423
+ isInt: true,
424
+ });
425
+ // Split so a fixer that keeps CRASHING is distinguishable from one that runs clean and
426
+ // still cannot get the build green: same attempt count, opposite fixes.
427
+ return [
428
+ at('helper_failed', g.helperFailures),
429
+ at('helper_completed', Math.max(0, g.attempts - g.helperFailures)),
430
+ ];
431
+ }),
432
+ });
433
+ }
297
434
  return gauges;
298
435
  }
299
- /** Map one container tool call to a neutral span under its run's trace. */
436
+ /** Map one container tool call to a neutral span under its agent kind's step span. */
300
437
  export function mapToolSpan(context, span) {
301
- const attributes = { [ATTR.agentKind]: context.agentKind };
438
+ const attributes = {
439
+ [ATTR.operationName]: OPERATION.executeTool,
440
+ [ATTR.toolName]: span.tool,
441
+ [ATTR.agentKind]: context.agentKind,
442
+ };
302
443
  if (context.workspaceId)
303
444
  attributes[ATTR.workspaceId] = context.workspaceId;
445
+ if (context.executionId)
446
+ attributes[ATTR.executionId] = context.executionId;
304
447
  return {
305
448
  // Tool spans only reach here with a non-null executionId (the sinks guard on it).
306
449
  traceId: deriveTraceId(context.executionId),
307
- name: span.tool,
450
+ spanId: randomSpanId(),
451
+ ...(context.executionId
452
+ ? { parentSpanId: deriveStepSpanId(context.executionId, context.agentKind) }
453
+ : {}),
454
+ name: `${OPERATION.executeTool} ${span.tool}`,
455
+ kind: 'internal',
308
456
  startTimeMs: span.startedAt,
309
457
  endTimeMs: span.endedAt,
310
458
  ok: span.ok,
@@ -312,6 +460,79 @@ export function mapToolSpan(context, span) {
312
460
  events: [],
313
461
  };
314
462
  }
463
+ /**
464
+ * Map a settled run to its ROOT span: the ancestor of every step span, and transitively of
465
+ * every generation and tool span the run emitted.
466
+ *
467
+ * It carries no `gen_ai.operation.name`. A pipeline run is orchestration, not a model
468
+ * operation, and stamping one would file the wait on a human decision as GenAI activity.
469
+ *
470
+ * The name is the bare `run`, with the pipeline riding as `cat_factory.pipeline` rather than
471
+ * interpolated into it. A span name is the one field a backend treats as a low-cardinality
472
+ * CLASS: it keys the RED metrics a span-metrics connector derives, and the trace-side
473
+ * counterpart of the rule that a metric dimension must be BOUNDED. Every other name here is a
474
+ * closed vocabulary (an operation, a model, an agent kind, a tool), but a pipeline is
475
+ * workspace-authored free text, so interpolating it would let a tenant mint an unbounded
476
+ * number of series on an operator's backend by renaming pipelines.
477
+ */
478
+ export function mapRunSpan(run) {
479
+ const attributes = {
480
+ [ATTR.executionId]: run.executionId,
481
+ [ATTR.pipeline]: run.pipelineName,
482
+ };
483
+ if (run.workspaceId)
484
+ attributes[ATTR.workspaceId] = run.workspaceId;
485
+ return {
486
+ traceId: deriveTraceId(run.executionId),
487
+ spanId: deriveRunSpanId(run.executionId),
488
+ name: RUN_SPAN_NAME,
489
+ kind: 'internal',
490
+ startTimeMs: run.startedAt,
491
+ endTimeMs: run.endedAt,
492
+ ok: run.ok,
493
+ ...(run.ok ? {} : { statusMessage: run.errorMessage ?? undefined }),
494
+ attributes,
495
+ events: [],
496
+ };
497
+ }
498
+ /**
499
+ * Map one `(run, agent kind)` slice to the step span its generations and tool calls hang under.
500
+ *
501
+ * A HELPER kind (a gate's `ci-fixer`, a Tester's fixer, a `fork-proposer`) names its hosting
502
+ * kind as parent instead of the run, so an escalation reads as what it is rather than as a
503
+ * pipeline step of its own.
504
+ */
505
+ export function mapStepSpan(step) {
506
+ const attributes = {
507
+ [ATTR.operationName]: OPERATION.invokeAgent,
508
+ [ATTR.agentName]: step.agentKind,
509
+ [ATTR.agentKind]: step.agentKind,
510
+ [ATTR.executionId]: step.executionId,
511
+ // Both counts are stated ALWAYS, not only when they exceed one: a reader who has to infer a
512
+ // fold from its absence reads a two-step slice as one step that took twice as long, and a
513
+ // six-round fixer loop as one long fix. `step_count` folds steps of a kind; `attempt_count`
514
+ // folds the DISPATCHES inside them, which is the cycle a run actually repeats.
515
+ [ATTR.stepCount]: step.stepCount,
516
+ [ATTR.attemptCount]: step.attemptCount,
517
+ };
518
+ if (step.workspaceId)
519
+ attributes[ATTR.workspaceId] = step.workspaceId;
520
+ return {
521
+ traceId: deriveTraceId(step.executionId),
522
+ spanId: deriveStepSpanId(step.executionId, step.agentKind),
523
+ parentSpanId: step.parentAgentKind
524
+ ? deriveStepSpanId(step.executionId, step.parentAgentKind)
525
+ : deriveRunSpanId(step.executionId),
526
+ name: `${OPERATION.invokeAgent} ${step.agentKind}`,
527
+ kind: 'internal',
528
+ startTimeMs: step.startedAt,
529
+ endTimeMs: step.endedAt,
530
+ ok: step.ok,
531
+ ...(step.ok ? {} : { statusMessage: step.errorMessage ?? undefined }),
532
+ attributes,
533
+ events: [],
534
+ };
535
+ }
315
536
  // ---------------------------------------------------------------------------
316
537
  // Operational metrics: the deployment's own behaviour (sweeper activity, container dispatch
317
538
  // failures + evictions, queue depth, dropped telemetry, cache hit/miss), as opposed to the
@@ -340,6 +561,8 @@ export const OPERATIONAL_METRIC = {
340
561
  'notification.delivery_failed': 'cat_factory.platform.notification_delivery_failures',
341
562
  'cache.hit': 'cat_factory.platform.cache_hits',
342
563
  'cache.miss': 'cat_factory.platform.cache_misses',
564
+ 'auth.throttle.limited': 'cat_factory.platform.auth_throttle_limited',
565
+ 'auth.throttle.store_unavailable': 'cat_factory.platform.auth_throttle_store_unavailable',
343
566
  };
344
567
  /** Metric name per operational gauge. Exhaustive, for the same reason. */
345
568
  export const OPERATIONAL_GAUGE_METRIC = {
@@ -361,6 +584,8 @@ const OPERATIONAL_UNIT = {
361
584
  'notification.delivery_failed': '{failure}',
362
585
  'cache.hit': '{read}',
363
586
  'cache.miss': '{read}',
587
+ 'auth.throttle.limited': '{refusal}',
588
+ 'auth.throttle.store_unavailable': '{failure}',
364
589
  };
365
590
  /**
366
591
  * Namespace a sample's dimension keys onto the `cat_factory.` attribute prefix every other
@@ -1 +1 @@
1
- {"version":3,"file":"mapping.js","sourceRoot":"","sources":["../src/mapping.ts"],"names":[],"mappings":"AAWA,+EAA+E;AAC/E,qFAAqF;AACrF,yFAAyF;AACzF,iFAAiF;AAC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IAAI,EAAE,CAAA;QAC/C,MAAM,CAAC,IAAI,CAAC;YACV,UAAU,EAAE,qBAAqB,CAAC,MAAM,CAAC,UAAU,CAAC;YACpD,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,KAAK,EAAE,IAAI;SACZ,CAAC,CAAA;QACF,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAA;IACpC,CAAC;IACD,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC;QAC7C,IAAI,EAAE,wBAAwB,CAAC,KAAK,CAAC;QACrC,IAAI,EAAE,QAAQ;QACd,MAAM;KACP,CAAC,CAAC,CAAA;AACL,CAAC"}
package/dist/node.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type SpanProcessor } from '@opentelemetry/sdk-trace-base';
2
2
  import { type MetricReader } from '@opentelemetry/sdk-metrics';
3
- import type { LlmGenerationEvent, LlmToolSpan, LlmToolSpanContext, LlmTraceSink, Logger } from '@cat-factory/kernel';
3
+ import type { LlmGenerationEvent, LlmRunSpan, LlmStepSpan, LlmToolSpan, LlmToolSpanContext, LlmTraceSink, Logger } from '@cat-factory/kernel';
4
4
  export interface NodeOtelSinkConfig {
5
5
  /** OTLP/HTTP base URL, e.g. `http://collector:4318` (the `/v1/*` paths are appended). */
6
6
  endpoint: string;
@@ -20,12 +20,14 @@ export declare class NodeOtelTraceSink implements LlmTraceSink {
20
20
  private readonly meterProvider;
21
21
  private readonly idGenerator;
22
22
  private readonly logger?;
23
- private readonly startSpanForRun;
23
+ private readonly startMappedSpan;
24
24
  private readonly tokenCounter;
25
25
  private readonly durationHistogram;
26
26
  constructor(config: NodeOtelSinkConfig);
27
27
  recordGeneration(event: LlmGenerationEvent): void;
28
28
  recordToolSpans(context: LlmToolSpanContext, spans: LlmToolSpan[]): void;
29
+ /** The settled run's root + step spans: the parents everything else already named. */
30
+ recordRunSpans(run: LlmRunSpan, steps: LlmStepSpan[]): void;
29
31
  private emitSpan;
30
32
  /** Flush any buffered spans/metrics (e.g. before shutdown). Best-effort. */
31
33
  forceFlush(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAQA,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,+BAA+B,CAAA;AAEtC,OAAO,EACL,KAAK,YAAY,EAIlB,MAAM,4BAA4B,CAAA;AAInC,OAAO,KAAK,EACV,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,MAAM,EACP,MAAM,qBAAqB,CAAA;AA6B5B,MAAM,WAAW,kBAAkB;IACjC,yFAAyF;IACzF,QAAQ,EAAE,MAAM,CAAA;IAChB,iFAAiF;IACjF,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAChC,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,sGAAsG;IACtG,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,uFAAuF;IACvF,YAAY,CAAC,EAAE,YAAY,CAAA;CAC5B;AAmBD,qBAAa,iBAAkB,YAAW,YAAY;IACpD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAoB;IACnD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAe;IAC7C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAgB;IAC5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAQ;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAMvB;IACT,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAW;IAE7C,YAAY,MAAM,EAAE,kBAAkB,EAyCrC;IAED,gBAAgB,CAAC,KAAK,EAAE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5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAQ;IAChC,OAAO,CAAC,QAAQ,CAAC,eAAe,CAA8B;IAC9D,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAW;IAE7C,YAAY,MAAM,EAAE,kBAAkB,EAwDrC;IAED,gBAAgB,CAAC,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAchD;IAED,eAAe,CAAC,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CASvE;IAED,sFAAsF;IACtF,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,WAAW,EAAE,GAAG,IAAI,CAO1D;IAED,OAAO,CAAC,QAAQ;IAWhB,4EAA4E;IACtE,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC,CAMhC;IAED,iFAAiF;IAC3E,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAM9B;IAED,OAAO,CAAC,IAAI;CAMb;AAED,4FAA4F;AAC5F,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,GAAG,iBAAiB,CAEhF"}
package/dist/node.js CHANGED
@@ -1,31 +1,56 @@
1
- import { SpanKind, SpanStatusCode, } from '@opentelemetry/api';
1
+ import { ROOT_CONTEXT, SpanKind, SpanStatusCode, TraceFlags, trace, } from '@opentelemetry/api';
2
2
  import { BatchSpanProcessor, } from '@opentelemetry/sdk-trace-base';
3
3
  import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
4
4
  import { AggregationTemporality, MeterProvider, PeriodicExportingMetricReader, } from '@opentelemetry/sdk-metrics';
5
5
  import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-http';
6
6
  import { OTLPMetricExporter } from '@opentelemetry/exporter-metrics-otlp-http';
7
7
  import { resourceFromAttributes } from '@opentelemetry/resources';
8
- import { ATTR, DEFAULT_SERVICE_NAME, DURATION_UNIT, METRIC, SCOPE_NAME, TOKEN_UNIT, mapGeneration, mapGenerationMetrics, mapToolSpan, randomSpanId, randomTraceId, } from './mapping.js';
8
+ import { ATTR, DEFAULT_SERVICE_NAME, DURATION_UNIT, METRIC, SCOPE_NAME, TOKEN_UNIT, mapGeneration, mapGenerationMetrics, mapRunSpan, mapStepSpan, mapToolSpan, randomSpanId, randomTraceId, } from './mapping.js';
9
9
  /**
10
- * Forces the trace id of the next span so a run's calls share one trace. The SDK calls
11
- * `generateTraceId()` synchronously while starting a ROOT span (our spans have no active
12
- * parent), so we set {@link nextTraceId} immediately before `startSpan` and clear it after.
10
+ * Forces the ids of the next span so this transport emits exactly what the mapping layer
11
+ * decided. The SDK calls both generators synchronously inside `startSpan`, so we set the
12
+ * pending values immediately before the call and clear them after.
13
+ *
14
+ * The trace id matters for a ROOT span (a child inherits its parent's). The SPAN id matters
15
+ * for every parent in the hierarchy: the run and step spans carry ids DERIVED from the run,
16
+ * which is the whole reason a generation emitted hours earlier could name one — an
17
+ * SDK-minted random id would leave every child pointing at a parent that never exists.
13
18
  */
14
19
  class RunIdGenerator {
15
20
  nextTraceId = null;
21
+ nextSpanId = null;
16
22
  generateTraceId() {
17
23
  return this.nextTraceId ?? randomTraceId();
18
24
  }
19
25
  generateSpanId() {
20
- return randomSpanId();
26
+ return this.nextSpanId ?? randomSpanId();
21
27
  }
22
28
  }
29
+ /** The neutral span kind the mapping layer decided, in the SDK's own enum. */
30
+ const SDK_SPAN_KIND = {
31
+ internal: SpanKind.INTERNAL,
32
+ client: SpanKind.CLIENT,
33
+ };
34
+ /**
35
+ * A context naming an already-emitted (or yet-to-be-emitted) span as the parent, built from
36
+ * ids alone. The SDK normally takes a parent from an ACTIVE span, which a stateless per-call
37
+ * emission never has — this is the supported way to attach to a parent the process never held.
38
+ * Marked SAMPLED so the child isn't dropped for inheriting an unsampled parent.
39
+ */
40
+ function parentContextOf(traceId, parentSpanId) {
41
+ return trace.setSpanContext(ROOT_CONTEXT, {
42
+ traceId,
43
+ spanId: parentSpanId,
44
+ traceFlags: TraceFlags.SAMPLED,
45
+ isRemote: false,
46
+ });
47
+ }
23
48
  export class NodeOtelTraceSink {
24
49
  tracerProvider;
25
50
  meterProvider;
26
51
  idGenerator;
27
52
  logger;
28
- startSpanForRun;
53
+ startMappedSpan;
29
54
  tokenCounter;
30
55
  durationHistogram;
31
56
  constructor(config) {
@@ -44,13 +69,24 @@ export class NodeOtelTraceSink {
44
69
  spanProcessors: [spanProcessor],
45
70
  });
46
71
  const tracer = this.tracerProvider.getTracer(SCOPE_NAME);
47
- this.startSpanForRun = (name, traceId, startTimeMs, kind, attributes) => {
48
- this.idGenerator.nextTraceId = traceId;
72
+ this.startMappedSpan = (mapped) => {
73
+ this.idGenerator.nextTraceId = mapped.traceId;
74
+ this.idGenerator.nextSpanId = mapped.spanId;
49
75
  try {
50
- return tracer.startSpan(name, { kind, startTime: startTimeMs, attributes, root: true });
76
+ const options = {
77
+ kind: SDK_SPAN_KIND[mapped.kind],
78
+ startTime: mapped.startTimeMs,
79
+ attributes: mapped.attributes,
80
+ };
81
+ // With a parent context the SDK takes the trace id from the parent; `root: true` is
82
+ // for the spans that genuinely have none (a run root, a standalone inline call).
83
+ return mapped.parentSpanId
84
+ ? tracer.startSpan(mapped.name, options, parentContextOf(mapped.traceId, mapped.parentSpanId))
85
+ : tracer.startSpan(mapped.name, { ...options, root: true });
51
86
  }
52
87
  finally {
53
88
  this.idGenerator.nextTraceId = null;
89
+ this.idGenerator.nextSpanId = null;
54
90
  }
55
91
  };
56
92
  const metricReader = config.metricReader ??
@@ -68,8 +104,7 @@ export class NodeOtelTraceSink {
68
104
  }
69
105
  recordGeneration(event) {
70
106
  try {
71
- const mapped = mapGeneration(event);
72
- this.emitSpan(mapped, SpanKind.CLIENT);
107
+ this.emitSpan(mapGeneration(event));
73
108
  const metrics = mapGenerationMetrics(event);
74
109
  for (const point of metrics.tokenUsage) {
75
110
  this.tokenCounter.add(point.value, point.attributes);
@@ -85,15 +120,26 @@ export class NodeOtelTraceSink {
85
120
  return;
86
121
  try {
87
122
  for (const span of spans) {
88
- this.emitSpan(mapToolSpan(context, span), SpanKind.INTERNAL);
123
+ this.emitSpan(mapToolSpan(context, span));
89
124
  }
90
125
  }
91
126
  catch (err) {
92
127
  this.warn(err);
93
128
  }
94
129
  }
95
- emitSpan(mapped, kind) {
96
- const span = this.startSpanForRun(mapped.name, mapped.traceId, mapped.startTimeMs, kind, mapped.attributes);
130
+ /** The settled run's root + step spans: the parents everything else already named. */
131
+ recordRunSpans(run, steps) {
132
+ try {
133
+ this.emitSpan(mapRunSpan(run));
134
+ for (const step of steps)
135
+ this.emitSpan(mapStepSpan(step));
136
+ }
137
+ catch (err) {
138
+ this.warn(err);
139
+ }
140
+ }
141
+ emitSpan(mapped) {
142
+ const span = this.startMappedSpan(mapped);
97
143
  for (const event of mapped.events) {
98
144
  span.addEvent(event.name, event.attributes, event.timeMs);
99
145
  }
package/dist/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","sourceRoot":"","sources":["../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,QAAQ,EACR,cAAc,GACf,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAGL,kBAAkB,GACnB,MAAM,+BAA+B,CAAA;AACtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,EAEL,sBAAsB,EACtB,aAAa,EACb,6BAA6B,GAC9B,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yCAAyC,CAAA;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,2CAA2C,CAAA;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAA;AAQjE,OAAO,EAEL,IAAI,EACJ,oBAAoB,EACpB,aAAa,EACb,MAAM,EACN,UAAU,EACV,UAAU,EACV,aAAa,EACb,oBAAoB,EACpB,WAAW,EACX,YAAY,EACZ,aAAa,GACd,M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;QACpF,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAChB,CAAC;IACH,CAAC;IAEO,IAAI,CAAC,GAAY;QACvB,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,kCAAkC,EAAE;YACpD,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;CACF;AAED,4FAA4F;AAC5F,MAAM,UAAU,kBAAkB,CAAC,MAA0B;IAC3D,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAA;AACtC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cat-factory/observability-otel",
3
- "version": "0.5.7",
3
+ "version": "0.7.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.219.0",
39
- "@cat-factory/kernel": "0.221.1"
38
+ "@cat-factory/contracts": "0.221.0",
39
+ "@cat-factory/kernel": "0.223.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "typescript": "7.0.2",