diff --git a/src/components/Insights/BottleneckInsight/mockData.ts b/src/components/Insights/BottleneckInsight/mockData.ts index 6ec96c3ef..a3cf801f8 100644 --- a/src/components/Insights/BottleneckInsight/mockData.ts +++ b/src/components/Insights/BottleneckInsight/mockData.ts @@ -6,6 +6,7 @@ import { } from "../types"; export const mockedBottleneckInsight: SpanEndpointBottleneckInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-1cce7979ac6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -48,6 +49,10 @@ export const mockedBottleneckInsight: SpanEndpointBottleneckInsight = { unit: "sec", raw: 3887134558.2822084 }, + impact: 0.14877828054298645, + severity: 0.2877828054298645, + criticality: 0.5687782805429865, + requestPercentage: 35, p50: { fraction: 0, maxDuration: { diff --git a/src/components/Insights/DurationBreakdownInsight/DurationBreakdownInsight.stories.tsx b/src/components/Insights/DurationBreakdownInsight/DurationBreakdownInsight.stories.tsx index 063e23179..1c0bbc5a4 100644 --- a/src/components/Insights/DurationBreakdownInsight/DurationBreakdownInsight.stories.tsx +++ b/src/components/Insights/DurationBreakdownInsight/DurationBreakdownInsight.stories.tsx @@ -20,6 +20,7 @@ type Story = StoryObj; export const Default: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ac6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/DurationInsight/DurationInsight.stories.tsx b/src/components/Insights/DurationInsight/DurationInsight.stories.tsx index df40a87c5..1cf110bad 100644 --- a/src/components/Insights/DurationInsight/DurationInsight.stories.tsx +++ b/src/components/Insights/DurationInsight/DurationInsight.stories.tsx @@ -20,6 +20,7 @@ type Story = StoryObj; export const WithAverage: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -136,6 +137,7 @@ export const WithAverage: Story = { export const WithChange: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: null, lastDetected: null, @@ -242,6 +244,7 @@ export const WithChange: Story = { export const WithEvaluatingChange: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: null, lastDetected: null, @@ -348,6 +351,7 @@ export const WithEvaluatingChange: Story = { export const HistogramWithManyBars: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: null, lastDetected: null, @@ -4872,6 +4876,7 @@ export const HistogramWithManyBars: Story = { export const HistogramWithGaps: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: null, lastDetected: null, @@ -5126,6 +5131,7 @@ export const HistogramWithGaps: Story = { export const HistogramWithAFewBars: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: null, lastDetected: null, @@ -5280,6 +5286,7 @@ export const HistogramWithAFewBars: Story = { export const EmptyStateBug: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", name: "Performance Stats", type: InsightType.SpanDurations, diff --git a/src/components/Insights/DurationSlowdownSourceInsight/DurationSlowdownSourceInsight.stories.tsx b/src/components/Insights/DurationSlowdownSourceInsight/DurationSlowdownSourceInsight.stories.tsx index 4f602ec3f..b9307512c 100644 --- a/src/components/Insights/DurationSlowdownSourceInsight/DurationSlowdownSourceInsight.stories.tsx +++ b/src/components/Insights/DurationSlowdownSourceInsight/DurationSlowdownSourceInsight.stories.tsx @@ -20,6 +20,7 @@ type Story = StoryObj; export const WithEvaluatingChange: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cde7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/EndpointNPlusOneInsight/mockData.ts b/src/components/Insights/EndpointNPlusOneInsight/mockData.ts index 80c92f8de..bf1c8d8b4 100644 --- a/src/components/Insights/EndpointNPlusOneInsight/mockData.ts +++ b/src/components/Insights/EndpointNPlusOneInsight/mockData.ts @@ -6,6 +6,7 @@ import { } from "../types"; export const mockedEndpointNPlusOneInsight: EndpointSuspectedNPlusOneInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7919ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/EndpointQueryOptimizationInsight/mockData.ts b/src/components/Insights/EndpointQueryOptimizationInsight/mockData.ts index 689a4156f..68c6589cc 100644 --- a/src/components/Insights/EndpointQueryOptimizationInsight/mockData.ts +++ b/src/components/Insights/EndpointQueryOptimizationInsight/mockData.ts @@ -7,6 +7,7 @@ import { export const mockedEndpointQueryOptimizationInsight: EndpointQueryOptimizationInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7989ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/ErrorsInsight/ErrorsInsight.stories.tsx b/src/components/Insights/ErrorsInsight/ErrorsInsight.stories.tsx index c9f454065..f7f9ef336 100644 --- a/src/components/Insights/ErrorsInsight/ErrorsInsight.stories.tsx +++ b/src/components/Insights/ErrorsInsight/ErrorsInsight.stories.tsx @@ -20,6 +20,7 @@ type Story = StoryObj; export const Default: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-3cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/ExcessiveAPICallsInsight/ExcessiveAPICallsInsight.stories.tsx b/src/components/Insights/ExcessiveAPICallsInsight/ExcessiveAPICallsInsight.stories.tsx index ae26aaf24..0a9f566f7 100644 --- a/src/components/Insights/ExcessiveAPICallsInsight/ExcessiveAPICallsInsight.stories.tsx +++ b/src/components/Insights/ExcessiveAPICallsInsight/ExcessiveAPICallsInsight.stories.tsx @@ -20,6 +20,7 @@ type Story = StoryObj; export const Default: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9688-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/HighNumberOfQueriesInsight/mockData.ts b/src/components/Insights/HighNumberOfQueriesInsight/mockData.ts index ff1ac43da..669203bd3 100644 --- a/src/components/Insights/HighNumberOfQueriesInsight/mockData.ts +++ b/src/components/Insights/HighNumberOfQueriesInsight/mockData.ts @@ -7,6 +7,7 @@ import { export const mockedHighNumberOfQueriesInsight: EndpointHighNumberOfQueriesInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9623-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -24,12 +25,6 @@ export const mockedHighNumberOfQueriesInsight: EndpointHighNumberOfQueriesInsigh importance: 3, queriesCount: 250, typicalCount: 4, - medianDuration: { - value: 150, - unit: "ms", - raw: 150000000.0 - }, - requestFraction: 0.3, traceId: "00D37A4E7208E0F6E89AA7E2E37446A6", scope: InsightScope.EntrySpan, endpointSpan: "HTTP POST /owners/{ownerId}/pets/new", diff --git a/src/components/Insights/InsightCard/InsightCard.stories.tsx b/src/components/Insights/InsightCard/InsightCard.stories.tsx index 619869388..83e7f98ba 100644 --- a/src/components/Insights/InsightCard/InsightCard.stories.tsx +++ b/src/components/Insights/InsightCard/InsightCard.stories.tsx @@ -2,7 +2,11 @@ import { Meta, StoryObj } from "@storybook/react"; import { InsightCard } from "."; import { InsightType } from "../../../types"; import { Button } from "../../common/Button"; -import { InsightCategory, InsightScope } from "../types"; +import { + EndpointSuspectedNPlusOneInsight, + InsightCategory, + InsightScope +} from "../types"; // More on how to set up stories at: https://storybook.js.org/docs/react/writing-stories/introduction const meta: Meta = { @@ -21,6 +25,7 @@ type Story = StoryObj; export const Default: Story = { args: { data: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9638-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -93,12 +98,12 @@ export const Default: Story = { ], environment: "SAMPLE_ENV", severity: 0, - isRecalculateEnabled: false, + isRecalculateEnabled: true, prefixedCodeObjectId: "method:org.springframework.samples.petclinic.sample.SampleInsightsController$_$genNPlusOneWithoutInternalSpan", customStartTime: null, actualStartTime: "2023-06-16T10:30:33.027Z" - }, + } as EndpointSuspectedNPlusOneInsight, stats: "Some stats", isAsync: true, content: ( diff --git a/src/components/Insights/InsightJiraTicket/InsightJiraTicket.stories.tsx b/src/components/Insights/InsightJiraTicket/InsightJiraTicket.stories.tsx index db7f6d3b0..f09be3595 100644 --- a/src/components/Insights/InsightJiraTicket/InsightJiraTicket.stories.tsx +++ b/src/components/Insights/InsightJiraTicket/InsightJiraTicket.stories.tsx @@ -18,6 +18,7 @@ export default meta; type Story = StoryObj; const insight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4d5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/Insights.stories.tsx b/src/components/Insights/Insights.stories.tsx index 7b18fec0d..2da03a953 100644 --- a/src/components/Insights/Insights.stories.tsx +++ b/src/components/Insights/Insights.stories.tsx @@ -11,6 +11,7 @@ import { InsightCategory, InsightScope, InsightsStatus, + SpanNPlusOneInsight, ViewMode } from "./types"; @@ -53,6 +54,7 @@ export const Default: Story = { // needsObservabilityFix: false, insights: [ { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8362-4c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -158,8 +160,9 @@ export const Default: Story = { "method:org.springframework.samples.petclinic.domain.OwnerValidation$_$ValidateOwner", customStartTime: null, actualStartTime: "2023-07-27T08:23:56.500827Z" - }, + } as SpanNPlusOneInsight, { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "62b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -232,6 +235,7 @@ export const Default: Story = { actualStartTime: "2023-06-26T00:00:00.000Z" }, { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-3262-4c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -287,6 +291,7 @@ export const Default: Story = { actualStartTime: "2023-06-26T13:53:53.645Z" }, { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-4262-4c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -328,6 +333,7 @@ export const Default: Story = { actualStartTime: "2023-06-26T13:53:57.956Z" }, { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8252-4c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -385,6 +391,7 @@ export const Default: Story = { actualStartTime: "2023-06-12T13:48:59.404Z" }, { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-5628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -481,6 +488,7 @@ export const Default: Story = { actualStartTime: "2023-06-12T13:49:08.186Z" }, { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-6cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -557,6 +565,7 @@ export const Default: Story = { actualStartTime: "2023-06-12T13:49:03.486Z" }, { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce8979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -653,6 +662,7 @@ export const Default: Story = { actualStartTime: "2023-06-13T00:00:00.000Z" }, { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce9979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -806,6 +816,7 @@ export const NoObservability: Story = { }; const errorsInsight: CodeObjectErrorsInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad1d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/InsightsPage/index.tsx b/src/components/Insights/InsightsPage/index.tsx index df7c410c2..ca7dd2439 100644 --- a/src/components/Insights/InsightsPage/index.tsx +++ b/src/components/Insights/InsightsPage/index.tsx @@ -11,60 +11,48 @@ import { ConfigContext } from "../../common/App/ConfigContext"; import { Card } from "../../common/Card"; import { EmptyState } from "../../common/EmptyState"; import { CardsIcon } from "../../common/icons/CardsIcon"; -import { BottleneckInsight } from "../BottleneckInsight"; import { DurationBreakdownInsight } from "../DurationBreakdownInsight"; -import { DurationInsight } from "../DurationInsight"; -import { DurationSlowdownSourceInsight } from "../DurationSlowdownSourceInsight"; -import { EndpointNPlusOneInsight } from "../EndpointNPlusOneInsight"; import { EndpointQueryOptimizationInsight } from "../EndpointQueryOptimizationInsight"; -import { ErrorsInsight } from "../ErrorsInsight"; -import { ExcessiveAPICallsInsight } from "../ExcessiveAPICallsInsight"; -import { HighNumberOfQueriesInsight } from "../HighNumberOfQueriesInsight"; -import { InsightCard } from "../InsightCard"; import { NPlusOneInsight } from "../NPlusOneInsight"; -import { NoScalingIssueInsight } from "../NoScalingIssueInsight"; -import { PerformanceAtScaleInsight } from "../PerformanceAtScaleInsight"; import { QueryOptimizationInsight } from "../QueryOptimizationInsight"; import { RequestBreakdownInsight } from "../RequestBreakdownInsight"; import { ScalingIssueInsight } from "../ScalingIssueInsight"; import { SessionInViewInsight } from "../SessionInViewInsight"; -import { SlowEndpointInsight } from "../SlowEndpointInsight"; -import { SpanBottleneckInsight } from "../SpanBottleneckInsight"; -import { SpanNexusInsight } from "../SpanNexusInsight"; import { TopUsageInsight } from "../TopUsageInsight"; -import { TrafficInsight } from "../TrafficInsight"; import { actions } from "../actions"; +import { DurationInsight } from "../common/insights/DurationInsight"; +import { ExcessiveAPICallsInsight } from "../common/insights/ExcessiveAPICallsInsight"; +import { HighNumberOfQueriesInsight } from "../common/insights/HighNumberOfQueriesInsight"; +import { SlowEndpointInsight } from "../common/insights/SlowEndpointInsight"; +import { SpanNexusInsight } from "../common/insights/SpanNexusInsight"; +import { TrafficInsight } from "../common/insights/TrafficInsight"; import { Description } from "../styles"; import { trackingEvents } from "../tracking"; import { isChattyApiEndpointInsight, - isCodeObjectErrorsInsight, - isCodeObjectHotSpotInsight, isEndpointBreakdownInsight, - isEndpointDurationSlowdownInsight, isEndpointHighNumberOfQueriesInsight, isEndpointHighUsageInsight, isEndpointLowUsageInsight, isEndpointNormalUsageInsight, isEndpointQueryOptimizationInsight, - isEndpointSlowestSpansInsight, - isEndpointSuspectedNPlusOneInsight, isSessionInViewEndpointInsight, isSlowEndpointInsight, isSpanDurationBreakdownInsight, isSpanDurationsInsight, - isSpanEndpointBottleneckInsight, isSpanNPlusOneInsight, isSpanNexusInsight, isSpanQueryOptimizationInsight, isSpanScalingBadlyInsight, - isSpanScalingInsufficientDataInsight, - isSpanScalingWellInsight, isSpanUsagesInsight } from "../typeGuards"; import { CodeObjectInsight, GenericCodeObjectInsight, Trace } from "../types"; import * as s from "./styles"; -import { InsightPageProps, isInsightJiraTicketHintShownPayload } from "./types"; +import { + InsightPageProps, + MarkInsightTypesAsViewedPayload, + isInsightJiraTicketHintShownPayload +} from "./types"; const getInsightToShowJiraHint = (insights: CodeObjectInsight[]): number => { const insightsWithJiraButton = [ @@ -93,23 +81,23 @@ const renderInsightCard = ( isJiraHintEnabled: boolean, onRefresh: () => void ): JSX.Element | undefined => { - const handleErrorSelect = (errorId: string, insightType: InsightType) => { - sendTrackingEvent(globalTrackingEvents.USER_ACTION, { - action: `Follow ${insightType} link` - }); - window.sendMessageToDigma({ - action: actions.GO_TO_ERROR, - payload: { - errorId - } - }); - }; + // const handleErrorSelect = (errorId: string, insightType: InsightType) => { + // sendTrackingEvent(globalTrackingEvents.USER_ACTION, { + // action: `Follow ${insightType} link` + // }); + // window.sendMessageToDigma({ + // action: actions.GO_TO_ERROR, + // payload: { + // errorId + // } + // }); + // }; - const handleErrorsExpandButtonClick = () => { - window.sendMessageToDigma({ - action: actions.GO_TO_ERRORS - }); - }; + // const handleErrorsExpandButtonClick = () => { + // window.sendMessageToDigma({ + // action: actions.GO_TO_ERRORS + // }); + // }; const handleHistogramButtonClick = ( instrumentationLibrary: string, @@ -206,6 +194,7 @@ const renderInsightCard = ( /> ); } + if (isSpanDurationBreakdownInsight(insight)) { return ( ); } + if (isSpanUsagesInsight(insight)) { return ( ); } - if (isSpanEndpointBottleneckInsight(insight)) { - return ( - - ); - } - if (isEndpointSlowestSpansInsight(insight)) { - return ( - - ); - } + + // if (isSpanEndpointBottleneckInsight(insight)) { + // return ( + // + // ); + // } + + // if (isEndpointSlowestSpansInsight(insight)) { + // return ( + // + // ); + // } + if (isSlowEndpointInsight(insight)) { return ( ); } + if ( isEndpointLowUsageInsight(insight) || isEndpointNormalUsageInsight(insight) || @@ -279,32 +273,22 @@ const renderInsightCard = ( /> ); } - if (isCodeObjectErrorsInsight(insight)) { - return ( - - ); - } - if (isEndpointSuspectedNPlusOneInsight(insight)) { - return ( - - ); - } + + // if (isEndpointSuspectedNPlusOneInsight(insight)) { + // return ( + // + // ); + // } + if (isSpanNPlusOneInsight(insight)) { return ( ); } + if (isSpanScalingBadlyInsight(insight)) { return ( ); } - if (isCodeObjectHotSpotInsight(insight)) { - return ( - - Major errors occur or propagate through this function - - } - onRecalculate={handleRecalculate} - onRefresh={onRefresh} - /> - ); - } - if (isEndpointDurationSlowdownInsight(insight)) { - return ( - - ); - } + + // if (isEndpointDurationSlowdownInsight(insight)) { + // return ( + // + // ); + // } if (isEndpointBreakdownInsight(insight)) { return ( @@ -371,30 +343,6 @@ const renderInsightCard = ( ); } - if (isSpanScalingWellInsight(insight)) { - return ( - - ); - } - - if (isSpanScalingInsufficientDataInsight(insight)) { - return ( - - ); - } - if (isSessionInViewEndpointInsight(insight)) { return ( { }, [previousPage, props.page, config, previousConfig]); useEffect(() => { - window.sendMessageToDigma({ + window.sendMessageToDigma({ action: actions.MARK_INSIGHT_TYPES_AS_VIEWED, payload: { insightTypes: props.insights.map((x) => ({ diff --git a/src/components/Insights/InsightsPage/types.ts b/src/components/Insights/InsightsPage/types.ts index 53a9e870c..a56b32b34 100644 --- a/src/components/Insights/InsightsPage/types.ts +++ b/src/components/Insights/InsightsPage/types.ts @@ -1,4 +1,4 @@ -import { GenericCodeObjectInsight } from "../types"; +import { GenericCodeObjectInsight, InsightType } from "../types"; export interface InsightPageProps { insights: GenericCodeObjectInsight[]; @@ -14,3 +14,10 @@ export interface InsightPageProps { export interface isInsightJiraTicketHintShownPayload { value: boolean; } + +export interface MarkInsightTypesAsViewedPayload { + insightTypes: { + type: InsightType; + reopenCount: number; + }[]; +} diff --git a/src/components/Insights/NPlusOneInsight/mockData.ts b/src/components/Insights/NPlusOneInsight/mockData.ts index 338c6c527..7a51ce12e 100644 --- a/src/components/Insights/NPlusOneInsight/mockData.ts +++ b/src/components/Insights/NPlusOneInsight/mockData.ts @@ -2,6 +2,7 @@ import { InsightType } from "../../../types"; import { InsightCategory, InsightScope, SpanNPlusOneInsight } from "../types"; export const mockedNPlusOneInsight: SpanNPlusOneInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-8cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -54,7 +55,15 @@ export const mockedNPlusOneInsight: SpanNPlusOneInsight = { occurrences: 100, criticality: 0.8, impact: 0, - severity: 0 + severity: 0, + requestPercentage: 50, + traceId: "00D37A4E7208E0F6E89AA7E2E37446A6", + commitId: "a1b2c3d", + duration: { + value: 1.64, + unit: "sec", + raw: 1636050588.0 + } } ], scope: InsightScope.Span, diff --git a/src/components/Insights/NoScalingIssueInsight/NoScalingIssueInsight.stories.tsx b/src/components/Insights/NoScalingIssueInsight/NoScalingIssueInsight.stories.tsx index 84a187e36..088953766 100644 --- a/src/components/Insights/NoScalingIssueInsight/NoScalingIssueInsight.stories.tsx +++ b/src/components/Insights/NoScalingIssueInsight/NoScalingIssueInsight.stories.tsx @@ -20,6 +20,7 @@ type Story = StoryObj; export const Default: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c7d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/PerformanceAtScaleInsight/PerformanceAtScaleInsight.stories.tsx b/src/components/Insights/PerformanceAtScaleInsight/PerformanceAtScaleInsight.stories.tsx index 5cf80a451..5326df24c 100644 --- a/src/components/Insights/PerformanceAtScaleInsight/PerformanceAtScaleInsight.stories.tsx +++ b/src/components/Insights/PerformanceAtScaleInsight/PerformanceAtScaleInsight.stories.tsx @@ -20,6 +20,7 @@ type Story = StoryObj; export const Default: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55492-8262-4c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/QueryOptimizationInsight/mockData.ts b/src/components/Insights/QueryOptimizationInsight/mockData.ts index da81088e0..841d06801 100644 --- a/src/components/Insights/QueryOptimizationInsight/mockData.ts +++ b/src/components/Insights/QueryOptimizationInsight/mockData.ts @@ -6,6 +6,7 @@ import { } from "../types"; export const mockedQueryOptimizationInsight: QueryOptimizationInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c8d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/RequestBreakdownInsight/RequestBreakdownInsight.stories.tsx b/src/components/Insights/RequestBreakdownInsight/RequestBreakdownInsight.stories.tsx index 7e6fdb610..4ca60c889 100644 --- a/src/components/Insights/RequestBreakdownInsight/RequestBreakdownInsight.stories.tsx +++ b/src/components/Insights/RequestBreakdownInsight/RequestBreakdownInsight.stories.tsx @@ -23,6 +23,7 @@ export default meta; type Story = StoryObj; const data: EndpointBreakdownInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979dd6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/ScalingIssueInsight/mockData.ts b/src/components/Insights/ScalingIssueInsight/mockData.ts index 2915783e1..ca1c101dd 100644 --- a/src/components/Insights/ScalingIssueInsight/mockData.ts +++ b/src/components/Insights/ScalingIssueInsight/mockData.ts @@ -1,11 +1,12 @@ import { InsightType } from "../../../types"; import { - SpanScalingBadlyInsight, InsightCategory, - InsightScope + InsightScope, + SpanScalingBadlyInsight } from "../types"; export const mockedSpanScalingInsight: SpanScalingBadlyInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "90b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/SessionInViewInsight/SessionInViewInsight.stories.tsx b/src/components/Insights/SessionInViewInsight/SessionInViewInsight.stories.tsx index 0b86f65a8..22ecf1ce5 100644 --- a/src/components/Insights/SessionInViewInsight/SessionInViewInsight.stories.tsx +++ b/src/components/Insights/SessionInViewInsight/SessionInViewInsight.stories.tsx @@ -20,6 +20,7 @@ type Story = StoryObj; export const Default: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5a-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/SlowEndpointInsight/SlowEndpointInsight.stories.tsx b/src/components/Insights/SlowEndpointInsight/SlowEndpointInsight.stories.tsx index 217bef041..9999a6d01 100644 --- a/src/components/Insights/SlowEndpointInsight/SlowEndpointInsight.stories.tsx +++ b/src/components/Insights/SlowEndpointInsight/SlowEndpointInsight.stories.tsx @@ -20,6 +20,7 @@ type Story = StoryObj; export const Default: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c3d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/SpanBottleneckInsight/mockData.ts b/src/components/Insights/SpanBottleneckInsight/mockData.ts index 7bbecdffa..cbff1e07d 100644 --- a/src/components/Insights/SpanBottleneckInsight/mockData.ts +++ b/src/components/Insights/SpanBottleneckInsight/mockData.ts @@ -6,6 +6,7 @@ import { } from "../types"; export const mockedSpanBottleneckInsight: EndpointSlowestSpansInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7dce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/SpanNexusInsight/mockData.ts b/src/components/Insights/SpanNexusInsight/mockData.ts index 0dc1395b6..f07736609 100644 --- a/src/components/Insights/SpanNexusInsight/mockData.ts +++ b/src/components/Insights/SpanNexusInsight/mockData.ts @@ -2,6 +2,7 @@ import { InsightType } from "../../../types"; import { InsightCategory, InsightScope, SpanNexusInsight } from "../types"; export const mockedSpanNexusInsight: SpanNexusInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b54792-8262-4c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/TopUsageInsight/TopUsageInsight.stories.tsx b/src/components/Insights/TopUsageInsight/TopUsageInsight.stories.tsx index 27571f955..f23daf0fa 100644 --- a/src/components/Insights/TopUsageInsight/TopUsageInsight.stories.tsx +++ b/src/components/Insights/TopUsageInsight/TopUsageInsight.stories.tsx @@ -20,6 +20,7 @@ type Story = StoryObj; export const Default: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8162-4c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/TrafficInsight/TrafficInsight.stories.tsx b/src/components/Insights/TrafficInsight/TrafficInsight.stories.tsx index babc350ce..299d0bbcd 100644 --- a/src/components/Insights/TrafficInsight/TrafficInsight.stories.tsx +++ b/src/components/Insights/TrafficInsight/TrafficInsight.stories.tsx @@ -20,6 +20,7 @@ type Story = StoryObj; export const LowTraffic: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-3c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -82,6 +83,7 @@ export const LowTraffic: Story = { export const HighTraffic: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-3c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/common/insights/DurationInsight/DurationInsight.stories.tsx b/src/components/Insights/common/insights/DurationInsight/DurationInsight.stories.tsx index 43b7295cc..a13c58041 100644 --- a/src/components/Insights/common/insights/DurationInsight/DurationInsight.stories.tsx +++ b/src/components/Insights/common/insights/DurationInsight/DurationInsight.stories.tsx @@ -19,6 +19,7 @@ type Story = StoryObj; export const WithAverage: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -135,6 +136,7 @@ export const WithAverage: Story = { export const WithChange: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: null, lastDetected: null, @@ -241,6 +243,7 @@ export const WithChange: Story = { export const WithEvaluatingChange: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: null, lastDetected: null, @@ -347,6 +350,7 @@ export const WithEvaluatingChange: Story = { export const HistogramWithManyBars: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: null, lastDetected: null, @@ -4871,6 +4875,7 @@ export const HistogramWithManyBars: Story = { export const HistogramWithGaps: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: null, lastDetected: null, @@ -5125,6 +5130,7 @@ export const HistogramWithGaps: Story = { export const HistogramWithAFewBars: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", firstDetected: null, lastDetected: null, @@ -5279,6 +5285,7 @@ export const HistogramWithAFewBars: Story = { export const EmptyStateBug: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9628-7cce7979ad6d", name: "Performance Stats", type: InsightType.SpanDurations, diff --git a/src/components/Insights/common/insights/ExcessiveAPICallsInsight/ExcessiveAPICallsInsight.stories.tsx b/src/components/Insights/common/insights/ExcessiveAPICallsInsight/ExcessiveAPICallsInsight.stories.tsx index ac10eff92..20faae2ba 100644 --- a/src/components/Insights/common/insights/ExcessiveAPICallsInsight/ExcessiveAPICallsInsight.stories.tsx +++ b/src/components/Insights/common/insights/ExcessiveAPICallsInsight/ExcessiveAPICallsInsight.stories.tsx @@ -19,6 +19,7 @@ type Story = StoryObj; export const Default: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9688-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -138,6 +139,7 @@ export const Default: Story = { export const EmptyTrace: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9688-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/common/insights/HighNumberOfQueriesInsight/index.tsx b/src/components/Insights/common/insights/HighNumberOfQueriesInsight/index.tsx index 3d4f8498d..49d6e1806 100644 --- a/src/components/Insights/common/insights/HighNumberOfQueriesInsight/index.tsx +++ b/src/components/Insights/common/insights/HighNumberOfQueriesInsight/index.tsx @@ -1,4 +1,3 @@ -import { getDurationString } from "../../../../../utils/getDurationString"; import { sendTrackingEvent } from "../../../../../utils/sendTrackingEvent"; import { InfoCircleIcon } from "../../../../common/icons/InfoCircleIcon"; import { Tag } from "../../../../common/v3/Tag"; @@ -64,9 +63,6 @@ export const HighNumberOfQueriesInsight = ( > - - {getDurationString(props.insight.medianDuration)} - } diff --git a/src/components/Insights/common/insights/HighNumberOfQueriesInsight/mockData.ts b/src/components/Insights/common/insights/HighNumberOfQueriesInsight/mockData.ts index beda9abbd..967c1775c 100644 --- a/src/components/Insights/common/insights/HighNumberOfQueriesInsight/mockData.ts +++ b/src/components/Insights/common/insights/HighNumberOfQueriesInsight/mockData.ts @@ -7,6 +7,7 @@ import { export const mockedHighNumberOfQueriesInsight: EndpointHighNumberOfQueriesInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c5d-9623-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", @@ -24,12 +25,6 @@ export const mockedHighNumberOfQueriesInsight: EndpointHighNumberOfQueriesInsigh importance: 3, queriesCount: 250, typicalCount: 4, - medianDuration: { - value: 150, - unit: "ms", - raw: 150000000.0 - }, - requestFraction: 0.3, traceId: "00D37A4E7208E0F6E89AA7E2E37446A6", scope: InsightScope.EntrySpan, endpointSpan: "HTTP POST /owners/{ownerId}/pets/new", diff --git a/src/components/Insights/common/insights/SlowEndpointInsight/SlowEndpointInsight.stories.tsx b/src/components/Insights/common/insights/SlowEndpointInsight/SlowEndpointInsight.stories.tsx index 93478a7f2..c964e901a 100644 --- a/src/components/Insights/common/insights/SlowEndpointInsight/SlowEndpointInsight.stories.tsx +++ b/src/components/Insights/common/insights/SlowEndpointInsight/SlowEndpointInsight.stories.tsx @@ -18,6 +18,7 @@ type Story = StoryObj; export const Default: Story = { args: { insight: { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-4c3d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/common/insights/SpanNexusInsight/mockData.ts b/src/components/Insights/common/insights/SpanNexusInsight/mockData.ts index c872748d7..c21c7c05e 100644 --- a/src/components/Insights/common/insights/SpanNexusInsight/mockData.ts +++ b/src/components/Insights/common/insights/SpanNexusInsight/mockData.ts @@ -6,6 +6,7 @@ import { } from "../../../types"; export const mockedSpanNexusInsight: SpanNexusInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b54792-8262-4c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/common/insights/TrafficInsight/TrafficInsight.stories.tsx b/src/components/Insights/common/insights/TrafficInsight/TrafficInsight.stories.tsx index ff340ec39..688ade3b2 100644 --- a/src/components/Insights/common/insights/TrafficInsight/TrafficInsight.stories.tsx +++ b/src/components/Insights/common/insights/TrafficInsight/TrafficInsight.stories.tsx @@ -23,6 +23,7 @@ export default meta; type Story = StoryObj; const BaseTrafficInsight = { + sourceSpanCodeObjectInsight: "sourceSpanCodeObjectInsightId", id: "60b55792-8262-3c5d-9628-7cce7979ad6d", firstDetected: "2023-12-05T17:25:47.010Z", lastDetected: "2024-01-05T13:14:47.010Z", diff --git a/src/components/Insights/types.ts b/src/components/Insights/types.ts index 0fd58e8dd..43d0079ca 100644 --- a/src/components/Insights/types.ts +++ b/src/components/Insights/types.ts @@ -29,10 +29,12 @@ export type GenericCodeObjectInsight = | EndpointNormalUsageInsight | EndpointHighUsageInsight | EndpointSlowestSpansInsight + | EndpointBottleneckInsight | SlowEndpointInsight | SpanScalingBadlyInsight | SpanNPlusOneInsight | EndpointSuspectedNPlusOneInsight + | EndpointSpanNPlusOneInsight | CodeObjectHotSpotInsight | CodeObjectErrorsInsight | EndpointDurationSlowdownInsight @@ -177,6 +179,7 @@ export interface CodeObjectInsight extends Insight { reopenCount: number; ticketLink: string | null; id: string; + sourceSpanCodeObjectInsight: string; } export interface SpanInsight extends CodeObjectInsight { @@ -282,6 +285,10 @@ export interface SpanEndpointBottleneckInsight extends SpanInsight { }; probabilityOfBeingBottleneck: number; avgDurationWhenBeingBottleneck: Duration; + impact: number; + severity: number; + criticality: number; + requestPercentage: number; /** * @deprecated @@ -392,7 +399,9 @@ export interface EndpointHighUsageInsight extends EndpointInsight { maxCallsIn1Min: number; } -// obsolete +/** + * @deprecated + */ export interface EndpointSlowestSpansInsight extends EndpointInsight { name: "Bottleneck Detected"; type: InsightType.SlowestSpans; @@ -429,7 +438,7 @@ export interface EndpointBottleneckInsight extends EndpointInsight { specifity: InsightSpecificity.TargetFound; importance: InsightImportance.Critical; isRecalculateEnabled: true; - spans: { + span: { spanInfo: SpanInfo; probabilityOfBeingBottleneck: number; avgDurationWhenBeingBottleneck: Duration; @@ -552,6 +561,10 @@ export interface SpanNPlusOneInsight extends SpanInsight { criticality: number; impact: number; severity: number; + traceId: string; + duration: Duration; + commitId: string; + requestPercentage: number; }[]; /** @@ -560,6 +573,9 @@ export interface SpanNPlusOneInsight extends SpanInsight { span: SpanInfo; } +/** + * @deprecated + */ export interface EndpointSuspectedNPlusOneInsight extends EndpointInsight { name: "Suspected N+1 Query"; type: InsightType.EndpointSpanNPlusOne; @@ -588,7 +604,7 @@ export interface EndpointSpanNPlusOneInsight extends EndpointInsight { specifity: InsightSpecificity.TargetAndReasonFound; importance: InsightImportance.HighlyImportant; isRecalculateEnabled: true; - spans: { + span: { occurrences: number; internalSpan: SpanInfo | null; clientSpan: SpanInfo; @@ -631,8 +647,7 @@ export interface CodeObjectErrorsInsight extends CodeObjectInsight { }[]; } -// obsolete -export interface DurationSlowdownSource { +export interface EndpointSlowdownSource { percentile: string; spanInfo: SpanInfo; level: number; @@ -642,17 +657,14 @@ export interface DurationSlowdownSource { changeVerified: boolean; } -export interface EndpointSlowdownSources { - percentile: string; - spanInfo: SpanInfo; - level: number; - previousDuration: Duration; - currentDuration: Duration; - changeTime: string; - changeVerified: boolean; -} +/** + * @deprecated + */ +export type DurationSlowdownSource = EndpointSlowdownSource; -// obsolete +/** + * @deprecated + */ export interface EndpointDurationSlowdownInsight extends EndpointInsight { name: "Endpoint Duration Slowdown Source"; type: InsightType.EndpointDurationSlowdown; @@ -669,7 +681,7 @@ export interface EndpointSlowdownSourceInsight extends EndpointInsight { category: InsightCategory.Performance; specifity: InsightSpecificity.OwnInsight; importance: InsightImportance.Critical; - endpointSlowdownSources: EndpointSlowdownSources[]; + endpointSlowdownSources: EndpointSlowdownSource[] | null; decorators: CodeObjectDecorator[]; } @@ -701,6 +713,9 @@ export interface EndpointBreakdownInsight extends EndpointInsight { export type SpanUsageStatusInsight = SpanInsight; +/** + * @deprecated + */ export interface SpanScalingWellInsight extends SpanInsight { name: "Scaling Well"; type: InsightType.SpanScalingWell; @@ -713,11 +728,17 @@ export interface SpanScalingWellInsight extends SpanInsight { flowHash: string | null; } +/** + * @deprecated + */ export interface Concurrency { calls: number; meanDuration: Duration; } +/** + * @deprecated + */ export interface SpanScalingInsufficientDataInsight extends SpanInsight { name: "Scaling Insufficient Data"; type: InsightType.SpanScalingInsufficientData; @@ -757,9 +778,7 @@ export interface EndpointHighNumberOfQueriesInsight extends EndpointInsight { type: InsightType.EndpointHighNumberOfQueries; queriesCount: number; typicalCount: number; - medianDuration: Duration; traceId: string | null; - requestFraction: number; quantile?: number; } diff --git a/src/utils/getInsightTypeInfo.ts b/src/utils/getInsightTypeInfo.ts index 6e9c4baf7..4617d760b 100644 --- a/src/utils/getInsightTypeInfo.ts +++ b/src/utils/getInsightTypeInfo.ts @@ -58,16 +58,28 @@ export const getInsightTypeInfo = ( icon: MeterHighIcon, label: "Endpoint High Traffic" }, + // deprecated [InsightType.SlowestSpans]: { icon: BottleneckIcon, label: "Bottleneck", description: descriptionProvider.BottleneckDescription }, + [InsightType.EndpointBottleneck]: { + icon: BottleneckIcon, + label: "Bottleneck", + description: descriptionProvider.BottleneckDescription + }, + // deprecated [InsightType.EndpointSpanNPlusOne]: { icon: SQLDatabaseIcon, label: "Suspected N-Plus-1", description: descriptionProvider.NPlusOneDescription }, + [InsightType.EndpointSpanNPlusOneV2]: { + icon: SQLDatabaseIcon, + label: "Suspected N-Plus-1", + description: descriptionProvider.NPlusOneDescription + }, [InsightType.SpanNPlusOne]: { icon: SQLDatabaseIcon, label: "Suspected N-Plus-1", @@ -95,18 +107,25 @@ export const getInsightTypeInfo = ( icon: ClockWithTicksIcon, label: "Duration Breakdown" }, + // deprecated [InsightType.EndpointDurationSlowdown]: { icon: SnailIcon, label: "Duration Slowdown Source Detected" }, + [InsightType.EndpointSlowdownSource]: { + icon: SnailIcon, + label: "Duration Slowdown Source Detected" + }, [InsightType.EndpointBreakdown]: { icon: PieChartIcon, label: "Request Breakdown" }, + // deprecated [InsightType.SpanScalingWell]: { icon: ScalesIcon, label: "No Scaling Issue Detected" }, + // deprecated [InsightType.SpanScalingInsufficientData]: { icon: ScalesIcon, label: "Performance at Scale" diff --git a/src/utils/getInsightTypeOrderPriority.ts b/src/utils/getInsightTypeOrderPriority.ts index 68fd09209..4e2e7cde7 100644 --- a/src/utils/getInsightTypeOrderPriority.ts +++ b/src/utils/getInsightTypeOrderPriority.ts @@ -10,11 +10,11 @@ export const getInsightTypeOrderPriority = (type: string): number => { [InsightType.EndpointBreakdown]: 5, [InsightType.HighUsage]: 10, [InsightType.SlowEndpoint]: 20, - [InsightType.EndpointDurationSlowdown]: 25, + [InsightType.EndpointSlowdownSource]: 25, [InsightType.LowUsage]: 30, - [InsightType.SlowestSpans]: 40, + [InsightType.EndpointBottleneck]: 40, [InsightType.NormalUsage]: 50, - [InsightType.EndpointSpanNPlusOne]: 55, + [InsightType.EndpointSpanNPlusOneV2]: 55, [InsightType.EndpointSessionInView]: 56, [InsightType.EndpointChattyApi]: 57, [InsightType.EndpointHighNumberOfQueries]: 58, @@ -23,9 +23,7 @@ export const getInsightTypeOrderPriority = (type: string): number => { // Span insights [InsightType.SpanDurations]: 60, [InsightType.SpanUsages]: 61, - [InsightType.SpanScalingInsufficientData]: 62, [InsightType.SpanScalingBadly]: 63, - [InsightType.SpanScalingWell]: 64, [InsightType.SpanNPlusOne]: 65, [InsightType.SpanEndpointBottleneck]: 67, [InsightType.SpanDurationBreakdown]: 68,