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
5 changes: 3 additions & 2 deletions src/components/Insights/BottleneckInsight/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ export const BottleneckInsight = (props: BottleneckInsightProps) => {
props.onAssetLinkClick(spanCodeObjectId, props.insight.type);
};

const handleCreateJiraTicketButtonClick = () => {
const handleCreateJiraTicketButtonClick = (event: string) => {
sendTrackingEvent(trackingEvents.JIRA_TICKET_INFO_BUTTON_CLICKED, {
insightType: props.insight.type
});
props.onJiraTicketCreate && props.onJiraTicketCreate(props.insight);
props.onJiraTicketCreate &&
props.onJiraTicketCreate(props.insight, undefined, event);
};

return (
Expand Down
7 changes: 5 additions & 2 deletions src/components/Insights/EndpointNPlusOneInsight/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,15 @@ export const EndpointNPlusOneInsight = (
props.onAssetLinkClick(spanCodeObjectId, props.insight.type);
};

const handleTicketInfoButtonClick = (spanCodeObjectId: string) => {
const handleTicketInfoButtonClick = (
spanCodeObjectId: string,
event: string
) => {
sendTrackingEvent(trackingEvents.JIRA_TICKET_INFO_BUTTON_CLICKED, {
insightType: props.insight.type
});
props.onJiraTicketCreate &&
props.onJiraTicketCreate(props.insight, spanCodeObjectId);
props.onJiraTicketCreate(props.insight, spanCodeObjectId, event);
};

const handleTraceButtonClick = (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,15 @@ export const EndpointQueryOptimizationInsight = (
props.onAssetLinkClick(spanCodeObjectId, props.insight.type);
};

const handleTicketInfoButtonClick = (spanCodeObjectId: string) => {
const handleTicketInfoButtonClick = (
spanCodeObjectId: string,
event: string
) => {
sendTrackingEvent(trackingEvents.JIRA_TICKET_INFO_BUTTON_CLICKED, {
insightType: props.insight.type
});
props.onJiraTicketCreate &&
props.onJiraTicketCreate(props.insight, spanCodeObjectId);
props.onJiraTicketCreate(props.insight, spanCodeObjectId, event);
};

const handleTraceButtonClick = (
Expand Down
5 changes: 3 additions & 2 deletions src/components/Insights/HighNumberOfQueriesInsight/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ export const HighNumberOfQueriesInsight = (
props.onTraceButtonClick(trace, insightType, spanCodeObjectId);
};

const handleCreateJiraTicketButtonClick = () => {
const handleCreateJiraTicketButtonClick = (event: string) => {
sendTrackingEvent(trackingEvents.JIRA_TICKET_INFO_BUTTON_CLICKED, {
insightType: insight.type
});
props.onJiraTicketCreate && props.onJiraTicketCreate(insight);
props.onJiraTicketCreate &&
props.onJiraTicketCreate(insight, undefined, event);
};

return (
Expand Down
10 changes: 8 additions & 2 deletions src/components/Insights/InsightList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { TopUsageInsight } from "../TopUsageInsight";
import { TrafficInsight } from "../TrafficInsight";
import { actions } from "../actions";
import { Description } from "../styles";
import { trackingEvents } from "../tracking";
import {
isChattyApiEndpointInsight,
isCodeObjectErrorsInsight,
Expand Down Expand Up @@ -227,7 +228,8 @@ const renderInsightCard = (
insight: GenericCodeObjectInsight,
onJiraTicketCreate: (
insight: GenericCodeObjectInsight,
spanCodeObjectId?: string
spanCodeObjectId: string | undefined,
event?: string
) => void,
isJiraHintEnabled: boolean
): JSX.Element | undefined => {
Expand Down Expand Up @@ -679,9 +681,13 @@ export const InsightList = (props: InsightListProps) => {

const handleShowJiraTicket = (
insight: GenericCodeObjectInsight,
spanCodeObjectId?: string
spanCodeObjectId: string | undefined,
event?: string
) => {
props.onJiraTicketCreate(insight, spanCodeObjectId);
if (!isInsightJiraTicketHintShown?.value) {
sendTrackingEvent(trackingEvents.JIRA_TICKET_HINT_CLOSED, { event });
}
setIsInsightJiraTicketHintShown({ value: true });
};

Expand Down
5 changes: 3 additions & 2 deletions src/components/Insights/NPlusOneInsight/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ export const NPlusOneInsight = (props: NPlusOneInsightProps) => {
props.onTraceButtonClick(trace, insightType, spanCodeObjectId);
};

const handleCreateJiraTicketButtonClick = () => {
const handleCreateJiraTicketButtonClick = (event: string) => {
sendTrackingEvent(trackingEvents.JIRA_TICKET_INFO_BUTTON_CLICKED, {
insightType: props.insight.type
});
props.onJiraTicketCreate && props.onJiraTicketCreate(props.insight);
props.onJiraTicketCreate &&
props.onJiraTicketCreate(props.insight, undefined, event);
};

const spanName = props.insight.clientSpanName || undefined;
Expand Down
5 changes: 3 additions & 2 deletions src/components/Insights/QueryOptimizationInsight/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ export const QueryOptimizationInsight = (
props.onTraceButtonClick(trace, insightType, spanCodeObjectId);
};

const handleCreateJiraTicketButtonClick = () => {
const handleCreateJiraTicketButtonClick = (event: string) => {
sendTrackingEvent(trackingEvents.JIRA_TICKET_INFO_BUTTON_CLICKED, {
insightType: props.insight.type
});

props.onJiraTicketCreate &&
props.onJiraTicketCreate(
props.insight,
props.insight.spanInfo?.spanCodeObjectId
props.insight.spanInfo?.spanCodeObjectId,
event
);
};

Expand Down
7 changes: 5 additions & 2 deletions src/components/Insights/SpanBottleneckInsight/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,15 @@ export const SpanBottleneckInsight = (props: SpanBottleneckInsightProps) => {
props.onAssetLinkClick(spanCodeObjectId, props.insight.type);
};

const handleTicketInfoButtonClick = (spanCodeObjectId: string) => {
const handleTicketInfoButtonClick = (
spanCodeObjectId: string,
event: string
) => {
sendTrackingEvent(trackingEvents.JIRA_TICKET_INFO_BUTTON_CLICKED, {
insightType: props.insight.type
});
props.onJiraTicketCreate &&
props.onJiraTicketCreate(props.insight, spanCodeObjectId);
props.onJiraTicketCreate(props.insight, spanCodeObjectId, event);
};

return (
Expand Down
12 changes: 5 additions & 7 deletions src/components/Insights/common/JiraButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export const JiraButton = (props: JiraButtonProps) => {
props.ticketLink && openURLInDefaultBrowser(props.ticketLink);
};

const openTicketInfo = () => {
props.onTicketInfoButtonClick(props.spanCodeObjectId);
const openTicketInfo = (event: string) => {
props.onTicketInfoButtonClick(props.spanCodeObjectId, event);
};

const menuWidth = props.buttonType == "large" ? "119px" : "70px";
Expand All @@ -50,7 +50,7 @@ export const JiraButton = (props: JiraButtonProps) => {
icon: { component: PencilIcon },
label: "Edit",
value: props.spanCodeObjectId ?? "",
onClick: openTicketInfo
onClick: () => openTicketInfo("edit menu item click")
}
]}
onSelect={handleJiraButtonClick}
Expand All @@ -77,9 +77,7 @@ export const JiraButton = (props: JiraButtonProps) => {
<Tooltip title={"Ticket Info"}>
<Button
icon={{ component: JiraLogoIcon }}
onClick={() =>
props.onTicketInfoButtonClick(props.spanCodeObjectId)
}
onClick={() => openTicketInfo("jira button click")}
>
{buttonText}
</Button>
Expand Down Expand Up @@ -109,7 +107,7 @@ export const JiraButton = (props: JiraButtonProps) => {
<s.TryNowButton
buttonType={"secondary"}
label={"Try now"}
onClick={openTicketInfo}
onClick={() => openTicketInfo("try now button click")}
/>
</s.HintContainer>
}
Expand Down
5 changes: 4 additions & 1 deletion src/components/Insights/common/JiraButton/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
export interface JiraButtonProps {
onTicketInfoButtonClick(spanCodeObjectId?: string): void;
onTicketInfoButtonClick(
spanCodeObjectId: string | undefined,
event: string
): void;
ticketLink?: string | null;
spanCodeObjectId?: string;
buttonType: "small" | "large";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,10 @@ export const EndpointHighNumberOfQueriesInsightTicket = (
<span
key={"details"}
>{`The endpoint ${spanInsight.spanInfo.displayName} is triggering an abnormally high number of queries.`}</span>,
<span key={"text"}>
<div key={"text"}>
Consider using joins/caching to reduce the overhead of the db
roundtrip.
</span>,
<></>,
</div>,
<span
key={"median"}
>{`Number of queries (median): ${spanInsight.queriesCount}`}</span>,
Expand Down
3 changes: 2 additions & 1 deletion src/components/Insights/tracking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export const trackingEvents = addPrefix(
JIRA_TICKET_FIELD_COPY_BUTTON_CLICKED:
"jira ticket field copy button clicked",
JIRA_TICKET_ATTACHMENT_DOWNLOAD_BUTTON_CLICKED:
"jira ticket attachment download button clicked"
"jira ticket attachment download button clicked",
JIRA_TICKET_HINT_CLOSED: "jira ticket hint closed"
},
" "
);
3 changes: 2 additions & 1 deletion src/components/Insights/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export interface InsightProps {
onRefresh: (insightType: InsightType) => void;
onJiraTicketCreate?: (
insight: GenericCodeObjectInsight,
spanCodeObjectId?: string
spanCodeObjectId: string | undefined,
event?: string
) => void;
isJiraHintEnabled?: boolean;
}
Expand Down