Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import { actions } from '../../../../api/digma/actions';
import { dispatcher } from '../../../../api/digma/dispatcher';
import { state as globalState } from '../../../../api/digma/state';
import { ISpanInsight, SetSpansDataPayload } from '../../../../api/digma/types';
import { getInsightTypeInfo } from '../../../common/InsightIcon/utils';
import { getInsightTypeInfo, getInsightTypeOrderPriority } from '../../../common/InsightIcon/utils';
import { InsightIcon } from '../../../common/InsightIcon';
import Button from '../../../common/Button';
import { CrosshairIcon } from '../../../common/icons/CrosshairIcon';
Expand Down Expand Up @@ -80,7 +80,11 @@ export default class SpanDetail extends React.Component<SpanDetailProps, SpanDet
}

_sortInsightsByImportance(insights: ISpanInsight[]): ISpanInsight[] {
return [...insights].sort((a, b) => a.importance - b.importance);
return [...insights].sort(
(a, b) =>
a.importance - b.importance ||
getInsightTypeOrderPriority(a.type) - getInsightTypeOrderPriority(b.type)
);
}

_updateSpanInfo(data: unknown) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ export enum InsightType {
SpanScaling = 'SpanScaling',
SpanScalingRootCause = 'SpanScalingRootCause',
SpanDurationBreakdown = 'SpanDurationBreakdown',
EndpointDurationSlowdown = 'EndpointDurationSlowdown',
}
30 changes: 30 additions & 0 deletions packages/jaeger-ui/src/components/common/InsightIcon/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export const getInsightTypeInfo = (
icon: ClockWithTicksIcon,
label: 'Duration Breakdown',
},
[InsightType.EndpointDurationSlowdown]: {
icon: SnailIcon,
label: 'Duration Slowdown Source Detected',
},
};

return insightInfoMap[type];
Expand All @@ -110,3 +114,29 @@ export const getInsightImportanceColor = (importance: number): string | undefine

return '#1dc693';
};

export const getInsightTypeOrderPriority = (type: string): number => {
const insightOrderPriorityMap: Record<string, number> = {
[InsightType.HotSpot]: 1,
[InsightType.Errors]: 2,
[InsightType.TopErrorFlows]: 3,

[InsightType.SpanDurations]: 60,
[InsightType.SpanUsages]: 61,
[InsightType.SpanScaling]: 63,
[InsightType.SpanNPlusOne]: 65,
[InsightType.SpanDurationChange]: 66,
[InsightType.SpanEndpointBottleneck]: 67,
[InsightType.SpanDurationBreakdown]: 68,

[InsightType.EndpointSpanNPlusOne]: 55,
[InsightType.SlowestSpans]: 40,
[InsightType.LowUsage]: 30,
[InsightType.NormalUsage]: 50,
[InsightType.HighUsage]: 10,
[InsightType.SlowEndpoint]: 20,
[InsightType.EndpointDurationSlowdown]: 25,
};

return insightOrderPriorityMap[type] || Infinity;
};