Skip to content

Commit 2689f9f

Browse files
committed
update tests
1 parent 2ad6e32 commit 2689f9f

File tree

2 files changed

+7
-89
lines changed

2 files changed

+7
-89
lines changed

static/app/views/insights/common/components/fullSpanDescription.tsx

Lines changed: 7 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,12 @@ import {MutableSearch} from 'sentry/utils/tokenizeSearch';
1212
import {useLocation} from 'sentry/utils/useLocation';
1313
import {useNavigate} from 'sentry/utils/useNavigate';
1414
import {useSpansIndexed} from 'sentry/views/insights/common/queries/useDiscover';
15-
import {useFullSpanFromTrace} from 'sentry/views/insights/common/queries/useFullSpanFromTrace';
1615
import {useModuleURL} from 'sentry/views/insights/common/utils/useModuleURL';
1716
import {prettyPrintJsonString} from 'sentry/views/insights/database/utils/jsonUtils';
1817
import {ModuleName, SpanIndexedField} from 'sentry/views/insights/types';
1918

2019
const formatter = new SQLishFormatter();
2120

22-
const INDEXED_SPAN_SORT = {
23-
field: 'span.self_time',
24-
kind: 'desc' as const,
25-
};
26-
2721
interface Props {
2822
moduleName: ModuleName;
2923
filters?: Record<string, string>;
@@ -39,30 +33,24 @@ export function FullSpanDescription({
3933
}: Props) {
4034
const {data: indexedSpans, isFetching: areIndexedSpansLoading} = useSpansIndexed(
4135
{
42-
search: MutableSearch.fromQueryObject({'span.group': group}),
36+
search: MutableSearch.fromQueryObject({'span.group': group, ...filters}),
4337
limit: 1,
4438
fields: [
4539
SpanIndexedField.PROJECT_ID,
4640
SpanIndexedField.TRANSACTION_ID,
4741
SpanIndexedField.SPAN_DESCRIPTION,
42+
SpanIndexedField.DB_SYSTEM,
4843
],
4944
},
5045
'api.starfish.span-description'
5146
);
52-
const indexedSpan = indexedSpans?.[0];
5347

54-
// This is used as backup in case we don't have the necessary data available in the indexed span
55-
const {
56-
data: fullSpan,
57-
isLoading,
58-
isFetching,
59-
} = useFullSpanFromTrace(group, [INDEXED_SPAN_SORT], Boolean(indexedSpan), filters);
48+
const indexedSpan = indexedSpans?.[0];
6049

61-
const description =
62-
indexedSpan?.['span.description'] ?? fullSpan?.description ?? shortDescription;
63-
const system = fullSpan?.data?.['db.system'];
50+
const description = indexedSpan?.['span.description'] ?? shortDescription;
51+
const system = indexedSpan?.['db.system'];
6452

65-
if (areIndexedSpansLoading || (isLoading && isFetching)) {
53+
if (areIndexedSpansLoading) {
6654
return (
6755
<PaddedSpinner>
6856
<LoadingIndicator mini relative />
@@ -83,10 +71,8 @@ export function FullSpanDescription({
8371
result = prettyPrintJsonString(indexedSpan?.['span.description']);
8472
} else if (description) {
8573
result = prettyPrintJsonString(description);
86-
} else if (fullSpan?.sentry_tags?.description) {
87-
result = prettyPrintJsonString(fullSpan?.sentry_tags.description);
8874
} else {
89-
stringifiedQuery = description || fullSpan?.sentry_tags?.description || 'N/A';
75+
stringifiedQuery = description || 'N/A';
9076
}
9177

9278
if (result) {

static/app/views/insights/common/queries/useFullSpanFromTrace.tsx

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)