File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
static/app/views/explore/hooks Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 11import { useMemo } from 'react' ;
22
33import { defined } from 'sentry/utils' ;
4+ import { MAX_CROSS_EVENT_QUERIES } from 'sentry/views/explore/constants' ;
45import { useQueryParamsCrossEvents } from 'sentry/views/explore/queryParams/context' ;
56
67export function useCrossEventQueries ( ) {
@@ -11,11 +12,15 @@ export function useCrossEventQueries() {
1112 return undefined ;
1213 }
1314
15+ // We only want to include the first MAX_CROSS_EVENT_QUERIES cross events in the
16+ // actual API request to avoid overwhelming the backend.
17+ const slicedCrossEvents = crossEvents . slice ( 0 , MAX_CROSS_EVENT_QUERIES ) ;
18+
1419 const logQuery : string [ ] = [ ] ;
1520 const metricQuery : string [ ] = [ ] ;
1621 const spanQuery : string [ ] = [ ] ;
1722
18- for ( const crossEvent of crossEvents ) {
23+ for ( const crossEvent of slicedCrossEvents ) {
1924 switch ( crossEvent . type ) {
2025 case 'spans' :
2126 spanQuery . push ( crossEvent . query ) ;
You can’t perform that action at this time.
0 commit comments