Skip to content

Commit 59fa00e

Browse files
committed
(refactor): use makeCoalescedFieldsAccessQuery in the 'top most time consuming ops' panel
1 parent 47da3b5 commit 59fa00e

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

packages/app/src/components/ServiceDashboardEndpointPerformanceChart.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ import { MS_NUMBER_FORMAT } from '@/ChartUtils';
55
import { ChartBox } from '@/components/ChartBox';
66
import DBListBarChart from '@/components/DBListBarChart';
77
import { useJsonColumns } from '@/hooks/useMetadata';
8-
import { getExpressions } from '@/serviceDashboard';
8+
import {
9+
getExpressions,
10+
makeCoalescedFieldsAccessQuery,
11+
} from '@/serviceDashboard';
912

1013
const MAX_NUM_GROUPS = 200;
1114

@@ -67,20 +70,16 @@ export default function ServiceDashboardEndpointPerformanceChart({
6770
// so we instead use toString() and an empty string check to check for
6871
// existence of the serverAddress/httpHost to build the span name
6972
if (jsonColumns.includes(spanAttributesExpression)) {
73+
const coalescedServerAddress = makeCoalescedFieldsAccessQuery(
74+
[expressions.serverAddress, expressions.httpHost],
75+
true,
76+
);
7077
spanNameColSql = `
7178
concat(
7279
${expressions.spanName}, ' ',
7380
if(
7481
has(['HTTP DELETE', 'DELETE', 'HTTP GET', 'GET', 'HTTP HEAD', 'HEAD', 'HTTP OPTIONS', 'OPTIONS', 'HTTP PATCH', 'PATCH', 'HTTP POST', 'POST', 'HTTP PUT', 'PUT'], ${expressions.spanName}),
75-
if(
76-
toString(${expressions.serverAddress}) != '',
77-
toString(${expressions.serverAddress}),
78-
if(
79-
toString(${expressions.httpHost}) != '',
80-
toString(${expressions.httpHost}),
81-
''
82-
)
83-
),
82+
${coalescedServerAddress},
8483
''
8584
)
8685
)`;

0 commit comments

Comments
 (0)