@@ -13,8 +13,6 @@ import useOrganization from 'sentry/utils/useOrganization';
13
13
import useProjects from 'sentry/utils/useProjects' ;
14
14
import { useRelease } from 'sentry/utils/useRelease' ;
15
15
import { useSpansIndexed } from 'sentry/views/insights/common/queries/useDiscover' ;
16
- import { useFullSpanFromTrace } from 'sentry/views/insights/common/queries/useFullSpanFromTrace' ;
17
- import { useInsightsEap } from 'sentry/views/insights/common/utils/useEap' ;
18
16
import {
19
17
MissingFrame ,
20
18
StackTraceMiniFrame ,
@@ -51,7 +49,6 @@ export function DatabaseSpanDescription({
51
49
} : Omit < Props , 'op' > ) {
52
50
const navigate = useNavigate ( ) ;
53
51
const location = useLocation ( ) ;
54
- const useEap = useInsightsEap ( ) ;
55
52
const { projects} = useProjects ( ) ;
56
53
const organization = useOrganization ( ) ;
57
54
@@ -83,7 +80,7 @@ export function DatabaseSpanDescription({
83
80
orgSlug : organization . slug ,
84
81
projectSlug : project ?. slug ?? '' ,
85
82
releaseVersion : indexedSpan ?. release ?? '' ,
86
- enabled : useEap ,
83
+ enabled : indexedSpan ?. release !== undefined ,
87
84
} ) ;
88
85
89
86
const sdk =
@@ -100,13 +97,6 @@ export function DatabaseSpanDescription({
100
97
sdk,
101
98
} ;
102
99
103
- // NOTE: We only need this for `span.data`! If this info existed in indexed spans, we could skip it
104
- const { data : rawSpan , isFetching : isRawSpanLoading } = useFullSpanFromTrace (
105
- groupId ,
106
- [ INDEXED_SPAN_SORT ] ,
107
- Boolean ( indexedSpan ) && ! useEap
108
- ) ;
109
-
110
100
// isExpanded is a query param that is meant to be accessed only when clicking on the
111
101
// "View full query" button from the hover tooltip. It is removed from the query params
112
102
// on the initial load so the value is not persisted through the link
@@ -121,39 +111,24 @@ export function DatabaseSpanDescription({
121
111
// eslint-disable-next-line react-hooks/exhaustive-deps
122
112
} , [ navigate ] ) ;
123
113
124
- const system = useEap ? indexedSpan ?. [ 'db.system' ] : rawSpan ?. data ?. [ 'db.system' ] ;
125
- const codeFilepath = useEap
126
- ? indexedSpan ?. [ 'code.filepath' ]
127
- : rawSpan ?. data ?. [ 'code.filepath' ] ;
128
- const codeLineno = useEap
129
- ? indexedSpan ?. [ 'code.lineno' ]
130
- : rawSpan ?. data ?. [ 'code.lineno' ] ;
131
- const codeFunction = useEap
132
- ? indexedSpan ?. [ 'code.function' ]
133
- : rawSpan ?. data ?. [ 'code.function' ] ;
114
+ const system = indexedSpan ?. [ 'db.system' ] ;
115
+ const codeFilepath = indexedSpan ?. [ 'code.filepath' ] ;
116
+ const codeLineno = indexedSpan ?. [ 'code.lineno' ] ;
117
+ const codeFunction = indexedSpan ?. [ 'code.function' ] ;
134
118
135
119
const formattedDescription = useMemo ( ( ) => {
136
- const description = useEap ? indexedSpan ?. [ 'span.description' ] : rawSpan ?. description ;
137
- const rawDescription =
138
- description || indexedSpan ?. [ 'span.description' ] || preliminaryDescription ;
120
+ const rawDescription = indexedSpan ?. [ 'span.description' ] || preliminaryDescription ;
139
121
140
122
if ( system === SupportedDatabaseSystem . MONGODB ) {
141
123
let bestDescription = '' ;
142
124
143
- if (
144
- rawSpan ?. sentry_tags ?. description &&
145
- isValidJson ( rawSpan . sentry_tags . description )
146
- ) {
147
- bestDescription = rawSpan . sentry_tags . description ;
148
- } else if ( preliminaryDescription && isValidJson ( preliminaryDescription ) ) {
125
+ if ( preliminaryDescription && isValidJson ( preliminaryDescription ) ) {
149
126
bestDescription = preliminaryDescription ;
150
127
} else if (
151
128
indexedSpan ?. [ 'span.description' ] &&
152
129
isValidJson ( indexedSpan ?. [ 'span.description' ] )
153
130
) {
154
131
bestDescription = indexedSpan ?. [ 'span.description' ] ;
155
- } else if ( rawSpan ?. description && isValidJson ( rawSpan . description ) ) {
156
- bestDescription = rawSpan ?. description ;
157
132
} else {
158
133
return rawDescription ?? 'N/A' ;
159
134
}
@@ -162,11 +137,11 @@ export function DatabaseSpanDescription({
162
137
}
163
138
164
139
return formatter . toString ( rawDescription ?? '' ) ;
165
- } , [ preliminaryDescription , rawSpan , indexedSpan , system , useEap ] ) ;
140
+ } , [ preliminaryDescription , indexedSpan , system ] ) ;
166
141
167
142
return (
168
143
< Frame >
169
- { areIndexedSpansLoading || isRawSpanLoading ? (
144
+ { areIndexedSpansLoading ? (
170
145
< WithPadding >
171
146
< LoadingIndicator mini />
172
147
</ WithPadding >
@@ -178,7 +153,7 @@ export function DatabaseSpanDescription({
178
153
</ QueryClippedBox >
179
154
) }
180
155
181
- { ! areIndexedSpansLoading && ! isRawSpanLoading && (
156
+ { ! areIndexedSpansLoading && (
182
157
< Fragment >
183
158
{ codeFilepath ? (
184
159
< StackTraceMiniFrame
@@ -209,11 +184,6 @@ function QueryClippedBox(props: any) {
209
184
return < StyledClippedBox { ...props } /> ;
210
185
}
211
186
212
- const INDEXED_SPAN_SORT = {
213
- field : 'span.self_time' ,
214
- kind : 'desc' as const ,
215
- } ;
216
-
217
187
export const Frame = styled ( 'div' ) `
218
188
border: solid 1px ${ p => p . theme . border } ;
219
189
border-radius: ${ p => p . theme . borderRadius } ;
0 commit comments