feat(trace-view): expose span attributes in trace and span views#742
Merged
feat(trace-view): expose span attributes in trace and span views#742
Conversation
Add --full flag to `trace view` that fetches full span attributes via the per-span trace-items detail endpoint. Auto-enabled in --json mode so JSON consumers (agents, scripts) get complete data by default. - Extract shared `attributesToDict` and `fetchMultiSpanDetails` from span/view.ts into api/traces.ts for reuse across both commands - Fetch details for ALL spans (no cap) with concurrency 15; progress on stderr for >20 spans, informational warning for >500 spans - Merge `data` dicts onto each span in JSON output (consistent with existing span view --json shape) - Human output notes detail count; hint suggests --full or --json - Property-based tests for flattenSpanTree; unit tests for --full and --json auto-enable behavior
Contributor
Semver Impact of This PR🟡 Minor (new features) 📋 Changelog PreviewThis is how your changes will appear in the changelog. New Features ✨
Bug Fixes 🐛Init
Resolve
Upgrade
Other
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Contributor
|
Contributor
Codecov Results 📊✅ 134 passed | Total: 134 | Pass Rate: 100% | Execution Time: 0ms 📊 Comparison with Base Branch
✨ No test changes detected All tests are passing successfully. ✅ Patch coverage is 99.40%. Project has 1629 uncovered lines. Files with missing lines (1)
Coverage diff@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 95.28% 95.28% —%
==========================================
Files 234 234 —
Lines 34443 34546 +103
Branches 0 0 —
==========================================
+ Hits 32820 32917 +97
- Misses 1623 1629 +6
- Partials 0 0 —Generated by Codecov Action |
…utable - Replace spread with Array.from() per codebase convention - Add /trace-items/ to the immutable cache tier (24h TTL) since span attributes never change once ingested, same rationale as events and trace detail endpoints
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.
Summary
Closes #736
--fullflag totrace viewthat fetches full span attributes via the per-span trace-items detail endpoint--jsonmode so JSON consumers (agents, scripts) get complete data without needing to discover the flagattributesToDictandfetchMultiSpanDetailshelpers fromspan/view.tsintoapi/traces.tsfor reusedatadicts onto each span in JSON output, consistent with existingspan view --jsonshapeBehavior
trace view <id>trace view <id> --jsontrace view <id> --fulltrace view <id> --full --json--jsonaloneTest plan
flattenSpanTree(count, membership, empty)--jsonauto-enable,--fullflag, detail skipping in human modedatadict with filtered attributes