Skip to content

Commit bfb1cf8

Browse files
authored
feat(insights): fix response code breakdown to use eap (#91820)
Update the breakdown chart to use the `useTopNSpanMetricsSeries` which had the EAP conditional
1 parent f7e4440 commit bfb1cf8

File tree

4 files changed

+13
-295
lines changed

4 files changed

+13
-295
lines changed

static/app/views/insights/common/queries/useSpanMetricsTopNSeries.spec.tsx

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

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

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

static/app/views/insights/http/components/httpSamplesPanel.spec.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,6 @@ describe('HTTPSamplesPanel', () => {
242242
expect.objectContaining({
243243
method: 'GET',
244244
query: {
245-
cursor: undefined,
246245
dataset: 'spansMetrics',
247246
environment: [],
248247
excludeOther: 0,
@@ -256,8 +255,8 @@ describe('HTTPSamplesPanel', () => {
256255
'span.module:http span.op:http.client !has:span.domain transaction:/api/0/users span.status_code:[300,301,302,303,304,305,307,308]',
257256
referrer: 'api.performance.http.samples-panel-response-code-chart',
258257
statsPeriod: '10d',
259-
sort: '-count()',
260258
topEvents: '5',
259+
transformAliasToInputFormat: '0',
261260
yAxis: 'count()',
262261
},
263262
})

static/app/views/insights/http/components/httpSamplesPanel.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import {
4040
useSpansIndexed,
4141
} from 'sentry/views/insights/common/queries/useDiscover';
4242
import {useSpanMetricsSeries} from 'sentry/views/insights/common/queries/useDiscoverSeries';
43-
import {useSpanMetricsTopNSeries} from 'sentry/views/insights/common/queries/useSpanMetricsTopNSeries';
43+
import {useTopNSpanMetricsSeries} from 'sentry/views/insights/common/queries/useTopNDiscoverSeries';
4444
import {
4545
DataTitles,
4646
getDurationChartTitle,
@@ -205,20 +205,20 @@ export function HTTPSamplesPanel() {
205205
isFetching: isResponseCodeDataLoading,
206206
data: responseCodeData,
207207
error: responseCodeError,
208-
} = useSpanMetricsTopNSeries({
209-
search,
210-
fields: ['span.status_code', 'count()'],
211-
yAxis: ['count()'],
212-
topEvents: 5,
213-
sorts: [
214-
{
208+
} = useTopNSpanMetricsSeries(
209+
{
210+
search,
211+
fields: ['span.status_code', 'count()'],
212+
yAxis: ['count()'],
213+
topN: 5,
214+
sort: {
215215
kind: 'desc',
216216
field: 'count()',
217217
},
218-
],
219-
enabled: isPanelOpen && query.panel === 'status',
220-
referrer: Referrer.SAMPLES_PANEL_RESPONSE_CODE_CHART,
221-
});
218+
enabled: isPanelOpen && query.panel === 'status',
219+
},
220+
Referrer.SAMPLES_PANEL_RESPONSE_CODE_CHART
221+
);
222222

223223
const durationAxisMax = computeAxisMax([durationData?.[`avg(span.self_time)`]]);
224224

0 commit comments

Comments
 (0)