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
21 changes: 15 additions & 6 deletions src/components/Insights/EndpointNPlusOneInsight/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useContext } from "react";
import { usePagination } from "../../../hooks/usePagination";
import { InsightType } from "../../../types";
import { roundTo } from "../../../utils/roundTo";
import { ConfigContext } from "../../common/App/ConfigContext";
import { Pagination } from "../../common/Pagination";
Expand Down Expand Up @@ -29,8 +30,12 @@ export const EndpointNPlusOneInsight = (
props.onAssetLinkClick(spanCodeObjectId);
};

const handleTraceButtonClick = (trace: Trace) => {
props.onTraceButtonClick(trace, props.insight.type);
const handleTraceButtonClick = (
trace: Trace,
insightType: InsightType,
spanCodeObjectId: string
) => {
props.onTraceButtonClick(trace, insightType, spanCodeObjectId);
};

return (
Expand Down Expand Up @@ -83,10 +88,14 @@ export const EndpointNPlusOneInsight = (
<s.Button
icon={{ component: CrosshairIcon }}
onClick={() =>
handleTraceButtonClick({
name: spanName,
id: span.traceId
})
handleTraceButtonClick(
{
name: spanName,
id: span.traceId
},
props.insight.type,
spanInfo.spanCodeObjectId
)
}
>
Trace
Expand Down
6 changes: 5 additions & 1 deletion src/components/Insights/EndpointNPlusOneInsight/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@ import {
export interface EndpointNPlusOneInsightProps extends InsightProps {
insight: EndpointSuspectedNPlusOneInsight;
onAssetLinkClick: (spanCodeObjectId: string) => void;
onTraceButtonClick: (trace: Trace, insightType: InsightType) => void;
onTraceButtonClick: (
trace: Trace,
insightType: InsightType,
spanCodeObjectId: string
) => void;
}
21 changes: 15 additions & 6 deletions src/components/Insights/ExcessiveAPICallsInsight/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useContext } from "react";
import { usePagination } from "../../../hooks/usePagination";
import { InsightType } from "../../../types";
import { ConfigContext } from "../../common/App/ConfigContext";
import { Pagination } from "../../common/Pagination";
import { Tooltip } from "../../common/Tooltip";
Expand Down Expand Up @@ -27,8 +28,12 @@ export const ExcessiveAPICallsInsight = (
props.onAssetLinkClick(spanCodeObjectId);
};

const handleTraceButtonClick = (trace: Trace) => {
props.onTraceButtonClick(trace, props.insight.type);
const handleTraceButtonClick = (
trace: Trace,
insightType: InsightType,
spanCodeObjectId: string
) => {
props.onTraceButtonClick(trace, insightType, spanCodeObjectId);
};

return (
Expand Down Expand Up @@ -58,10 +63,14 @@ export const ExcessiveAPICallsInsight = (
<s.Button
icon={{ component: CrosshairIcon }}
onClick={() =>
handleTraceButtonClick({
name: spanName,
id: traceId
})
handleTraceButtonClick(
{
name: spanName,
id: traceId
},
props.insight.type,
spanCodeObjectId
)
}
>
Trace
Expand Down
6 changes: 5 additions & 1 deletion src/components/Insights/ExcessiveAPICallsInsight/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ import { ChattyApiEndpointInsight, InsightProps, Trace } from "../types";
export interface ExcessiveAPICallsInsightProps extends InsightProps {
insight: ChattyApiEndpointInsight;
onAssetLinkClick: (spanCodeObjectId: string) => void;
onTraceButtonClick: (trace: Trace, insightType: InsightType) => void;
onTraceButtonClick: (
trace: Trace,
insightType: InsightType,
spanCodeObjectId: string
) => void;
}
9 changes: 7 additions & 2 deletions src/components/Insights/InsightList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,17 @@ const renderInsightCard = (
});
};

const handleTraceButtonClick = (trace: Trace, insightType: InsightType) => {
const handleTraceButtonClick = (
trace: Trace,
insightType: InsightType,
spanCodeObjectId?: string
) => {
window.sendMessageToDigma({
action: actions.GO_TO_TRACE,
payload: {
trace,
insightType
insightType,
spanCodeObjectId
}
});
};
Expand Down
21 changes: 15 additions & 6 deletions src/components/Insights/NPlusOneInsight/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useContext } from "react";
import { InsightType } from "../../../types";
import { trimEndpointScheme } from "../../../utils/trimEndpointScheme";
import { ConfigContext } from "../../common/App/ConfigContext";
import { Tooltip } from "../../common/Tooltip";
Expand All @@ -16,8 +17,12 @@ export const NPlusOneInsight = (props: NPlusOneInsightProps) => {
spanCodeObjectId && props.onAssetLinkClick(spanCodeObjectId);
};

const handleTraceButtonClick = (trace: Trace) => {
props.onTraceButtonClick(trace, props.insight.type);
const handleTraceButtonClick = (
trace: Trace,
insightType: InsightType,
spanCodeObjectId?: string
) => {
props.onTraceButtonClick(trace, insightType, spanCodeObjectId);
};

const spanName = props.insight.clientSpanName || undefined;
Expand Down Expand Up @@ -45,10 +50,14 @@ export const NPlusOneInsight = (props: NPlusOneInsightProps) => {
{config.isJaegerEnabled && traceId && (
<s.Button
onClick={() =>
handleTraceButtonClick({
name: spanName,
id: traceId
})
handleTraceButtonClick(
{
name: spanName,
id: traceId
},
props.insight.type,
spanCodeObjectId
)
}
icon={{ component: CrosshairIcon }}
>
Expand Down
6 changes: 5 additions & 1 deletion src/components/Insights/NPlusOneInsight/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ import { InsightProps, SpanNPlusOneInsight, Trace } from "../types";
export interface NPlusOneInsightProps extends InsightProps {
insight: SpanNPlusOneInsight;
onAssetLinkClick: (spanCodeObjectId: string) => void;
onTraceButtonClick: (trace: Trace, insightType: InsightType) => void;
onTraceButtonClick: (
trace: Trace,
insightType: InsightType,
spanCodeObjectId?: string
) => void;
}
21 changes: 15 additions & 6 deletions src/components/Insights/ScalingIssueInsight/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useContext } from "react";
import { InsightType } from "../../../types";
import { trimEndpointScheme } from "../../../utils/trimEndpointScheme";
import { ConfigContext } from "../../common/App/ConfigContext";
import { Button } from "../../common/Button";
Expand All @@ -18,8 +19,12 @@ export const ScalingIssueInsight = (props: ScalingIssueInsightProps) => {
props.onAssetLinkClick(spanCodeObjectId);
};

const handleTraceButtonClick = (trace: Trace) => {
props.onTraceButtonClick(trace, props.insight.type);
const handleTraceButtonClick = (
trace: Trace,
insightType: InsightType,
spanCodeObjectId: string
) => {
props.onTraceButtonClick(trace, insightType, spanCodeObjectId);
};

const handleHistogramButtonClick = () => {
Expand Down Expand Up @@ -75,10 +80,14 @@ export const ScalingIssueInsight = (props: ScalingIssueInsightProps) => {
<s.Button
icon={{ component: CrosshairIcon }}
onClick={() =>
handleTraceButtonClick({
name: spanName,
id: traceId
})
handleTraceButtonClick(
{
name: spanName,
id: traceId
},
props.insight.type,
spanCodeObjectId
)
}
>
Trace
Expand Down
6 changes: 5 additions & 1 deletion src/components/Insights/ScalingIssueInsight/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ import { InsightProps, SpanScalingBadlyInsight, Trace } from "../types";
export interface ScalingIssueInsightProps extends InsightProps {
insight: SpanScalingBadlyInsight;
onAssetLinkClick: (spanCodeObjectId: string) => void;
onTraceButtonClick: (trace: Trace, insightType: InsightType) => void;
onTraceButtonClick: (
trace: Trace,
insightType: InsightType,
spanCodeObjectId: string
) => void;
onHistogramButtonClick: (
instrumentationLibrary: string,
name: string,
Expand Down
21 changes: 15 additions & 6 deletions src/components/Insights/SessionInViewInsight/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useContext } from "react";
import { usePagination } from "../../../hooks/usePagination";
import { InsightType } from "../../../types";
import { ConfigContext } from "../../common/App/ConfigContext";
import { Pagination } from "../../common/Pagination";
import { Tooltip } from "../../common/Tooltip";
Expand All @@ -25,8 +26,12 @@ export const SessionInViewInsight = (props: SessionInViewInsightProps) => {
props.onAssetLinkClick(spanCodeObjectId);
};

const handleTraceButtonClick = (trace: Trace) => {
props.onTraceButtonClick(trace, props.insight.type);
const handleTraceButtonClick = (
trace: Trace,
insightType: InsightType,
spanCodeObjectId: string
) => {
props.onTraceButtonClick(trace, insightType, spanCodeObjectId);
};

return (
Expand Down Expand Up @@ -56,10 +61,14 @@ export const SessionInViewInsight = (props: SessionInViewInsightProps) => {
<s.Button
icon={{ component: CrosshairIcon }}
onClick={() =>
handleTraceButtonClick({
name: spanName,
id: traceId
})
handleTraceButtonClick(
{
name: spanName,
id: traceId
},
props.insight.type,
spanCodeObjectId
)
}
>
Trace
Expand Down
6 changes: 5 additions & 1 deletion src/components/Insights/SessionInViewInsight/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ import { InsightProps, SessionInViewEndpointInsight, Trace } from "../types";
export interface SessionInViewInsightProps extends InsightProps {
insight: SessionInViewEndpointInsight;
onAssetLinkClick: (spanCodeObjectId: string) => void;
onTraceButtonClick: (trace: Trace, insightType: InsightType) => void;
onTraceButtonClick: (
trace: Trace,
insightType: InsightType,
spanCodeObjectId: string
) => void;
}
21 changes: 15 additions & 6 deletions src/components/Insights/TopUsageInsight/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useContext } from "react";
import { usePagination } from "../../../hooks/usePagination";
import { InsightType } from "../../../types";
import { roundTo } from "../../../utils/roundTo";
import { ConfigContext } from "../../common/App/ConfigContext";
import { Pagination } from "../../common/Pagination";
Expand All @@ -25,8 +26,12 @@ export const TopUsageInsight = (props: TopUsageInsightProps) => {
spanCodeObjectId && props.onAssetLinkClick(spanCodeObjectId);
};

const handleTraceButtonClick = (trace: Trace) => {
props.onTraceButtonClick(trace, props.insight.type);
const handleTraceButtonClick = (
trace: Trace,
insightType: InsightType,
spanCodeObjectId: string
) => {
props.onTraceButtonClick(trace, insightType, spanCodeObjectId);
};

return (
Expand Down Expand Up @@ -82,10 +87,14 @@ export const TopUsageInsight = (props: TopUsageInsightProps) => {
<s.Button
icon={{ component: CrosshairIcon }}
onClick={() =>
handleTraceButtonClick({
name: firstServiceName,
id: traceId
})
handleTraceButtonClick(
{
name: firstServiceName,
id: traceId
},
props.insight.type,
flow.firstService.spanCodeObjectId
)
}
>
Trace
Expand Down
6 changes: 5 additions & 1 deletion src/components/Insights/TopUsageInsight/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ import { InsightProps, SpanUsagesInsight, Trace } from "../types";
export interface TopUsageInsightProps extends InsightProps {
insight: SpanUsagesInsight;
onAssetLinkClick: (spanCodeObjectId: string) => void;
onTraceButtonClick: (trace: Trace, insightType: InsightType) => void;
onTraceButtonClick: (
trace: Trace,
insightType: InsightType,
spanCodeObjectId: string
) => void;
}