Skip to content

Commit d586540

Browse files
committed
Align trace target group drilldown
1 parent 061385a commit d586540

2 files changed

Lines changed: 48 additions & 1 deletion

File tree

web-next/lib/signal-dashboards.test.ts

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3442,6 +3442,49 @@ describe('signal dashboards API client', () => {
34423442
expect(renderer.rows[0]?.relatedHandoffHref).not.toContain('resourceFilter=http.route');
34433443
});
34443444

3445+
it('maps trace http target groups to operation drilldown without creating target entities', async () => {
3446+
const [plan] = buildSignalDashboardExecutionPlans({
3447+
dashboardKey: 'signals-overview',
3448+
title: 'Signals overview',
3449+
description: 'Signals',
3450+
tags: 'traces',
3451+
layout: '[]',
3452+
widgets: JSON.stringify([
3453+
{
3454+
id: 'traces-targets',
3455+
signal: 'traces',
3456+
title: 'HTTP targets',
3457+
visualization: 'list',
3458+
route: '/trace/manage?serviceName=checkout&serviceNamespace=payments&environment=prod&entityId=4200&entityType=service&entityName=Checkout+API&source=otlp&collector=collector-a&template=spring-boot&spanScope=all&groupBy=http.target&groupLimit=8'
3459+
}
3460+
])
3461+
});
3462+
3463+
const result = await executeSignalDashboardPanelPlan(plan, async url => {
3464+
expect(url).toBe('/traces/stats/group-by?serviceName=checkout&spanScope=all&entityId=4200&entityType=service&serviceNamespace=payments&environment=prod&groupBy=http.target&limit=8');
3465+
return {
3466+
groupBy: 'http.target',
3467+
groups: [{
3468+
value: '/checkout/42',
3469+
traceCount: 4,
3470+
errorTraceCount: 1,
3471+
latencyP95Ms: 95
3472+
}]
3473+
};
3474+
});
3475+
const renderer = buildSignalDashboardPanelRuntimeRenderDescriptor(plan, result);
3476+
3477+
expect(renderer.rows[0]).toEqual(expect.objectContaining({
3478+
key: 'traces-targets:group:0',
3479+
title: '/checkout/42',
3480+
copy: '4 traces · 1 errors',
3481+
meta: 'http.target · p95 95ms',
3482+
relatedSignal: 'traces',
3483+
relatedHandoffHref: '/trace/manage?serviceName=checkout&spanScope=all&environment=prod&entityId=4200&entityType=service&entityName=Checkout+API&serviceNamespace=payments&source=otlp&collector=collector-a&template=spring-boot&view=list&operationName=%2Fcheckout%2F42'
3484+
}));
3485+
expect(renderer.rows[0]?.relatedHandoffHref).not.toContain('resourceFilter=http.target');
3486+
});
3487+
34453488
it('renders backend-compatible trace group payload variants', async () => {
34463489
const [plan] = buildSignalDashboardExecutionPlans({
34473490
dashboardKey: 'signals-overview',

web-next/lib/signal-dashboards.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2606,8 +2606,12 @@ function buildTraceGroupResourceExpression(groupBy: string, value: string) {
26062606
normalizedGroupBy === 'operation.name' ||
26072607
normalizedGroupBy === 'span.name' ||
26082608
normalizedGroupBy === 'http.route' ||
2609+
normalizedGroupBy === 'http.target' ||
2610+
normalizedGroupBy === 'http.url' ||
26092611
normalizedGroupBy === 'route' ||
2610-
normalizedGroupBy === 'attribute:http.route'
2612+
normalizedGroupBy === 'attribute:http.route' ||
2613+
normalizedGroupBy === 'attribute:http.target' ||
2614+
normalizedGroupBy === 'attribute:http.url'
26112615
) {
26122616
return { kind: 'operation' as const, value: normalizedValue };
26132617
}

0 commit comments

Comments
 (0)