Repository navigation
fix(cli): preserve trace attributes in field projections - #1665
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
betegon
marked this pull request as ready for review
October 26, 2026 12:41
betegon
force-pushed
the
fix/cli-trace-fields
branch
from
October 26, 2026 12:42
09a3a98 to
bf604eb
Compare
This branch was previously deployed
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.
trace view --fieldscould request an attribute successfully and then discard it when filtering the JSON response. Attribute names were looked up on the trace root even though their values live on individual spans.Before
For a trace whose root and child spans have
http.methodvalues:{}The workaround was to add
spans, returning the entire tree instead of just the requested attribute. Explicit paths such asspans.data.http.methodalso failed because the shared filter did not traverse nested arrays or resolve nested keys containing literal dots.After
The same command returns the requested attribute throughout the tree, retaining span IDs and parent/child structure:
{ "spans": [ { "span_id": "root-span", "additional_attributes": { "http.method": "GET" }, "children": [ { "span_id": "child-span", "additional_attributes": { "http.method": "POST" }, "children": [] } ] } ] }Explicit JSON paths select only the named level; selecting
spansstill keeps the full tree. Their structural prefixes are no longer sent to Sentry as attribute names. The shared filter preserves array positions and literal dotted keys, combines overlapping selections, and leaves the input unchanged. Missing fields remain optional;null,0,false, and empty strings are preserved when selected.Regression tests cover request parameters and rendered command output, including attributes found only on children, mixed summary/attribute selections, nested arrays, and overlapping fields. Command examples and generated agent documentation explain the selection rules.
Automatic JSON detail fetching is unchanged. Optimizing those requests is deferred to a separate PR.
Validation passed: root
pnpm run tscandpnpm run lint, command-fragment and documentation-example checks, and the full workspacepnpm run teston Linux x64 with Node 24 and UTC (VITEST_MAX_WORKERS=4, unprivileged user). The CLI suite passed 11,380 tests with 49 skipped.