hyperdx icon indicating copy to clipboard operation
hyperdx copied to clipboard

feat: Add custom trace-level attributes above trace waterfall

Open pulpdrew opened this issue 2 months ago • 4 comments

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

  1. They are trace level (from any span in the trace), whereas the top of the side panel shows information specific to the span
  2. 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:

  1. 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: Screenshot 2025-11-14 at 3 02 25 PM

Values for those attributes within the trace show up on the trace panel above the waterfall: Screenshot 2025-11-14 at 3 02 59 PM

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 Screenshot 2025-11-14 at 3 03 10 PM

pulpdrew avatar Nov 12 '25 20:11 pulpdrew

🦋 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

changeset-bot[bot] avatar Nov 12 '25 20:11 changeset-bot[bot]

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
hyperdx-v2-oss-app Ready Ready Preview Comment Nov 18, 2025 7:34pm

vercel[bot] avatar Nov 12 '25 20:11 vercel[bot]

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

  1. Add input validation for SQL expressions before using SqlString.raw()
  2. Consider adding error boundaries around new components
  3. Verify NetworkPropertyPanel change does not break existing features

claude[bot] avatar Nov 12 '25 20:11 claude[bot]

E2E Test Results

All tests passed • 39 passed • 3 skipped • 395s

Status Count
✅ Passed 39
❌ Failed 0
⚠️ Flaky 1
⏭️ Skipped 3

View full report →

github-actions[bot] avatar Nov 12 '25 20:11 github-actions[bot]