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
4 changes: 3 additions & 1 deletion .storybook/preview-body.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
window.ide = "IDEA";
window.mainFont;
window.codeFont;
window.jaegerURL = "http://localhost:17686";
window.isJaegerEnabled = true;
window.userEmail;
window.isObservabilityEnabled;
window.userRegistrationEmail = "email@example.com";
window.isObservabilityEnabled = true;
window.isDigmaEngineInstalled;
window.isDigmaEngineRunning;
window.isDockerInstalled = true;
Expand Down
2 changes: 2 additions & 0 deletions assets/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
window.ide;
window.mainFont;
window.codeFont;
window.jaegerURL;
window.isJaegerEnabled;
window.userEmail;
window.userRegistrationEmail;
window.isObservabilityEnabled;
window.isDigmaEngineInstalled;
window.isDigmaEngineRunning;
Expand Down
6 changes: 4 additions & 2 deletions src/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const actions = addPrefix(ACTION_PREFIX, {
SET_THEME: "SET_THEME",
SET_MAIN_FONT: "SET_MAIN_FONT",
SET_CODE_FONT: "SET_CODE_FONT",
SET_JAEGER_URL: "SET_JAEGER_URL",
SET_IS_JAEGER_ENABLED: "SET_IS_JAEGER_ENABLED",
SET_IS_DIGMA_ENGINE_INSTALLED: "SET_IS_DIGMA_ENGINE_INSTALLED",
SET_IS_DIGMA_ENGINE_RUNNING: "SET_IS_DIGMA_ENGINE_RUNNING",
Expand All @@ -18,10 +19,11 @@ export const actions = addPrefix(ACTION_PREFIX, {
OPEN_TROUBLESHOOTING_GUIDE: "OPEN_TROUBLESHOOTING_GUIDE",
OPEN_DOCUMENTATION: "OPEN_DOCUMENTATION",
SET_DIGMA_API_URL: "SET_DIGMA_API_URL",
SET_USER_EMAIL: "SET_USER_EMAIL",
SET_USER_REGISTRATION_EMAIL: "SET_USER_REGISTRATION_EMAIL",
SET_ENVIRONMENT: "SET_ENVIRONMENT",
SET_IS_OBSERVABILITY_ENABLED: "SET_IS_OBSERVABILITY_ENABLED",
SET_OBSERVABILITY: "SET_OBSERVABILITY",
GET_BACKEND_INFO: "GET_BACKEND_INFO",
SET_BACKEND_INFO: "SET_BACKEND_INFO"
SET_BACKEND_INFO: "SET_BACKEND_INFO",
REGISTER: "REGISTER"
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
insight: {
criticality: 0,
impact: 0,
name: "Bottleneck",
type: InsightType.SpanEndpointBottleneck,
category: InsightCategory.Performance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
insight: {
criticality: 0,
impact: 0,
name: "Span Duration Breakdown",
type: InsightType.SpanDurationBreakdown,
category: InsightCategory.Performance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type Story = StoryObj<typeof meta>;
export const WithAverage: Story = {
args: {
insight: {
criticality: 0,
impact: 0,
name: "Performance Stats",
type: InsightType.SpanDurations,
category: InsightCategory.Performance,
Expand Down Expand Up @@ -126,6 +128,8 @@ export const WithAverage: Story = {
export const WithChange: Story = {
args: {
insight: {
criticality: 0,
impact: 0,
name: "Performance Stats",
type: InsightType.SpanDurations,
category: InsightCategory.Performance,
Expand Down Expand Up @@ -222,6 +226,8 @@ export const WithChange: Story = {
export const WithEvaluatingChange: Story = {
args: {
insight: {
criticality: 0,
impact: 0,
name: "Performance Stats",
type: InsightType.SpanDurations,
category: InsightCategory.Performance,
Expand Down Expand Up @@ -318,6 +324,8 @@ export const WithEvaluatingChange: Story = {
export const HistogramWithManyBars: Story = {
args: {
insight: {
criticality: 0,
impact: 0,
name: "Performance Stats",
type: InsightType.SpanDurations,
category: InsightCategory.Performance,
Expand Down Expand Up @@ -4832,6 +4840,8 @@ export const HistogramWithManyBars: Story = {
export const HistogramWithGaps: Story = {
args: {
insight: {
criticality: 0,
impact: 0,
name: "Performance Stats",
type: InsightType.SpanDurations,
category: InsightCategory.Performance,
Expand Down Expand Up @@ -5076,6 +5086,8 @@ export const HistogramWithGaps: Story = {
export const HistogramWithAFewBars: Story = {
args: {
insight: {
criticality: 0,
impact: 0,
name: "Performance Stats",
type: InsightType.SpanDurations,
category: InsightCategory.Performance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type Story = StoryObj<typeof meta>;
export const WithEvaluatingChange: Story = {
args: {
insight: {
criticality: 0,
impact: 0,
name: "Endpoint Duration Slowdown Source",
type: InsightType.EndpointDurationSlowdown,
category: InsightCategory.Performance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
insight: {
criticality: 0,
impact: 0,
name: "Suspected N+1 Query",
type: InsightType.EndpointSpanNPlusOne,
category: InsightCategory.Performance,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
insight: {
criticality: 0,
impact: 0,
name: "Errors",
type: InsightType.Errors,
scope: InsightScope.Function,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
insight: {
criticality: 0,
impact: 0,
name: "HTTP Chatter",
type: InsightType.EndpointChattyApi,
category: InsightCategory.Performance,
Expand Down
2 changes: 2 additions & 0 deletions src/components/Insights/InsightCard/InsightCard.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
data: {
criticality: 0,
impact: 0,
name: "Suspected N+1 Query",
type: InsightType.EndpointSpanNPlusOne,
category: InsightCategory.Performance,
Expand Down
10 changes: 7 additions & 3 deletions src/components/Insights/InsightList/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useEffect, useState } from "react";
import { DefaultTheme, useTheme } from "styled-components";
import { actions } from "..";
import { InsightType } from "../../../types";
import { getInsightTypeInfo } from "../../../utils/getInsightTypeInfo";
import { Card } from "../../common/Card";
Expand All @@ -26,6 +25,7 @@ import { SlowEndpointInsight } from "../SlowEndpointInsight";
import { SpanBottleneckInsight } from "../SpanBottleneckInsight";
import { TopUsageInsight } from "../TopUsageInsight";
import { TrafficInsight } from "../TrafficInsight";
import { actions } from "../actions";
import { Description } from "../styles";
import {
isChattyApiEndpointInsight,
Expand Down Expand Up @@ -210,7 +210,8 @@ const getInsightGroupIconColor = (theme: DefaultTheme) => {
};

const renderInsightCard = (
insight: GenericCodeObjectInsight
insight: GenericCodeObjectInsight,
onJiraTicketCreate: (insight: GenericCodeObjectInsight) => void
): JSX.Element | undefined => {
const handleErrorSelect = (errorId: string) => {
window.sendMessageToDigma({
Expand Down Expand Up @@ -425,6 +426,7 @@ const renderInsightCard = (
onTraceButtonClick={handleTraceButtonClick}
onRecalculate={handleRecalculate}
onRefresh={handleRefresh}
onJiraTicketCreate={onJiraTicketCreate}
/>
);
}
Expand Down Expand Up @@ -587,7 +589,9 @@ export const InsightList = (props: InsightListProps) => {
</s.InsightGroupHeader>
)}
{x.insights.length > 0 ? (
x.insights.map((insight) => renderInsightCard(insight))
x.insights.map((insight) =>
renderInsightCard(insight, props.onJiraTicketCreate)
)
) : (
<Card
header={<>No data yet</>}
Expand Down
1 change: 1 addition & 0 deletions src/components/Insights/InsightList/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export interface InsightListProps {
hasObservability: boolean;
hasMissingDependency: boolean;
canInstrumentMethod: boolean;
onJiraTicketCreate: (insight: GenericCodeObjectInsight) => void;
}
117 changes: 117 additions & 0 deletions src/components/Insights/Insights.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,107 @@ export const Default: Story = {
needsObservabilityFix: false,
insights: [
{
criticality: 0.8,
impact: 0,
name: "N+1",
type: InsightType.SpanNPlusOne,
category: InsightCategory.Performance,
specifity: 2,
importance: 2,
span: {
name: "OwnerValidation.ValidateOwner",
displayName: "OwnerValidation.ValidateOwner",
instrumentationLibrary:
"io.opentelemetry.opentelemetry-instrumentation-annotations-1.16",
spanCodeObjectId:
"span:io.opentelemetry.opentelemetry-instrumentation-annotations-1.16$_$OwnerValidation.ValidateOwner",
methodCodeObjectId:
"org.springframework.samples.petclinic.domain.OwnerValidation$_$ValidateOwner",
kind: "Internal",
codeObjectId:
"org.springframework.samples.petclinic.domain.OwnerValidation$_$ValidateOwner"
},
occurrences: 100,
traceId: "00D37A4E7208E0F6E89AA7E2E37446A6",
clientSpanName: "select * from users where id = :id",
clientSpanCodeObjectId:
"span:OwnerController$_$1D138649EB4FFA92C0E3C8103404F2",
duration: {
value: 1.64,
unit: "sec",
raw: 1636050588.0
},
endpoints: [
{
endpointInfo: {
route: "HTTP POST /owners/new",
instrumentationLibrary: "OwnerController",
spanCodeObjectId:
"span:OwnerController$_$1D138649EB4FFA92C0E3C8103404F2",
entrySpanCodeObjectId:
"span:io.opentelemetry.tomcat-10.0$_$HTTP POST /owners/new",
serviceName: "spring-petclinic"
},
occurrences: 100,
criticality: 1,
impact: 0,
severity: 0
},
{
endpointInfo: {
route: "HTTP POST /owners/new2",
instrumentationLibrary: "OwnerController",
spanCodeObjectId:
"span:OwnerController$_$1D138649EB4FFA92C0E3C8103404F3",
entrySpanCodeObjectId:
"span:io.opentelemetry.tomcat-10.0$_$HTTP POST /owners/new2",
serviceName: "spring-petclinic"
},
occurrences: 100,
criticality: 1,
impact: 0,
severity: 0
}
],
scope: InsightScope.Span,
spanInfo: {
name: "OwnerValidation.ValidateOwner",
displayName: "OwnerValidation.ValidateOwner",
instrumentationLibrary:
"io.opentelemetry.opentelemetry-instrumentation-annotations-1.16",
spanCodeObjectId:
"span:io.opentelemetry.opentelemetry-instrumentation-annotations-1.16$_$OwnerValidation.ValidateOwner",
methodCodeObjectId:
"org.springframework.samples.petclinic.domain.OwnerValidation$_$ValidateOwner",
kind: "Internal",
codeObjectId:
"org.springframework.samples.petclinic.domain.OwnerValidation$_$ValidateOwner"
},
shortDisplayInfo: {
title: "",
targetDisplayName: "",
subtitle: "",
description: ""
},
codeObjectId:
"org.springframework.samples.petclinic.domain.OwnerValidation$_$ValidateOwner",
decorators: [
{
title: "N+1",
description: "Supected NPlus One"
}
],
environment: "BOB-LAPTOP[LOCAL]",
severity: 0.0,
isRecalculateEnabled: false,
prefixedCodeObjectId:
"method:org.springframework.samples.petclinic.domain.OwnerValidation$_$ValidateOwner",
customStartTime: null,
actualStartTime: "2023-07-27T08:23:56.500827Z"
},
{
criticality: 0,
impact: 0,
name: "Request Breakdown",
type: InsightType.EndpointBreakdown,
category: InsightCategory.Usage,
Expand Down Expand Up @@ -110,6 +211,8 @@ export const Default: Story = {
actualStartTime: "2023-06-26T00:00:00.000Z"
},
{
criticality: 0,
impact: 0,
name: "Errors",
type: InsightType.Errors,
scope: InsightScope.Function,
Expand Down Expand Up @@ -155,6 +258,8 @@ export const Default: Story = {
actualStartTime: "2023-06-26T13:53:53.645Z"
},
{
criticality: 0,
impact: 0,
name: "Errors Hotspot",
type: InsightType.HotSpot,
scope: InsightScope.Function,
Expand Down Expand Up @@ -186,6 +291,8 @@ export const Default: Story = {
actualStartTime: "2023-06-26T13:53:57.956Z"
},
{
criticality: 0,
impact: 0,
name: "Low Usage",
type: InsightType.LowUsage,
category: InsightCategory.Usage,
Expand Down Expand Up @@ -233,6 +340,8 @@ export const Default: Story = {
actualStartTime: "2023-06-12T13:48:59.404Z"
},
{
criticality: 0,
impact: 0,
name: "Bottleneck Detected",
type: InsightType.SlowestSpans,
category: InsightCategory.Performance,
Expand Down Expand Up @@ -318,6 +427,8 @@ export const Default: Story = {
actualStartTime: "2023-06-12T13:49:08.186Z"
},
{
criticality: 0,
impact: 0,
name: "Span Duration Breakdown",
type: InsightType.SpanDurationBreakdown,
category: InsightCategory.Performance,
Expand Down Expand Up @@ -384,6 +495,8 @@ export const Default: Story = {
actualStartTime: "2023-06-12T13:49:03.486Z"
},
{
criticality: 0,
impact: 0,
name: "Performance Stats",
type: InsightType.SpanDurations,
category: InsightCategory.Performance,
Expand Down Expand Up @@ -470,6 +583,8 @@ export const Default: Story = {
actualStartTime: "2023-06-13T00:00:00.000Z"
},
{
criticality: 0,
impact: 0,
name: "Scaling Insufficient Data",
type: InsightType.SpanScalingInsufficientData,
category: InsightCategory.Performance,
Expand Down Expand Up @@ -601,6 +716,8 @@ export const NoObservability: Story = {
};

const errorsInsight: CodeObjectErrorsInsight = {
criticality: 0,
impact: 0,
name: "Errors",
type: InsightType.Errors,
scope: InsightScope.Function,
Expand Down
Loading