|
@@ -13,6 +13,7 @@ import {
|
|
|
import {useLocation} from 'sentry/utils/useLocation';
|
|
|
import useOrganization from 'sentry/utils/useOrganization';
|
|
|
import usePageFilters from 'sentry/utils/usePageFilters';
|
|
|
+import {StarfishType} from 'sentry/views/starfish/types';
|
|
|
import {
|
|
|
getRetryDelay,
|
|
|
shouldRetryHandler,
|
|
@@ -28,6 +29,7 @@ export function useSpansQuery<T = any[]>({
|
|
|
enabled,
|
|
|
referrer = 'use-spans-query',
|
|
|
cursor,
|
|
|
+ view = StarfishType.BACKEND,
|
|
|
}: {
|
|
|
cursor?: string;
|
|
|
enabled?: boolean;
|
|
@@ -35,6 +37,7 @@ export function useSpansQuery<T = any[]>({
|
|
|
initialData?: T;
|
|
|
limit?: number;
|
|
|
referrer?: string;
|
|
|
+ view?: StarfishType;
|
|
|
}) {
|
|
|
const isTimeseriesQuery = (eventView?.yAxis?.length ?? 0) > 0;
|
|
|
const queryFunction = isTimeseriesQuery
|
|
@@ -44,8 +47,13 @@ export function useSpansQuery<T = any[]>({
|
|
|
const {isReady: pageFiltersReady} = usePageFilters();
|
|
|
|
|
|
if (eventView) {
|
|
|
+ const newEventView = eventView.clone();
|
|
|
+ // We can also add `if (view == 'mobile') -> 'transaction.op:ui.load'` here in the future
|
|
|
+ if (view === StarfishType.BACKEND) {
|
|
|
+ newEventView.query = `${eventView.query} transaction.op:http.server`;
|
|
|
+ }
|
|
|
const response = queryFunction<T>({
|
|
|
- eventView,
|
|
|
+ eventView: newEventView,
|
|
|
initialData,
|
|
|
limit,
|
|
|
// We always want to wait until the pageFilters are ready to prevent clobbering requests
|