@@ -12,18 +12,12 @@ import {MutableSearch} from 'sentry/utils/tokenizeSearch';
12
12
import { useLocation } from 'sentry/utils/useLocation' ;
13
13
import { useNavigate } from 'sentry/utils/useNavigate' ;
14
14
import { useSpansIndexed } from 'sentry/views/insights/common/queries/useDiscover' ;
15
- import { useFullSpanFromTrace } from 'sentry/views/insights/common/queries/useFullSpanFromTrace' ;
16
15
import { useModuleURL } from 'sentry/views/insights/common/utils/useModuleURL' ;
17
16
import { prettyPrintJsonString } from 'sentry/views/insights/database/utils/jsonUtils' ;
18
17
import { ModuleName , SpanIndexedField } from 'sentry/views/insights/types' ;
19
18
20
19
const formatter = new SQLishFormatter ( ) ;
21
20
22
- const INDEXED_SPAN_SORT = {
23
- field : 'span.self_time' ,
24
- kind : 'desc' as const ,
25
- } ;
26
-
27
21
interface Props {
28
22
moduleName : ModuleName ;
29
23
filters ?: Record < string , string > ;
@@ -39,30 +33,24 @@ export function FullSpanDescription({
39
33
} : Props ) {
40
34
const { data : indexedSpans , isFetching : areIndexedSpansLoading } = useSpansIndexed (
41
35
{
42
- search : MutableSearch . fromQueryObject ( { 'span.group' : group } ) ,
36
+ search : MutableSearch . fromQueryObject ( { 'span.group' : group , ... filters } ) ,
43
37
limit : 1 ,
44
38
fields : [
45
39
SpanIndexedField . PROJECT_ID ,
46
40
SpanIndexedField . TRANSACTION_ID ,
47
41
SpanIndexedField . SPAN_DESCRIPTION ,
42
+ SpanIndexedField . DB_SYSTEM ,
48
43
] ,
49
44
} ,
50
45
'api.starfish.span-description'
51
46
) ;
52
- const indexedSpan = indexedSpans ?. [ 0 ] ;
53
47
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 ] ;
60
49
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' ] ;
64
52
65
- if ( areIndexedSpansLoading || ( isLoading && isFetching ) ) {
53
+ if ( areIndexedSpansLoading ) {
66
54
return (
67
55
< PaddedSpinner >
68
56
< LoadingIndicator mini relative />
@@ -83,10 +71,8 @@ export function FullSpanDescription({
83
71
result = prettyPrintJsonString ( indexedSpan ?. [ 'span.description' ] ) ;
84
72
} else if ( description ) {
85
73
result = prettyPrintJsonString ( description ) ;
86
- } else if ( fullSpan ?. sentry_tags ?. description ) {
87
- result = prettyPrintJsonString ( fullSpan ?. sentry_tags . description ) ;
88
74
} else {
89
- stringifiedQuery = description || fullSpan ?. sentry_tags ?. description || 'N/A' ;
75
+ stringifiedQuery = description || 'N/A' ;
90
76
}
91
77
92
78
if ( result ) {
0 commit comments