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
14 changes: 5 additions & 9 deletions src/components/Insights/SpanNexusInsight/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,24 @@ import { Tag } from "../../common/Tag";
import { InsightCard } from "../InsightCard";
import { Description } from "../styles";
import * as s from "./styles";
import { SpanNexusInsightProps, } from "./types";
import { SpanNexusInsightProps } from "./types";

export const SpanNexusInsight = (
props: SpanNexusInsightProps
) => {
export const SpanNexusInsight = (props: SpanNexusInsightProps) => {
const { insight } = props;
const { entries, flows, usage, services } = insight;
return (
<InsightCard
data={insight}
content={
<s.ContentContainer>
<Description>
Multiple code flows depend on this location
</Description>
<Description>Multiple code flows depend on this location</Description>
<s.Stats>
<s.Stat>
<s.Key>Services</s.Key>
<Tag value={services} />
</s.Stat>
<s.Stat>
<s.Key>Edpoints</s.Key>
<s.Key>Endpoints</s.Key>
<Tag value={entries} />
</s.Stat>
<s.Stat>
Expand All @@ -32,7 +28,7 @@ export const SpanNexusInsight = (
</s.Stat>
<s.Stat>
<s.Key>Usage</s.Key>
<Tag value={usage || 'High'} />
<Tag value={usage || "High"} />
</s.Stat>
</s.Stats>
</s.ContentContainer>
Expand Down
113 changes: 54 additions & 59 deletions src/components/Insights/SpanNexusInsight/mockData.ts
Original file line number Diff line number Diff line change
@@ -1,62 +1,57 @@
import { InsightType } from "../../../types";
import {
InsightCategory,
InsightScope,
SpanNexusInsight
} from "../types";
import { InsightCategory, InsightScope, SpanNexusInsight } from "../types";

export const mockedSpanNexusInsight: SpanNexusInsight =
{
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
criticality: 0,
impact: 0,
firstCommitId: "b3f7b3f",
lastCommitId: "a1b2c3d",
deactivatedCommitId: null,
reopenCount: 0,
ticketLink: null,
name: "Code Nexus Point",
type: InsightType.SpanNexus,
category: InsightCategory.Usage,
specifity: 2,
importance: 3,
scope: InsightScope.Span,
spanInfo: {
name: "HTTP POST /owners/{ownerId}/pets/new",
displayName: "HTTP POST /owners/{ownerId}/pets/new",
instrumentationLibrary: "io.opentelemetry.tomcat-10.0",
spanCodeObjectId:
"span:io.opentelemetry.tomcat-10.0$_$HTTP POST /owners/{ownerId}/pets/new",
methodCodeObjectId:
"method:org.springframework.samples.petclinic.owner.PetController$_$processCreationForm",
kind: "Server",
codeObjectId:
"org.springframework.samples.petclinic.owner.PetController$_$processCreationForm"
},
shortDisplayInfo: {
title: "",
targetDisplayName: "",
subtitle: "",
description: ""
},
codeObjectId:
"org.springframework.samples.petclinic.owner.PetController$_$processCreationForm",
decorators: [
{
title: "Excessive HTTP Calls",
description: "Numerous Http calls to the same endpoint detected "
}
],
environment: "BOB-LAPTOP[LOCAL]",
severity: 0.0,
isRecalculateEnabled: false,
prefixedCodeObjectId:
export const mockedSpanNexusInsight: SpanNexusInsight = {
firstDetected: "2023-12-05T17:25:47.010Z",
lastDetected: "2024-01-05T13:14:47.010Z",
criticality: 0,
impact: 0,
firstCommitId: "b3f7b3f",
lastCommitId: "a1b2c3d",
deactivatedCommitId: null,
reopenCount: 0,
ticketLink: null,
name: "Code Nexus Point",
type: InsightType.SpanNexus,
category: InsightCategory.Usage,
specifity: 2,
importance: 3,
scope: InsightScope.Span,
spanInfo: {
name: "HTTP POST /owners/{ownerId}/pets/new",
displayName: "HTTP POST /owners/{ownerId}/pets/new",
instrumentationLibrary: "io.opentelemetry.tomcat-10.0",
spanCodeObjectId:
"span:io.opentelemetry.tomcat-10.0$_$HTTP POST /owners/{ownerId}/pets/new",
methodCodeObjectId:
"method:org.springframework.samples.petclinic.owner.PetController$_$processCreationForm",
customStartTime: null,
actualStartTime: "2023-08-10T08:04:00Z",
flows :4,
services: 3,
usage: 'High',
entries: 5,
};
kind: "Server",
codeObjectId:
"org.springframework.samples.petclinic.owner.PetController$_$processCreationForm"
},
shortDisplayInfo: {
title: "",
targetDisplayName: "",
subtitle: "",
description: ""
},
codeObjectId:
"org.springframework.samples.petclinic.owner.PetController$_$processCreationForm",
decorators: [
{
title: "Excessive HTTP Calls",
description: "Numerous Http calls to the same endpoint detected "
}
],
environment: "BOB-LAPTOP[LOCAL]",
severity: 0.0,
isRecalculateEnabled: false,
prefixedCodeObjectId:
"method:org.springframework.samples.petclinic.owner.PetController$_$processCreationForm",
customStartTime: null,
actualStartTime: "2023-08-10T08:04:00Z",
flows: 4,
services: 3,
usage: "High",
entries: 5
};
6 changes: 1 addition & 5 deletions src/components/Insights/SpanNexusInsight/types.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@

import {
InsightProps,
SpanNexusInsight,
} from "../types";
import { InsightProps, SpanNexusInsight } from "../types";

export interface SpanNexusInsightProps extends InsightProps {
insight: SpanNexusInsight;
Expand Down
5 changes: 2 additions & 3 deletions src/components/Insights/typeGuards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,5 @@ export const isEndpointHighNumberOfQueriesInsight = (
insight.type === InsightType.EndpointHighNumberOfQueries;

export const isSpanNexusInsight = (
insight: CodeObjectInsight
): insight is SpanNexusInsight =>
insight.type === InsightType.SpanNexus;
insight: CodeObjectInsight
): insight is SpanNexusInsight => insight.type === InsightType.SpanNexus;
1 change: 0 additions & 1 deletion src/components/Insights/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -690,4 +690,3 @@ export interface SpanNexusInsight extends SpanInsight {
flows: number;
usage: string | null;
}

2 changes: 1 addition & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export enum InsightType {
EndpointSessionInView = "EndpointSessionInView",
EndpointChattyApi = "EndpointChattyApi",
EndpointHighNumberOfQueries = "EndpointHighNumberOfQueries",
SpanNexus = "SpanNexus",
SpanNexus = "SpanNexus"
}

export type PercentileKey = "p50" | "p95";
Expand Down
2 changes: 1 addition & 1 deletion src/utils/getInsightTypeInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const getInsightTypeInfo = (
label: "High number of queries"
},
[InsightType.SpanNexus]: {
icon: BottleneckIcon, // todo changes
icon: BottleneckIcon, // todo changes
label: "Code Nexus Point"
}
};
Expand Down