-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat(performance): Add search support to EAP txn summary sample events #111349
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
Changes from all commits
5f3439a
7153870
f007140
711cc39
ad4c1da
b733646
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,6 +13,7 @@ import {DatePageFilter} from 'sentry/components/pageFilters/date/datePageFilter' | |
| import {EnvironmentPageFilter} from 'sentry/components/pageFilters/environment/environmentPageFilter'; | ||
| import {PageFilterBar} from 'sentry/components/pageFilters/pageFilterBar'; | ||
| import {normalizeDateTimeParams} from 'sentry/components/pageFilters/parse'; | ||
| import {useSpanSearchQueryBuilderProps} from 'sentry/components/performance/spanSearchQueryBuilder'; | ||
| import {TransactionSearchQueryBuilder} from 'sentry/components/performance/transactionSearchQueryBuilder'; | ||
| import {t} from 'sentry/locale'; | ||
| import {DataCategory} from 'sentry/types/core'; | ||
|
|
@@ -29,6 +30,7 @@ import {useMaxPickableDays} from 'sentry/utils/useMaxPickableDays'; | |
| import {useNavigate} from 'sentry/utils/useNavigate'; | ||
| import {useRoutes} from 'sentry/utils/useRoutes'; | ||
| import {hasDatasetSelector} from 'sentry/views/dashboards/utils'; | ||
| import {TraceItemSearchQueryBuilder} from 'sentry/views/explore/components/traceItemSearchQueryBuilder'; | ||
| import {useDomainViewFilters} from 'sentry/views/insights/pages/useFilters'; | ||
| import {OverviewSpansTable} from 'sentry/views/performance/eap/overviewSpansTable'; | ||
| import {useTransactionSummaryEAP} from 'sentry/views/performance/eap/useTransactionSummaryEAP'; | ||
|
|
@@ -48,6 +50,27 @@ import {EventsTable} from './eventsTable'; | |
| import type {EventsDisplayFilterName} from './utils'; | ||
| import {getEventsFilterOptions} from './utils'; | ||
|
|
||
| function EAPSearchBar({ | ||
| projects, | ||
| initialQuery, | ||
| onSearch, | ||
| }: { | ||
| initialQuery: string; | ||
| onSearch: (query: string) => void; | ||
| projects: number[]; | ||
| }) { | ||
| const {spanSearchQueryBuilderProps} = useSpanSearchQueryBuilderProps({ | ||
| projects, | ||
| initialQuery, | ||
| onSearch, | ||
| searchSource: 'transaction_events', | ||
| }); | ||
|
|
||
| return ( | ||
| <TraceItemSearchQueryBuilder {...spanSearchQueryBuilderProps} disallowFreeText /> | ||
| ); | ||
| } | ||
|
|
||
| type Props = { | ||
| eventView: EventView; | ||
| eventsDisplayFilterName: EventsDisplayFilterName; | ||
|
|
@@ -90,8 +113,13 @@ export function EventsContent(props: Props) { | |
| const routes = useRoutes(); | ||
| const theme = useTheme(); | ||
| const domainViewFilters = useDomainViewFilters(); | ||
| const shouldUseEAP = useTransactionSummaryEAP(); | ||
|
|
||
| const {eventView, titles} = useMemo(() => { | ||
| if (shouldUseEAP) { | ||
| return {eventView: originalEventView, titles: []}; | ||
| } | ||
|
|
||
| const eventViewClone = originalEventView.clone(); | ||
| const transactionsListTitles = TRANSACTIONS_LIST_TITLES.slice(); | ||
| const project = projects.find(p => p.id === projectId); | ||
|
|
@@ -164,6 +192,7 @@ export function EventsContent(props: Props) { | |
| titles: transactionsListTitles, | ||
| }; | ||
| }, [ | ||
| shouldUseEAP, | ||
| originalEventView, | ||
| location, | ||
| organization, | ||
|
|
@@ -173,8 +202,6 @@ export function EventsContent(props: Props) { | |
| webVital, | ||
| ]); | ||
|
|
||
| const shouldUseEAP = useTransactionSummaryEAP(); | ||
|
|
||
| const table = shouldUseEAP ? ( | ||
| <OverviewSpansTable | ||
| eventView={eventView} | ||
|
|
@@ -250,7 +277,7 @@ function Search(props: Props) { | |
| const shouldUseEAP = useTransactionSummaryEAP(); | ||
|
|
||
| const maxPickableDays = useMaxPickableDays({ | ||
| dataCategories: [DataCategory.TRANSACTIONS], | ||
| dataCategories: [shouldUseEAP ? DataCategory.SPANS : DataCategory.TRANSACTIONS], | ||
| }); | ||
| const datePageFilterProps = useDatePageFilterProps(maxPickableDays); | ||
|
|
||
|
|
@@ -270,34 +297,46 @@ function Search(props: Props) { | |
| <DatePageFilter {...datePageFilterProps} /> | ||
| </PageFilterBar> | ||
| <StyledSearchBarWrapper> | ||
| <TransactionSearchQueryBuilder | ||
|
mjq marked this conversation as resolved.
|
||
| projects={projectIds} | ||
| initialQuery={query} | ||
| onSearch={handleSearch} | ||
| searchSource="transaction_events" | ||
| /> | ||
| </StyledSearchBarWrapper> | ||
| <CompactSelect | ||
| trigger={triggerProps => ( | ||
| <OverlayTrigger.Button {...triggerProps} prefix={t('Percentile')} /> | ||
| )} | ||
| value={eventsDisplayFilterName} | ||
| onChange={opt => onChangeEventsDisplayFilter(opt.value)} | ||
| options={Object.entries(eventsFilterOptions).map(([name, filter]) => ({ | ||
| value: name as EventsDisplayFilterName, | ||
| label: filter.label, | ||
| }))} | ||
| /> | ||
| <LinkButton | ||
| to={eventView.getResultsViewUrlTarget( | ||
| organization, | ||
| false, | ||
| hasDatasetSelector(organization) ? SavedQueryDatasets.TRANSACTIONS : undefined | ||
| {shouldUseEAP ? ( | ||
| <EAPSearchBar | ||
| projects={projectIds ?? []} | ||
| initialQuery={query} | ||
| onSearch={handleSearch} | ||
| /> | ||
| ) : ( | ||
| <TransactionSearchQueryBuilder | ||
| projects={projectIds} | ||
| initialQuery={query} | ||
| onSearch={handleSearch} | ||
| searchSource="transaction_events" | ||
| /> | ||
| )} | ||
| onClick={handleDiscoverButtonClick} | ||
| > | ||
| {t('Open in Discover')} | ||
| </LinkButton> | ||
| </StyledSearchBarWrapper> | ||
| {!shouldUseEAP && ( | ||
| <CompactSelect | ||
| trigger={triggerProps => ( | ||
| <OverlayTrigger.Button {...triggerProps} prefix={t('Percentile')} /> | ||
| )} | ||
| value={eventsDisplayFilterName} | ||
| onChange={opt => onChangeEventsDisplayFilter(opt.value)} | ||
| options={Object.entries(eventsFilterOptions).map(([name, filter]) => ({ | ||
| value: name as EventsDisplayFilterName, | ||
| label: filter.label, | ||
| }))} | ||
| /> | ||
| )} | ||
| {!shouldUseEAP && ( | ||
| <LinkButton | ||
| to={eventView.getResultsViewUrlTarget( | ||
| organization, | ||
| false, | ||
| hasDatasetSelector(organization) ? SavedQueryDatasets.TRANSACTIONS : undefined | ||
| )} | ||
| onClick={handleDiscoverButtonClick} | ||
| > | ||
| {t('Open in Discover')} | ||
| </LinkButton> | ||
| )} | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Grid template not adjusted for fewer EAP childrenLow Severity The |
||
| </FilterActions> | ||
| ); | ||
| } | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.