-
Notifications
You must be signed in to change notification settings - Fork 457
feat(app): search across multiple sources, with one source as N=1 #2885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| --- | ||
| '@hyperdx/app': minor | ||
| '@hyperdx/common-utils': minor | ||
| --- | ||
|
|
||
| Search across multiple sources at once. The search page's source selector can | ||
| now expand into a multi-select (up to 3 log/trace sources): results interleave | ||
| into one timestamp-ordered timeline with a per-row source badge, normalized | ||
| columns (Timestamp, Source, Service, Level, Message, and Duration when traces | ||
| are included), a histogram stacked by source, and an add-column picker over the | ||
| union of the selected sources' columns. Each source runs its own query | ||
| pipeline — sources on different connections work, and a failing source shows a | ||
| status chip instead of failing the whole search. Multi-source mode is | ||
| Lucene-only and shareable via URL; saved searches and alerts remain | ||
| single-source for now. | ||
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| import { useCallback, useMemo } from 'react'; | ||
| import { Group, MultiSelect, Text } from '@mantine/core'; | ||
|
|
||
| import { MultiSourceColumnOption } from '@/hooks/useMultiSourceSearch'; | ||
|
|
||
| /** | ||
| * Multi-source replacement for the free-text SELECT editor: pick extra | ||
| * columns from the union of the selected sources' top-level columns. Columns | ||
| * missing from a source render as blank cells for that source's rows. | ||
| */ | ||
| export default function MultiSourceColumnPicker({ | ||
| unionColumns, | ||
| totalSources, | ||
| value, | ||
| onChange, | ||
| }: { | ||
| unionColumns: MultiSourceColumnOption[]; | ||
| totalSources: number; | ||
| /** Currently selected extra column names. */ | ||
| value: string[]; | ||
| onChange: (columns: string[]) => void; | ||
| }) { | ||
| const availabilityByName = useMemo( | ||
| () => new Map(unionColumns.map(c => [c.name, c.availableCount])), | ||
| [unionColumns], | ||
| ); | ||
|
|
||
| const data = useMemo( | ||
| () => | ||
| unionColumns.map(c => ({ | ||
| value: c.name, | ||
| label: c.name, | ||
| })), | ||
| [unionColumns], | ||
| ); | ||
|
|
||
| const renderOption = useCallback( | ||
| ({ option }: { option: { value: string; label: string } }) => { | ||
| const available = availabilityByName.get(option.value) ?? 0; | ||
| return ( | ||
| <Group gap="xs" wrap="nowrap" w="100%" justify="space-between"> | ||
| <span style={{ overflow: 'hidden', textOverflow: 'ellipsis' }}> | ||
| {option.label} | ||
| </span> | ||
| {available < totalSources && ( | ||
| <Text size="xs" c="dimmed" style={{ flexShrink: 0 }}> | ||
| {available}/{totalSources} sources | ||
| </Text> | ||
| )} | ||
| </Group> | ||
| ); | ||
| }, | ||
| [availabilityByName, totalSources], | ||
| ); | ||
|
|
||
| return ( | ||
| <MultiSelect | ||
| size="xs" | ||
| data={data} | ||
| value={value} | ||
| onChange={onChange} | ||
| searchable | ||
| clearable | ||
| placeholder={value.length === 0 ? 'Add columns' : undefined} | ||
| aria-label="Add columns" | ||
| maxDropdownHeight={280} | ||
| renderOption={renderOption} | ||
| data-testid="multi-source-column-picker" | ||
| /> | ||
| ); | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The release note says this change includes a histogram stacked by source, but multi-source mode currently renders only the merged results table and explicitly defers the histogram to the next PR. Publishing this changeset would promise behavior that this release does not provide.