Skip to content

feat(otel): stamp tangle.run.id + tangle.subject.key on the loop root span#354

Merged
drewstone merged 1 commit into
mainfrom
feat/otel-spine-attrs
Jun 22, 2026
Merged

feat(otel): stamp tangle.run.id + tangle.subject.key on the loop root span#354
drewstone merged 1 commit into
mainfrom
feat/otel-spine-attrs

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

What

Two additive attributes on the loop root span in otel-export.ts:

  • tangle.run.id — explicit run identity (= runId), so a consuming system of record maps a span tree to exactly one run deterministically, rather than inferring it from gen_ai.conversation.id.
  • tangle.subject.key — the subject grain (= agentRunNames[0], the lead agent/profile the run drove), so runs group under the thing being worked on instead of one service-wide bucket.

Why

Tangle Intelligence's new agent-work spine reconstructs subjects + runs from ingested OTel spans. Today it can group agent-runtime runs by conversation id and derive a subject from service.name — but that buckets every run under one subject. Stamping the run id + subject explicitly lets the spine map run → subject from the executor itself, deterministically.

Safety

  • Purely additive — both values come from data already in the loop.started payload (runId, agentRunNames). No new plumbing, no behavior change.
  • Existing attributes untouched; the 17 otel-export tests pass, with two added assertions for the new keys.

Pairs with the Intelligence spine PR (tangle-network/agent-dev-container#2504). This is the optional "deterministic mapping" half — the spine already works without it by inference; this makes the mapping exact.

… span

Lets a consuming run system-of-record (Tangle Intelligence's run spine) map a
span tree to one run + its subject deterministically, instead of inferring the
run from the conversation id and the subject from the service name.

Additive — both are derived from data already in the loop-started payload
(runId, agentRunNames[0]); existing attributes and the 17 otel-export tests
are unchanged.
@drewstone drewstone marked this pull request as ready for review June 22, 2026 00:13
@drewstone drewstone merged commit f177dc4 into main Jun 22, 2026
1 check failed

@tangletools tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved PR — 750b69c5

Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-22T00:13:28Z

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants