feat: Add custom trace-level attributes above trace waterfall
Ref HDX-2752
Summary
This PR adds a new Source setting which specifies additional Span-Level attributes which should be displayed above the Trace Waterfall. The attributes may be specified for both Log and Trace kind sources.
These are displayed on the trace panel rather than at the top of the side panel because
- They are trace level (from any span in the trace), whereas the top of the side panel shows information specific to the span
- The data comes from the same query as the waterfall, so moving the attributes to the top level would require coordinating the configurations / react query caches between the waterfall and the attributes components. This is definitely possible, but not worth the refactoring at this time.
Notes:
- The attributes are pulled from the log and trace source (if configured for each) despite the search page only being set to query one of those sources. If an attribute value comes from the log source while the trace source is currently configured on the search page, the attribute tag will not offer the option to show the "Add to search" button and instead will just show a "search this value" option, which navigates the search page to search the value in the correct source.
Demo
First, source is configured with highlighted attributes:
Values for those attributes within the trace show up on the trace panel above the waterfall:
Values are searchable when clicked, and if a lucene version of the property is provided, the lucene version will be used in the search box
🦋 Changeset detected
Latest commit: 31cb5e9711e205c8b27b99ed9856eb7989b722ef
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 3 packages
| Name | Type |
|---|---|
| @hyperdx/common-utils | Patch |
| @hyperdx/api | Patch |
| @hyperdx/app | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
The latest updates on your projects. Learn more about Vercel for GitHub.
| Project | Deployment | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| hyperdx-v2-oss-app | Preview | Comment | Nov 18, 2025 7:34pm |
PR Review - feat: Add custom trace-level attributes above trace waterfall
Critical Issues
None found
Code Quality Issues
- SQL Injection Risk in EventTag.tsx:48 - Using SqlString.format with SqlString.raw(name) allows raw SQL. Validate name parameter or use prepared statements
- Missing error boundary in DBHighlightedAttributesList - Wrap component in try-catch or error boundary to prevent entire panel crash if attribute rendering fails
- Deprecated props removed without migration path in NetworkPropertyPanel.tsx:28,29 - Removed onPropertyAddClick and generateSearchUrl props. Verify no breaking changes to existing usages
- useMemo missing dependency in DBTraceWaterfallChart.tsx:297 - dateRangeStartInclusive marked as added dependency but not verified in implementation
Observations
- Comprehensive test coverage (480 lines of tests)
- Proper TypeScript typing throughout
- Good separation of concerns (utility functions in separate file)
- Zod schema validation for new fields
- Handles edge cases (null, undefined, empty strings)
Recommendations
- Add input validation for SQL expressions before using SqlString.raw()
- Consider adding error boundaries around new components
- Verify NetworkPropertyPanel change does not break existing features
E2E Test Results
✅ All tests passed • 39 passed • 3 skipped • 395s
| Status | Count |
|---|---|
| ✅ Passed | 39 |
| ❌ Failed | 0 |
| ⚠️ Flaky | 1 |
| ⏭️ Skipped | 3 |