Skip to content

feat(traces): Add multiple queries for trace search #69929

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

Merged
merged 1 commit into from
Apr 29, 2024

Conversation

k-fish
Copy link
Member

@k-fish k-fish commented Apr 29, 2024

Summary

This allows multiple span conditions to be used together to target specific traces containing all (up to 3) of those conditions.

Screenshots

Screenshot 2024-04-29 at 5 21 36 PM

This allows multiple span conditions to be used together to target specific traces containing all (up to 3) of those conditions.
@k-fish k-fish self-assigned this Apr 29, 2024
@k-fish k-fish requested a review from a team as a code owner April 29, 2024 21:21
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Apr 29, 2024
@k-fish k-fish enabled auto-merge (squash) April 29, 2024 21:22
// TODO: load tags for autocompletion
const organization = useOrganization();
const canAddMoreQueries = queries.length <= 2;
const localQueries = queries.length ? queries : [''];
Copy link
Member

Choose a reason for hiding this comment

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

This doesnt stop the user from editing the query string and injecting more queries right?

Copy link
Member Author

Choose a reason for hiding this comment

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

no, basically if it's empty we pretend to have an array, otherwise we use the provided array

}

export function TracesSearchBar({query, handleSearch}: TracesSearchBarProps) {
const getSpanName = (index: number) => {
const spanNames = [t('Span A'), t('Span B'), t('Span C')];
Copy link
Member

Choose a reason for hiding this comment

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

Nit: move this into a constant outside the function

Copy link
Member Author

Choose a reason for hiding this comment

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

In that case the translate function would run during import, which isn't a good tradeoff. Hiding consts in helpers is fine.

@k-fish k-fish merged commit 001c56e into master Apr 29, 2024
@k-fish k-fish deleted the ref/traces-mult-queries-ux-2 branch April 29, 2024 21:33
@github-actions github-actions bot locked and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants