Skip to content

Conversation

@pulpdrew
Copy link
Contributor

@pulpdrew pulpdrew commented Nov 10, 2025

Closes HDX-2772

This PR adds a filter that allows for quickly viewing just root spans from a Trace source.

Notes:

  • The state of this filter is persisted in the URL Query Params
  • This filter is not persisted in a saved search to match the behavior of other filters, which are not persisted in saved searches.
Screenshot 2025-11-12 at 3 56 18 PM Screenshot 2025-11-12 at 3 56 32 PM

@changeset-bot
Copy link

changeset-bot bot commented Nov 10, 2025

🦋 Changeset detected

Latest commit: e8dd6dd

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@hyperdx/app Patch
@hyperdx/api 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

@vercel
Copy link

vercel bot commented Nov 10, 2025

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 12, 2025 9:00pm

@claude
Copy link

claude bot commented Nov 10, 2025

PR Review - Root Spans Filter

No critical issues found.

The implementation is clean and follows project patterns well:

  • ✅ Properly checks for source kind and parent span ID expression before rendering
  • ✅ Uses consistent Mantine UI components and follows existing checkbox pattern
  • ✅ State is correctly persisted in URL via filter mechanism
  • ✅ Logic is well-encapsulated in setRootSpansOnly and isRootSpansOnly functions
  • ✅ Handles empty string as the filter value for root spans (spans with no parent)

Minor enhancement opportunity (optional):
Consider adding test coverage for the new root spans filter in DBSearchPageFilters.test.tsx to match the existing test patterns for other filter functionality. The current tests cover the FilterGroup component but not the full DBSearchPageFilters component with the new checkbox.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 10, 2025

E2E Test Results

All tests passed • 40 passed • 3 skipped • 303s

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

View full report →

@pulpdrew pulpdrew force-pushed the drew/root-span-filter branch from 5adca3e to 3204693 Compare November 10, 2025 19:27
@pulpdrew pulpdrew requested review from a team and knudtty and removed request for a team November 10, 2025 19:40
</Text>
</Tooltip>
}
onChange={() => setRootSpansOnly(!rootSpansOnly)}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on directly setting the filters object as opposed to a specific property? Or does it not work there?

Copy link
Contributor Author

@pulpdrew pulpdrew Nov 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did think about doing it that way, but decided against it because

  1. Our filter states are based on parsing SQL, so we'd need to ensure our filter is of the form parentSpanId IN (''). This is probably fine, though less straightforward to me than empty(parentSpanId)
  2. Our UI filter states are based on the values parsed from the filters parameter, so without specifically handling the parentSpanId filter when parsing, we'd end up with parentSpanId in the filter sidebar. We could specifically handle that, but that didn't seem any better to me than using a separate param.
Screenshot 2025-11-10 at 2 54 19 PM

Curious if you see a major benefit to having this in the filters object instead though - we could do it if there is one!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm a bit split on this, that makes a lot of sense why it doesn't work well today. I can imagine in the future we have other filter settings that are just "preset filter combos" kind of thing (though no concrete use case yet). Might just be a more scalable solution long term.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea of preset filter combos makes sense. For a preset filter combo, do you think we'd want to continue showing all the filters that have been applied by the preset, or hide the related filter sections?

For example, in this case, show or hide the ParentSpanId section here?
Screenshot 2025-11-10 at 3 25 24 PM

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We chatted offline and decided to go with using filters instead. We will show the related filter as applied in the sidebar (like the image above) but with an (empty) label.

knudtty
knudtty previously approved these changes Nov 10, 2025
@kodiakhq kodiakhq bot merged commit 7bb7a87 into main Nov 13, 2025
12 checks passed
@kodiakhq kodiakhq bot deleted the drew/root-span-filter branch November 13, 2025 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants