feat(observability): group agent storage spans#2
Draft
Ankcorn wants to merge 1 commit into
Draft
Conversation
0058371 to
52de5f8
Compare
52de5f8 to
ad9a08a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
cloudflare#1860 makes inference and tool work visible, but SDK-managed chat flows still emit dozens of Durable Object spans beside the useful
invoke_agentpath.This groups storage work into semantic phases so raw DO spans remain available without burying model and tool activity.
Trace shape
prepare_agentcloses beforeinvoke_agentstarts, keeping them as siblings. No known SDK SQLite spans remain as direct siblings ofinvoke_agent.Durable submissions similarly group acceptance/execution around a nested
chat_turn.Attributes
Every SDK span carries agent identity plus:
Chat phases also carry request ID, trigger, admission, generation, channel and continuation where available. Initialization/startup spans add schema, hydration and recovery metadata. Conversation content, tool payloads and error messages are not recorded.
A phase typically groups 3–15 DO operations; full schema migration groups roughly 45, while streaming and recovery are unbounded.
One runtime-level KV read can remain between initialization and startup: PartyServer privately hydrates its legacy
__ps_namebefore invokingonStart, outside Agent lifecycle hooks.Stacked on cloudflare#1860. This fork PR targets an exact mirror of that PR head because this account cannot open a PR directly against Cloudflare's branch.