From 623839e273f81279a61f3319876ec519cea632c4 Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Wed, 31 May 2023 19:20:47 +0200 Subject: [PATCH 1/2] Add Endpoint Duration Slowdown insight --- packages/jaeger-ui/src/components/common/InsightIcon/types.ts | 1 + packages/jaeger-ui/src/components/common/InsightIcon/utils.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/packages/jaeger-ui/src/components/common/InsightIcon/types.ts b/packages/jaeger-ui/src/components/common/InsightIcon/types.ts index d153e213fc..43fcaf681d 100644 --- a/packages/jaeger-ui/src/components/common/InsightIcon/types.ts +++ b/packages/jaeger-ui/src/components/common/InsightIcon/types.ts @@ -25,4 +25,5 @@ export enum InsightType { SpanScaling = 'SpanScaling', SpanScalingRootCause = 'SpanScalingRootCause', SpanDurationBreakdown = 'SpanDurationBreakdown', + EndpointDurationSlowdown = 'EndpointDurationSlowdown', } diff --git a/packages/jaeger-ui/src/components/common/InsightIcon/utils.ts b/packages/jaeger-ui/src/components/common/InsightIcon/utils.ts index 52b94bec39..65a7e7ab3d 100644 --- a/packages/jaeger-ui/src/components/common/InsightIcon/utils.ts +++ b/packages/jaeger-ui/src/components/common/InsightIcon/utils.ts @@ -89,6 +89,10 @@ export const getInsightTypeInfo = ( icon: ClockWithTicksIcon, label: 'Duration Breakdown', }, + [InsightType.EndpointDurationSlowdown]: { + icon: SnailIcon, + label: 'Duration Slowdown Source Detected', + }, }; return insightInfoMap[type]; From f5ea3017718fff53bcba39f029aeed1a33b3a12e Mon Sep 17 00:00:00 2001 From: Kyrylo Shmidt Date: Wed, 31 May 2023 19:52:16 +0200 Subject: [PATCH 2/2] Sort insights by order priority --- .../TraceTimelineViewer/SpanDetail/index.tsx | 8 ++++-- .../components/common/InsightIcon/utils.ts | 26 +++++++++++++++++++ 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/index.tsx b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/index.tsx index f5adb0fffe..937fb13c21 100644 --- a/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/index.tsx +++ b/packages/jaeger-ui/src/components/TracePage/TraceTimelineViewer/SpanDetail/index.tsx @@ -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'; @@ -80,7 +80,11 @@ export default class SpanDetail extends React.Component a.importance - b.importance); + return [...insights].sort( + (a, b) => + a.importance - b.importance || + getInsightTypeOrderPriority(a.type) - getInsightTypeOrderPriority(b.type) + ); } _updateSpanInfo(data: unknown) { diff --git a/packages/jaeger-ui/src/components/common/InsightIcon/utils.ts b/packages/jaeger-ui/src/components/common/InsightIcon/utils.ts index 65a7e7ab3d..9a29af8e57 100644 --- a/packages/jaeger-ui/src/components/common/InsightIcon/utils.ts +++ b/packages/jaeger-ui/src/components/common/InsightIcon/utils.ts @@ -114,3 +114,29 @@ export const getInsightImportanceColor = (importance: number): string | undefine return '#1dc693'; }; + +export const getInsightTypeOrderPriority = (type: string): number => { + const insightOrderPriorityMap: Record = { + [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; +};