fix(telemetry): a held-open session's lifetime is not a request latency #581
No reviewers
Labels
No labels
move-to-repo
coilyco-bridge-deploy
move-to-repo
coilyco-flight-deck-agent-compose
move-to-repo
coilyco-gaming-eco-app
move-to-repo
coilysiren-inbox
move-to-repo
unknown
🔒⚠️📦⚠️🔒 SANDBOXED 🔒⚠️📦⚠️🔒
autonomy
async-consult
autonomy
epic
autonomy
headless
autonomy
live-collab
c#
priority
P0
priority
P1
priority
P2
priority
P3
priority
P4
role/ai
role/creator
role/design
role/director
role/engineer
role/exec
role/human
role/ops
role/qa
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
coilyco-gaming/sirens-echo!581
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/a-session-lifetime-is-not-a-latency"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
closes #560
Second half of #160. Kai's original note recorded the consequence:
Two spans set a service-wide p99.
Why it got worse before it got better
otelhttpnames every client span for its method, so the MCP transport and the model path both emittedHTTP POST. A session that exists to stay open sat in the same percentiles as a call that should return in milliseconds.PR#558 removed the session timeout, which was right — a held-open session has no request to bound. But it means sessions are no longer cut at 180s, so they are free to be long, and every one still landed on the request-path name. #560 predicted that when it was filed, and it is now live on main.
The change
The MCP transport names its spans
mcp.session POST. Prefixed rather than replaced, so a reader still sees the verb and one filter on the prefix catches every method at once.Three tests: the naming, that it cannot collide with the request-path name, and that the
operationstring otelhttp supplies is ignored — that argument is the name this fix exists to discard, so reading it would reintroduce the bug.What this does not do
It is not #161 and does not serve it, which I want on the record because I originally said one change plausibly covered both.
#161 asks for the MCP method name on the client span. With streamable HTTP one POST carries many JSON-RPC messages, so there is no single method to attach at the transport layer — the methods are inside a stream body
otelhttpnever parses. Whatever answers #161 has to live where the calls are dispatched.I also checked PR#567 before starting, since it touches the same file. It adds
mcp.server.nameandmcp.discovery.stageto the discovery span, which is a different span. No overlap.ward exec gategreen.