diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/index.tsx index a6c1b1d1d..2d957deba 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/index.tsx @@ -60,6 +60,7 @@ import { SpanNexusInsightCard } from "./insightCards/SpanNexusInsightCard"; import { SpanQueryOptimizationInsightCard } from "./insightCards/SpanQueryOptimizationInsightCard"; import { SpanScalingInsightCard } from "./insightCards/SpanScalingInsightCard"; import { SpanUsagesInsightCard } from "./insightCards/SpanUsagesInsightCard"; +import { InsightCardViewMode } from "./insightCards/common/InsightCard/types"; import * as s from "./styles"; import { InsightsPageProps, @@ -98,7 +99,8 @@ const renderInsightCard = ( ) => void, isJiraHintEnabled: boolean, onRefresh: () => void, - isMarkAsReadButtonEnabled: boolean + isMarkAsReadButtonEnabled: boolean, + viewMode: InsightCardViewMode ): JSX.Element | undefined => { const handleHistogramButtonClick = ( spanCodeObjectId: string, @@ -187,6 +189,7 @@ const renderInsightCard = ( onRefresh={onRefresh} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -201,6 +204,7 @@ const renderInsightCard = ( onRefresh={onRefresh} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -216,6 +220,7 @@ const renderInsightCard = ( onRefresh={onRefresh} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -233,6 +238,7 @@ const renderInsightCard = ( onGoToSpan={handleGoToSpan} onTraceButtonClick={handleTraceButtonClick} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -250,6 +256,7 @@ const renderInsightCard = ( onGoToSpan={handleGoToSpan} onTraceButtonClick={handleTraceButtonClick} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -263,6 +270,7 @@ const renderInsightCard = ( onRefresh={onRefresh} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -280,6 +288,7 @@ const renderInsightCard = ( onRefresh={onRefresh} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -297,6 +306,7 @@ const renderInsightCard = ( isJiraHintEnabled={isJiraHintEnabled} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -314,6 +324,7 @@ const renderInsightCard = ( isJiraHintEnabled={isJiraHintEnabled} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -332,6 +343,7 @@ const renderInsightCard = ( isJiraHintEnabled={isJiraHintEnabled} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -346,6 +358,7 @@ const renderInsightCard = ( onRefresh={onRefresh} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -359,6 +372,7 @@ const renderInsightCard = ( onRefresh={onRefresh} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -374,6 +388,7 @@ const renderInsightCard = ( onRefresh={onRefresh} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -389,6 +404,7 @@ const renderInsightCard = ( onRefresh={onRefresh} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -405,6 +421,7 @@ const renderInsightCard = ( isJiraHintEnabled={isJiraHintEnabled} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -418,6 +435,7 @@ const renderInsightCard = ( onRefresh={onRefresh} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -435,6 +453,7 @@ const renderInsightCard = ( isJiraHintEnabled={isJiraHintEnabled} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -452,6 +471,7 @@ const renderInsightCard = ( isJiraHintEnabled={isJiraHintEnabled} onGoToSpan={handleGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); } @@ -477,6 +497,7 @@ export const InsightsPage = ({ ); const listRef = useRef(null); const { goTo } = useHistory(); + const isAtSpan = Boolean(scope?.span); const insightIndexWithJiraHint = getInsightToShowJiraHint(insights); @@ -538,7 +559,8 @@ export const InsightsPage = ({ !isInsightJiraTicketHintShown?.value && j === insightIndexWithJiraHint, onRefresh, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + isAtSpan ? "full" : "compact" ); }) ) : isFilteringEnabled ? ( diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBottleneckInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBottleneckInsightCard/index.tsx index c4a2a044e..3ba516663 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBottleneckInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBottleneckInsightCard/index.tsx @@ -1,4 +1,5 @@ import { getDurationString } from "../../../../../../utils/getDurationString"; +import { Tooltip } from "../../../../../common/v3/Tooltip"; import { InsightCard } from "../common/InsightCard"; import { ColumnsContainer } from "../common/InsightCard/ColumnsContainer"; import { KeyValue } from "../common/InsightCard/KeyValue"; @@ -14,7 +15,8 @@ export const EndpointBottleneckInsightCard = ({ onRecalculate, onGoToSpan, onRefresh, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: EndpointBottleneckInsightCardProps) => { const { span, ticketLink } = insight; @@ -41,6 +43,7 @@ export const EndpointBottleneckInsightCard = ({ const spanName = span.spanInfo.displayName; const spanCodeObjectId = span.spanInfo.spanCodeObjectId; + const durationString = getDurationString(span.avgDurationWhenBeingBottleneck); return ( {span.requestPercentage}% - - {getDurationString(span.avgDurationWhenBeingBottleneck)} - + {durationString} } @@ -87,6 +88,12 @@ export const EndpointBottleneckInsightCard = ({ onGoToSpan={onGoToSpan} onGoToTrace={span.traceId ? handleTraceButtonClick : undefined} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} + mainMetric={ + + {durationString} + + } /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBreakdownInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBreakdownInsightCard/index.tsx index 51a42a10d..60f6fd5cc 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBreakdownInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointBreakdownInsightCard/index.tsx @@ -98,7 +98,8 @@ export const EndpointBreakdownInsightCard = ({ onRecalculate, onRefresh, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: EndpointBreakdownInsightCardProps) => { const theme = useTheme(); @@ -263,6 +264,7 @@ export const EndpointBreakdownInsightCard = ({ isAsync={insight.hasAsyncSpans} onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointChattyApiV2InsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointChattyApiV2InsightCard/index.tsx index 89aff4689..f6f2c80b9 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointChattyApiV2InsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointChattyApiV2InsightCard/index.tsx @@ -11,7 +11,8 @@ export const EndpointChattyApiV2InsightCard = ({ onRecalculate, onRefresh, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: EndpointChattyApiV2InsightCardProps) => { const handleSpanLinkClick = (spanCodeObjectId: string) => { onAssetLinkClick(spanCodeObjectId, insight.type); @@ -60,6 +61,7 @@ export const EndpointChattyApiV2InsightCard = ({ : undefined } isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointHighNumberOfQueriesInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointHighNumberOfQueriesInsightCard/index.tsx index 0e9930af1..251ef9e3e 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointHighNumberOfQueriesInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointHighNumberOfQueriesInsightCard/index.tsx @@ -14,7 +14,8 @@ export const EndpointHighNumberOfQueriesInsightCard = ({ onRefresh, isJiraHintEnabled, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: EndpointHighNumberOfQueriesInsightCardProps) => { const traceId = insight.traceId; @@ -83,6 +84,7 @@ export const EndpointHighNumberOfQueriesInsightCard = ({ } onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointQueryOptimizationV2InsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointQueryOptimizationV2InsightCard/index.tsx index 7dcd7d631..3ddd60add 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointQueryOptimizationV2InsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointQueryOptimizationV2InsightCard/index.tsx @@ -1,4 +1,5 @@ import { getDurationString } from "../../../../../../utils/getDurationString"; +import { Tooltip } from "../../../../../common/v3/Tooltip"; import { InsightType, Trace } from "../../../../types"; import { InsightCard } from "../common/InsightCard"; import { ColumnsContainer } from "../common/InsightCard/ColumnsContainer"; @@ -15,7 +16,8 @@ export const EndpointQueryOptimizationV2InsightCard = ({ onRecalculate, onRefresh, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: EndpointQueryOptimizationV2InsightCardProps) => { const handleSpanLinkClick = (spanCodeObjectId: string) => { onAssetLinkClick(spanCodeObjectId, insight.type); @@ -38,6 +40,7 @@ export const EndpointQueryOptimizationV2InsightCard = ({ const spanName = insight.span.spanInfo.displayName; const spanCodeObjectId = insight.span.spanInfo.spanCodeObjectId; + const durationString = getDurationString(insight.span.duration); return ( + {durationString} + + } /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSessionInViewInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSessionInViewInsightCard/index.tsx index 17187bb2f..fcaf63144 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSessionInViewInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSessionInViewInsightCard/index.tsx @@ -20,7 +20,8 @@ export const EndpointSessionInViewInsightCard = ({ onRecalculate, onRefresh, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: EndpointSessionInViewInsightCardProps) => { const isJaegerEnabled = useGlobalStore.use.isJaegerEnabled(); @@ -99,6 +100,7 @@ export const EndpointSessionInViewInsightCard = ({ onRefresh={onRefresh} onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSlowdownSourceInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSlowdownSourceInsightCard/index.tsx index d980ab7cf..7747b384a 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSlowdownSourceInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSlowdownSourceInsightCard/index.tsx @@ -12,7 +12,8 @@ export const EndpointSlowdownSourceInsightCard = ({ onRecalculate, onRefresh, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: EndpointSlowdownSourceInsightCardProps) => { const handleSpanLinkClick = (spanCodeObjectId: string) => { onAssetLinkClick(spanCodeObjectId, insight.type); @@ -77,6 +78,7 @@ export const EndpointSlowdownSourceInsightCard = ({ onRefresh={onRefresh} onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSpanNPlusOneInsightInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSpanNPlusOneInsightInsightCard/index.tsx index c715c18d1..c9bd07c4b 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSpanNPlusOneInsightInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointSpanNPlusOneInsightInsightCard/index.tsx @@ -1,4 +1,5 @@ import { getDurationString } from "../../../../../../utils/getDurationString"; +import { Tooltip } from "../../../../../common/v3/Tooltip"; import { InsightType, Trace } from "../../../../types"; import { InsightCard } from "../common/InsightCard"; import { ColumnsContainer } from "../common/InsightCard/ColumnsContainer"; @@ -15,7 +16,8 @@ export const EndpointSpanNPlusOneInsightCard = ({ onRecalculate, onGoToSpan, onRefresh, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: EndpointSpanNPlusOneInsightCardProps) => { const { span } = insight; @@ -40,6 +42,7 @@ export const EndpointSpanNPlusOneInsightCard = ({ const spanInfo = span.internalSpan ?? span.clientSpan; const spanName = spanInfo.displayName; + const durationString = getDurationString(span.duration); return ( {span.requestPercentage}% - - {getDurationString(span.duration)} - + {durationString} } @@ -86,6 +87,12 @@ export const EndpointSpanNPlusOneInsightCard = ({ onRefresh={onRefresh} onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} + mainMetric={ + + {durationString} + + } /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointUsageInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointUsageInsightCard/index.tsx index a5cdab715..954eace43 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointUsageInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/EndpointUsageInsightCard/index.tsx @@ -47,7 +47,8 @@ export const EndpointUsageInsightCard = ({ onRecalculate, onRefresh, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: EndpointUsageInsightCardProps) => { const valueString = `${getValueString(insight.maxCallsIn1Min)}/min`; @@ -70,6 +71,7 @@ export const EndpointUsageInsightCard = ({ onRefresh={onRefresh} onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SlowEndpointInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SlowEndpointInsightCard/index.tsx index abd060382..1513c7ddd 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SlowEndpointInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SlowEndpointInsightCard/index.tsx @@ -1,6 +1,7 @@ import { getDurationString } from "../../../../../../utils/getDurationString"; import { roundTo } from "../../../../../../utils/roundTo"; import { Tag } from "../../../../../common/v3/Tag"; +import { Tooltip } from "../../../../../common/v3/Tooltip"; import { InsightCard } from "../common/InsightCard"; import { ColumnsContainer } from "../common/InsightCard/ColumnsContainer"; import { KeyValue } from "../common/InsightCard/KeyValue"; @@ -12,7 +13,8 @@ export const SlowEndpointInsightCard = ({ onRecalculate, onRefresh, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: SlowEndpointInsightCardProps) => { const diff = (insight.median.raw / insight.endpointsMedianOfMedians.raw - 1) * 100; @@ -39,6 +41,12 @@ export const SlowEndpointInsightCard = ({ onRefresh={onRefresh} onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} + mainMetric={ + + {durationString} + + } /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpaNPlusOneInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpaNPlusOneInsightCard/index.tsx index 7c5e51ad1..21f9e1840 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpaNPlusOneInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpaNPlusOneInsightCard/index.tsx @@ -45,9 +45,15 @@ export const SpaNPlusOneInsightCard = ({ onRefresh, isJiraHintEnabled, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: SpaNPlusOneInsightCardProps) => { const endpoints = insight.endpoints ?? []; + const endpointWithMaxDuration = endpoints.reduce( + (acc, cur) => (acc.duration.raw >= cur.duration.raw ? acc : cur), + endpoints[0] + ); + const maxDurationString = getDurationString(endpointWithMaxDuration.duration); const isJaegerEnabled = useGlobalStore.use.isJaegerEnabled(); const [selectedEndpoint, setSelectedEndpoint] = useState( endpoints.length ? endpoints[0] : null @@ -140,6 +146,12 @@ export const SpaNPlusOneInsightCard = ({ }} onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} + mainMetric={ + + {maxDurationString} + + } /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanDurationBreakdownInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanDurationBreakdownInsightCard/index.tsx index 3d97c977d..10b52fc0b 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanDurationBreakdownInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanDurationBreakdownInsightCard/index.tsx @@ -61,7 +61,8 @@ export const SpanDurationBreakdownInsightCard = ({ onRecalculate, onRefresh, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: SpanDurationBreakdownInsightCardProps) => { const [percentileViewMode, setPercentileViewMode] = useState(DEFAULT_PERCENTILE); @@ -303,6 +304,7 @@ export const SpanDurationBreakdownInsightCard = ({ onRefresh={onRefresh} onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanDurationsInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanDurationsInsightCard/index.tsx index b12fc0b8e..3bbd76cc6 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanDurationsInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanDurationsInsightCard/index.tsx @@ -137,7 +137,8 @@ export const SpanDurationsInsightCard = ({ onRefresh, onHistogramButtonClick, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: SpanDurationsInsightCardProps) => { const theme = useTheme(); const { observe, width } = useDimensions(); @@ -441,6 +442,7 @@ ${getDurationString(insight.average)}${ onOpenHistogram={insight.spanInfo ? onHistogramButtonClick : undefined} onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanEndpointBottleneckInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanEndpointBottleneckInsightCard/index.tsx index 93d32f3a7..af559bb17 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanEndpointBottleneckInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanEndpointBottleneckInsightCard/index.tsx @@ -46,10 +46,22 @@ export const SpanEndpointBottleneckInsightCard = ({ onRecalculate, onRefresh, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: SpanEndpointBottleneckInsightCardProps) => { const isJaegerEnabled = useGlobalStore.use.isJaegerEnabled(); const slowEndpoints = insight.slowEndpoints ?? []; + const endpointWithMaxDuration = slowEndpoints.reduce( + (acc, cur) => + acc.avgDurationWhenBeingBottleneck.raw >= + cur.avgDurationWhenBeingBottleneck.raw + ? acc + : cur, + slowEndpoints[0] + ); + const maxDurationString = getDurationString( + endpointWithMaxDuration.avgDurationWhenBeingBottleneck + ); const [selectedEndpoint, setSelectedEndpoint] = useState( slowEndpoints.length > 0 ? slowEndpoints[0] : null ); @@ -154,6 +166,12 @@ export const SpanEndpointBottleneckInsightCard = ({ onRefresh={onRefresh} onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} + mainMetric={ + + {maxDurationString} + + } /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanNexusInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanNexusInsightCard/index.tsx index 11d31e0e3..9401a64a5 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanNexusInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanNexusInsightCard/index.tsx @@ -15,7 +15,8 @@ export const SpanNexusInsightCard = ({ onRecalculate, onRefresh, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: SpanNexusInsightCardProps) => { const { entries, @@ -68,6 +69,7 @@ export const SpanNexusInsightCard = ({ onRefresh={onRefresh} onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanQueryOptimizationInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanQueryOptimizationInsightCard/index.tsx index e014dffc1..d3f0e74c4 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanQueryOptimizationInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanQueryOptimizationInsightCard/index.tsx @@ -2,6 +2,7 @@ import { usePagination } from "../../../../../../hooks/usePagination"; import { getDurationString } from "../../../../../../utils/getDurationString"; import { trimEndpointScheme } from "../../../../../../utils/trimEndpointScheme"; import { Pagination } from "../../../../../common/v3/Pagination"; +import { Tooltip } from "../../../../../common/v3/Tooltip"; import { InsightType, Trace } from "../../../../types"; import { InsightCard } from "../common/InsightCard"; import { ColumnsContainer } from "../common/InsightCard/ColumnsContainer"; @@ -22,7 +23,8 @@ export const SpanQueryOptimizationInsightCard = ({ onGoToSpan, isMarkAsReadButtonEnabled, isJiraHintEnabled, - onJiraTicketCreate + onJiraTicketCreate, + viewMode }: SpanQueryOptimizationInsightCardProps) => { const endpoints = insight.endpoints ?? []; const [pageItems, page, setPage] = usePagination( @@ -53,6 +55,7 @@ export const SpanQueryOptimizationInsightCard = ({ const spanName = insight.spanInfo?.displayName ?? undefined; const spanCodeObjectId = insight.spanInfo?.spanCodeObjectId ?? undefined; const traceId = insight.traceId; + const durationString = getDurationString(insight.duration); return ( - - {getDurationString(insight.duration)} - + {durationString} {getDurationString(insight.typicalDuration)} @@ -117,6 +118,12 @@ export const SpanQueryOptimizationInsightCard = ({ } onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} + mainMetric={ + + {durationString} + + } /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanScalingInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanScalingInsightCard/index.tsx index 8b706d6ad..9a655ce06 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanScalingInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanScalingInsightCard/index.tsx @@ -6,6 +6,7 @@ import { TraceIcon } from "../../../../../common/icons/12px/TraceIcon"; import { Button } from "../../../../../common/v3/Button"; import { JiraButton } from "../../../../../common/v3/JiraButton"; import { Pagination } from "../../../../../common/v3/Pagination"; +import { Tooltip } from "../../../../../common/v3/Tooltip"; import { InsightType, RootCauseSpanInfo, Trace } from "../../../../types"; import { InsightCard } from "../common/InsightCard"; import { ColumnsContainer } from "../common/InsightCard/ColumnsContainer"; @@ -26,7 +27,8 @@ export const SpanScalingInsightCard = ({ onRecalculate, onRefresh, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: SpanScalingInsightCardProps) => { const isJaegerEnabled = useGlobalStore.use.isJaegerEnabled(); const affectedEndpoints = insight.affectedEndpoints ?? []; @@ -108,6 +110,10 @@ export const SpanScalingInsightCard = ({ } }; + const durationRangeString = `${getDurationString( + insight.minDuration + )} - ${getDurationString(insight.maxDuration)}`; + return ( {insight.maxConcurrency} - - {getDurationString(insight.minDuration)} -{" "} - {getDurationString(insight.maxDuration)} - + {durationRangeString} {renderRootCause(insight.rootCauseSpans)} {affectedEndpoints.length > 0 && ( @@ -164,6 +167,12 @@ export const SpanScalingInsightCard = ({ onRefresh={onRefresh} onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} + mainMetric={ + + {durationRangeString} + + } /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanUsagesInsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanUsagesInsightCard/index.tsx index 1b103877d..d30a16d42 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanUsagesInsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/SpanUsagesInsightCard/index.tsx @@ -40,7 +40,8 @@ export const SpanUsagesInsightCard = ({ onRecalculate, onRefresh, onGoToSpan, - isMarkAsReadButtonEnabled + isMarkAsReadButtonEnabled, + viewMode }: SpanUsagesInsightCardProps) => { const isJaegerEnabled = useGlobalStore.use.isJaegerEnabled(); const [data, setData] = useState({ @@ -325,6 +326,7 @@ export const SpanUsagesInsightCard = ({ onRefresh={onRefresh} onGoToSpan={onGoToSpan} isMarkAsReadButtonEnabled={isMarkAsReadButtonEnabled} + viewMode={viewMode} /> ); }; diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/RecalculateBar/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/RecalculateBar/index.tsx index 83e32f6e7..75329883b 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/RecalculateBar/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/RecalculateBar/index.tsx @@ -1,11 +1,11 @@ -import { RecalculateStartedIcon } from "../../../../../../../common/icons/16px/RecalculateStartedIcon"; +import { CheckmarkCircleArrowIcon } from "../../../../../../../common/icons/16px/CheckmarkCircleArrowIcon"; import * as s from "./styles"; export const RecalculateBar = () => { return ( - + Rechecking insight Trigger new actions for this asset diff --git a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/index.tsx b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/index.tsx index 41eb084f1..f1566b831 100644 --- a/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/index.tsx +++ b/src/components/Insights/InsightsCatalog/InsightsPage/insightCards/common/InsightCard/index.tsx @@ -9,7 +9,7 @@ import { TraceIcon } from "../../../../../../common/icons/12px/TraceIcon"; import { DoubleCircleIcon } from "../../../../../../common/icons/16px/DoubleCircleIcon"; import { HistogramIcon } from "../../../../../../common/icons/16px/HistogramIcon"; import { PinIcon } from "../../../../../../common/icons/16px/PinIcon"; -import { RecalculateIcon } from "../../../../../../common/icons/16px/RecalculateIcon"; +import { RecheckIcon } from "../../../../../../common/icons/16px/RecheckIcon"; import { CrossIcon } from "../../../../../../common/icons/CrossIcon"; import { Button } from "../../../../../../common/v3/Button"; import { BaseButtonProps } from "../../../../../../common/v3/Button/types"; @@ -18,6 +18,7 @@ import { Tooltip } from "../../../../../../common/v3/Tooltip"; import { trackingEvents } from "../../../../../tracking"; import { isEndpointInsight, isSpanInsight } from "../../../../../typeGuards"; import { InsightStatus } from "../../../../../types"; +import { IssueCompactCard } from "../IssueCompactCard"; import { InsightHeader } from "./InsightHeader"; import { ProductionAffectionBar } from "./ProductionAffectionBar"; import { RecalculateBar } from "./RecalculateBar"; @@ -41,7 +42,9 @@ export const InsightCard = ({ onGoToLive, onPin, content, - isAsync + isAsync, + viewMode, + mainMetric }: InsightCardProps) => { const [isDismissConfirmationOpened, setDismissConfirmationOpened] = useState(false); @@ -107,7 +110,7 @@ export const InsightCard = ({ }; }; - const handleSpanLinkClick = () => { + const goToSpan = () => { if ( (isSpanInsight(insight) || isEndpointInsight(insight)) && insight.spanInfo @@ -116,6 +119,10 @@ export const InsightCard = ({ } }; + const handleSpanLinkClick = () => { + goToSpan(); + }; + const handleDismissClick = () => { sendUserActionTrackingEvent( trackingEvents.INSIGHT_CARD_DISMISS_BUTTON_CLICKED, @@ -179,6 +186,28 @@ export const InsightCard = ({ } }; + if (viewMode === "compact") { + return ( + onRecalculate(insight.id)} + onMarkAsRead={markAsRead} + onTicketOpen={() => + openTicketInfo( + jiraTicketInfo?.spanCodeObjectId, + "ticket menu item clicked" + ) + } + isCritical={isCritical} + /> + ); + } + const renderActions = () => { const buttonsToRender: { tooltip: string; @@ -223,7 +252,7 @@ export const InsightCard = ({ tooltip: "Recheck", button: (btnProps) => (