You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3e4185a
Browse filesBrowse the repository at this point in the historyBrowse files
feat(s090): a turn is a trace, and the OpenTelemetry decision recorded
Every event emitted inside a turn now carries trace_id and parent_span_id, and
every span carries its own span_id. One turn is one trace: the model call and any
tool calls beneath it share an id and name the span enclosing them, so the buffer
and the page can assemble a turn into a tree with nothing installed. Two turns are
two traces. Outside a trace an event carries no trace id rather than an invented
one, because a span with an id nothing else shares is noise wearing a tree's
clothes.
The llm.call.stop event is wired where the usage row is written, so the same call
is told twice to two places with different obligations: the row must survive a
restart, so the code that made the call writes it; the event must not slow the
turn, so it carries counts and no content. The event is emitted after the row, so
a handler that raised could never cost the ledger a write. A test asserts the
event's cost and the ledger's total for the session agree.
AC5 asked for OpenTelemetry. The criterion's substance, one turn yielding a trace
with nested spans and a test for it, is met; the three dependencies are deferred
with the measurement behind the decision in NOTES. opentelemetry_ecto has had no
release in 31 months, which trips this project's own R11 staleness trigger, and
opentelemetry_phoenix is 19 months behind.
The reasoning is about which layer owns what. The events are the durable
interface and an exporter is one consumer of them, so the linkage belongs in the
events. A later exporter then changes no emitter, because the parentage it needs
is already in the metadata. Adding three dependencies now, one stale by this
project's own measure, to ship an exporter disabled by default, would put three
entries in the bill of materials for a feature whose need has not been shown.
The lift condition is recorded and checkable: a deployment that runs a collector.
4 more tests. mix gate exit 0; 676 passed; coverage 80.31%.
Signed-off-by: Ayla Croft <aylacroft@proton.me>
0 commit comments