Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: trace chatd provider attempts with model and effort - #28971

Draft
jscottmiller wants to merge 1 commit into
scott/chatd-stages/3-stream-stagesfrom
scott/chatd-stages/4-provider-attempts
Draft

feat: trace chatd provider attempts with model and effort#28971
jscottmiller wants to merge 1 commit into
scott/chatd-stages/3-stream-stagesfrom
scott/chatd-stages/4-provider-attempts

Conversation

@jscottmiller

@jscottmiller jscottmiller commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Wraps the provider HTTP transport in stageSpanRoundTripper, which emits one provider_attempt stage per round trip so retried requests each get their own span. The span closes on response headers; HTTP status >= 400 marks the span as errored without changing what is returned to the client.

The resolved model and the effective reasoning effort are resolved once in resolveModelCall and threaded to the transport via modelBuildOptions.StageModel, so the span attributes and the model label match the call. Effort is carried on spans as reasoning_effort only; it is not a metric label. Server gains the stages tracer and a TracerProvider config option (nil disables tracing without disabling metrics), wired from coderd.


Part of the chatd lifecycle observability stack: 1 extract step · 2 stage tracer · 3 stream stages · 4 provider attempts · 5 turn span · 6 capacity wait · 7 turn accounting · 8 dashboard. Supersedes the experimental branch in #28741.

🤖 This PR was generated by Coder Agents on behalf of @jscottmiller.

Wrap the provider transport in stageSpanRoundTripper, which opens one
provider_attempt stage per HTTP round trip so retried requests each get
their own span, labeled with the HTTP method, host, and status code.
resolveModelCall resolves the effective reasoning effort once and
carries it with the model name as a StageModel through modelBuildOptions
so the transport labels attempts the way the call options were sent.
The Server gains the StageTracer and a TracerProvider config field that
coderd wires from its own tracer provider.
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/3-stream-stages branch from 3e6c03c to bf4b80a Compare September 11, 2026 19:17
@jscottmiller
jscottmiller force-pushed the scott/chatd-stages/4-provider-attempts branch from 8b252aa to 2653138 Compare September 11, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

experimental Changes that might not necessarily be merged, until its approved to proceed with.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant