Skip to content

Insights › OpenTelemetry: heed receives the agents' own telemetry, and forwards what you already export - #242

Merged
Mpdreamz merged 7 commits into
mainfrom
feature/otel
Nov 13, 2026
Merged

Mpdreamz merged 7 commits into
mainfrom
feature/otel

Conversation

@Mpdreamz

Copy link
Copy Markdown
Contributor

heed estimated cost and tailed private transcript files. Now it receives the agents' own OpenTelemetry on this Mac and shows it as an observability view.

Receiver

  • OTLP/HTTP (JSON and protobuf; gRPC refused with a 415 that says so) on 127.0.0.1:4318, /v1/traces, /v1/logs, /v1/metrics; gzip, chunked, keep-alive; off the main actor; a separate telemetry.sqlite, pruned hourly. Nothing leaves the Mac.
  • Panes heed launches export to it: claude via OTEL env vars (http/json, since claude 2.1.319 predates its protobuf default), codex via -c otel.* overrides (checked offline against 0.163).
  • [telemetry] enabled, port, days, max_rows, tool_details, prompts, proxy; Settings › History has an OpenTelemetry card with a line per agent.

Proxy (on by default)

  • An agent you already export from is pointed at heed anyway, and heed forwards every export unchanged (body, content type, encoding, headers) to your endpoint, per signal, in your protocol, in order; up to 512 exports / 32 MB buffered with retries (1–60 s), oldest dropped when full, counted in Settings.
  • Headers are never stored, logged or shown; claude keeps sending your headers itself, codex keeps your config's protocol and headers (only its endpoint is overridden).
  • Left alone: gRPC exports, and claude configured through ~/.claude/settings.json env. If the receiver can't bind, panes launch as before.
  • A banner on the OpenTelemetry tab while heed forwards: agent → host, P stops forwarding (proxy = false, from each pane's next launch), x hides it until restart.

The view

  • Insights › OpenTelemetry (T): range, agent, repo, model, kind, a span query (tool:bash status:error repo:x over:30s), live; turns/min, tool p95, tool errors, blocked on you, tokens/min, cost; latency by tool (p50 · p95), agent state over time, cost and tokens by model; the span table; ↩ the session's trace.
  • A session's trace: t in Sessions, :trace, or Session › Trace; turns end to end as a waterfall.
  • Where telemetry reports cost, it wins over the hooks' figure and the estimate; tokens unchanged.

Verified

  • mise run test: 2035 pass (sample payloads from the docs, protobuf from the official OTLP protos; breaking the percentile and the header filtering fails them); lint clean; tutor-check 0 problems; shots regenerated.
  • Not tried: a live export from a real claude or codex session, forwarding to a real collector, codex's span names (unknown spans show as other).

🤖 Generated with Claude Code

@github-actions github-actions Bot added the enhancement New feature or request label Nov 13, 2026
Mpdreamz and others added 6 commits November 13, 2026 23:56
An OTLP/HTTP JSON receiver for 127.0.0.1, spans, prompts and usage samples kept in telemetry.sqlite under [telemetry], and the domain that reads Claude Code's and Codex's spans, events and metrics into heed's: a span and its event count once, tool wrappers give way to the wait for your OK and the run, turns come from prompts where no trace was sent. A board sums them (latency by tool, errors, waits, state over time, cost by model), a session's trace lays its turns end to end, and claude and codex are pointed at the receiver only when you send their telemetry nowhere yourself. A session's reported telemetry cost wins over the hooks' and the estimate.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
T in Insights (:telemetry) shows the agents' own telemetry as an observability view: range, agent, repo, model, kind and a span query, six numbers with their line, latency by tool, agent state, cost by model, the spans with a wait going on now on top, and the selected span's trace as a waterfall. t on a session (:trace, or the return key on a span) shows its last turns span by span. The receiver starts with config, follows [telemetry] as it changes, and its status shows at the end of Insights' tabs and in Settings › History.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
An agent you send telemetry from yourself is pointed at heed too ([telemetry] proxy, on by default), and heed passes every export on unchanged to where it went: same bytes, content type and encoding, your headers, each signal to its own endpoint, in your protocol. It answers the agent at once and forwards in order off the main actor, retrying with backoff while your collector is down and dropping the oldest from a bounded buffer, counted in Settings. Headers are never written anywhere. gRPC and Claude Code's settings env stay left alone. Protobuf exports are read too, by a small hand-written decoder, tested on payloads encoded by the official Go protos. The OpenTelemetry tab shows a banner while heed forwards, with P to stop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…docs build), and the slow-answer approvals test allows a slow CI machine

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Mpdreamz
Mpdreamz merged commit 20a7762 into main Nov 13, 2026
5 checks passed
@Mpdreamz
Mpdreamz deleted the feature/otel branch November 13, 2026 23:50
Mpdreamz added a commit that referenced this pull request Nov 14, 2026
…posal in the reader (#243)

Follow-up to #239–#242, from looking at the real screens.

- **The session's helper line**: the band at the top of a session's
panes becomes one line at their foot, above the status bar, however many
helpers work on the session's PRs ("▶ 3 helpers on this session's PRs ·
#2841 needs your OK · #1920 step 2 of 3 · ✓ #2836 pushed a3f9c1d · pull
before your next change"). Needs you first, then working, then waiting;
amber only when one needs you; a short highlight when a run changes step
or finishes; a finished run stays until seen (you left the session after
it finished, or ✕). `gW` watches the one run, or opens a list (j k, ↩
watch, gO take over, x dismiss a finished one). `SessionHelperLine` in
HeedCore, with tests.
- **Attention rows** are two lines again: the next step sits
right-aligned on the chips line, short (▶ merge it, ▶ review, ▶ green +
merge, ▶ set up, ▶ start, ▶ reply, ▶ resolve, ▶ heed is on it), and only
when heed would act.
- **One proposal in the reader**: the seven-button row folds into Other
(`.`), a menu with the other steps and Review / Reply / its session /
Done / Snooze / Mute / GitHub with their keys (picking a step makes it
the proposal; D runs it). Every key still works. Items with no step, or
with a helper split open, get a slim actions line.
- **Fake world**: get it green runs as a helper there too; the old
background run only appears in the shots of the pages documenting that
mode.
- A shot-renderer fix: the inspector no longer pushes the centre column
below the window (it hid the new line), so most shots changed.

Verified: `mise run test` 2063 pass (breaking the seen check and the
ordering fails the new tests), lint clean, tutor-check 0 problems, every
shot regenerated and the key ones checked by eye. Not tried: the
highlight animation and clicks in a live window.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant