Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(trace-details): frontend changes for trace details #6905

Merged
merged 38 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
aaa4529
feat(trace-details): frontend changes for trace details
vikrantgupta25 Jan 22, 2025
7eb044d
feat(trace-detail): address review comments from elipsis
vikrantgupta25 Jan 22, 2025
95424d2
Merge branch 'main' into feat/trace-details-frontend
vikrantgupta25 Jan 23, 2025
8d85036
feat(trace0-detail): add the new drawer designs
vikrantgupta25 Jan 24, 2025
a99f293
feat(trace-detail): handle the selected span hover
vikrantgupta25 Jan 24, 2025
700ff3a
feat(trace-detail): address theme colors and span selection
vikrantgupta25 Jan 24, 2025
abdd1f7
feat(trace-detail): fix some more css
vikrantgupta25 Jan 24, 2025
4b14ac6
feat(trace-detail): fix some more css
vikrantgupta25 Jan 24, 2025
02edbd1
feat(trace-detail): add hoverred span and handled no data components …
vikrantgupta25 Jan 24, 2025
cacaadf
feat(trace-detail): handle light mode designs
vikrantgupta25 Jan 24, 2025
34f6f7c
Merge branch 'main' into feat/trace-details-frontend
vikrantgupta25 Jan 24, 2025
884b5a3
feat(trace-detail): remove the hover functionality in favor of perfor…
vikrantgupta25 Jan 24, 2025
5e8be4c
feat(trace-detail): span lines connectors
vikrantgupta25 Jan 24, 2025
4305a21
feat(trace-detail): span lines connectors
vikrantgupta25 Jan 24, 2025
8ddee50
feat(trace-detail): handle the line matching for flamegraph and water…
vikrantgupta25 Jan 26, 2025
c706b8f
feat(trace-waterfall): change the timeline color to make it less poky
vikrantgupta25 Jan 26, 2025
3b79dec
feat(trace-waterfall): added where clause support in trace details page
vikrantgupta25 Jan 26, 2025
4c0be55
feat(trace-waterfall): added where clause support in trace details page
vikrantgupta25 Jan 26, 2025
e7e497c
feat(trace-detail): handle light mode designs
vikrantgupta25 Jan 26, 2025
5be7026
feat(trace-detail): handle light mode designs
vikrantgupta25 Jan 26, 2025
e5dff4b
Merge branch 'main' into feat/trace-details-frontend
vikrantgupta25 Jan 26, 2025
249d80f
feat(trace-detail): fix build issues
vikrantgupta25 Jan 26, 2025
c198196
feat(trace-detail): handle loading error state for filters and flameg…
vikrantgupta25 Jan 26, 2025
84268e0
feat(trace-detail): fix the hardcoded traceID
vikrantgupta25 Jan 26, 2025
603bc58
feat(trace-detail): remove unnecessaru use effects
vikrantgupta25 Jan 26, 2025
c14c1f7
feat(trace-detail): handled the flamegraph update with ID
vikrantgupta25 Jan 27, 2025
21fb338
feat(trace-detail): added timestamp bucketing and latency sampling
vikrantgupta25 Jan 27, 2025
619ab4d
Merge branch 'main' into feat/trace-details-frontend
vikrantgupta25 Jan 27, 2025
de57c1f
feat(trace-detail): extract the buckets and span limit in constants
vikrantgupta25 Jan 27, 2025
e366133
feat(trace-detail): minor VQA comments
vikrantgupta25 Jan 27, 2025
41023ae
feat(trace-detail): remove unnecessaru use effects
vikrantgupta25 Jan 27, 2025
deb91fb
feat(trace-detail): add go to related logs
vikrantgupta25 Jan 27, 2025
4946d97
Merge branch 'main' into feat/trace-details-frontend
vikrantgupta25 Jan 27, 2025
488a7fc
feat(trace-detail): address review comments
vikrantgupta25 Jan 28, 2025
30805f7
feat(trace-detail): address review comments
vikrantgupta25 Jan 28, 2025
4437455
feat(trace-detail): address review comments
vikrantgupta25 Jan 28, 2025
2867956
feat(trace-detail): address review comments
vikrantgupta25 Jan 28, 2025
1216110
Merge branch 'main' into feat/trace-details-frontend
vikrantgupta25 Jan 28, 2025
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
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"@sentry/webpack-plugin": "2.22.6",
"@signozhq/design-tokens": "1.1.4",
"@tanstack/react-table": "8.20.6",
"@tanstack/react-virtual": "3.11.2",
"@uiw/react-md-editor": "3.23.5",
"@visx/group": "3.3.0",
"@visx/shape": "3.5.0",
Expand Down
22 changes: 22 additions & 0 deletions frontend/public/Icons/construction.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions frontend/public/Icons/no-data.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion frontend/src/AppRoutes/pageComponents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ export const TraceFilter = Loadable(
);

export const TraceDetail = Loadable(
() => import(/* webpackChunkName: "TraceDetail Page" */ 'pages/TraceDetail'),
() =>
import(
/* webpackChunkName: "TraceDetail Page" */ 'pages/TraceDetailV2/index'
),
);

export const UsageExplorerPage = Loadable(
Expand Down
33 changes: 33 additions & 0 deletions frontend/src/api/trace/getTraceFlamegraph.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { ApiV2Instance as axios } from 'api';
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
import { AxiosError } from 'axios';
import { omit } from 'lodash-es';
import { ErrorResponse, SuccessResponse } from 'types/api';
import {
GetTraceFlamegraphPayloadProps,
GetTraceFlamegraphSuccessResponse,
} from 'types/api/trace/getTraceFlamegraph';

const getTraceFlamegraph = async (
props: GetTraceFlamegraphPayloadProps,
): Promise<
SuccessResponse<GetTraceFlamegraphSuccessResponse> | ErrorResponse
> => {
try {
const response = await axios.post<GetTraceFlamegraphSuccessResponse>(
`/traces/flamegraph/${props.traceId}`,
omit(props, 'traceId'),
);

return {
statusCode: 200,
error: null,
message: 'Success',
payload: response.data,
};
} catch (error) {
vikrantgupta25 marked this conversation as resolved.
Show resolved Hide resolved
return ErrorResponseHandler(error as AxiosError);
}
};

export default getTraceFlamegraph;
41 changes: 41 additions & 0 deletions frontend/src/api/trace/getTraceV2.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import { ApiV2Instance as axios } from 'api';
import { ErrorResponseHandler } from 'api/ErrorResponseHandler';
import { AxiosError } from 'axios';
import { omit } from 'lodash-es';
import { ErrorResponse, SuccessResponse } from 'types/api';
import {
GetTraceV2PayloadProps,
GetTraceV2SuccessResponse,
} from 'types/api/trace/getTraceV2';

const getTraceV2 = async (
props: GetTraceV2PayloadProps,
): Promise<SuccessResponse<GetTraceV2SuccessResponse> | ErrorResponse> => {
try {
let uncollapsedSpans = [...props.uncollapsedSpans];
if (!props.isSelectedSpanIDUnCollapsed) {
uncollapsedSpans = uncollapsedSpans.filter(
(node) => node !== props.selectedSpanId,
);
}
const postData: GetTraceV2PayloadProps = {
...props,
uncollapsedSpans,
};
const response = await axios.post<GetTraceV2SuccessResponse>(
`/traces/waterfall/${props.traceId}`,
omit(postData, 'traceId'),
);

return {
statusCode: 200,
error: null,
message: 'Success',
payload: response.data,
};
} catch (error) {
return ErrorResponseHandler(error as AxiosError);
}
};

export default getTraceV2;
134 changes: 134 additions & 0 deletions frontend/src/components/DetailsDrawer/DetailsDrawer.styles.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
.details-drawer {
.ant-drawer-wrapper-body {
border-left: 1px solid var(--bg-slate-500);
}
.ant-drawer-header {
background: var(--bg-ink-400);
border-bottom: 1px solid var(--bg-slate-500);

.ant-drawer-header-title {
display: flex;
align-items: center;

.ant-drawer-close {
margin-inline-end: 0px;
padding: 0px;
padding-right: 16px;
border-right: 1px solid var(--bg-slate-500);
}

.ant-drawer-title {
padding-left: 16px;
color: var(--bg-vanilla-400);
font-family: Inter;
font-size: 14px;
font-style: normal;
font-weight: 400;
line-height: 20px; /* 142.857% */
letter-spacing: -0.07px;
}
}
}
.ant-drawer-body {
padding: 16px;
background: var(--bg-ink-400);

&::-webkit-scrollbar {
width: 0.1rem;
}
}

.details-drawer-tabs {
margin-top: 32px;

.ant-tabs-tab {
display: flex;
align-items: center;
justify-content: center;
width: 114px;
height: 32px;
flex-shrink: 0;
padding: 7px 20px;
border-radius: 2px 0px 0px 2px;
border: 1px solid var(--bg-slate-400);
background: var(--bg-ink-400);
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);

color: #fff;
font-family: Inter;
font-size: 12px;
font-style: normal;
font-weight: 400;
line-height: 18px; /* 150% */
letter-spacing: -0.06px;

.ant-btn {
display: flex;
align-items: center;
justify-content: center;
padding: 0px;
}

.ant-btn:hover {
background: unset;
}
}

.ant-tabs-tab-active {
background: var(--bg-slate-400);
}

.ant-tabs-tab + .ant-tabs-tab {
margin-left: 0px;
}

.ant-tabs-nav::before {
border-bottom: 0px;
}

.ant-tabs-ink-bar {
background: none;
}
}
}

.lightMode {
.details-drawer {
.ant-drawer-wrapper-body {
border-left: 1px solid var(--bg-vanilla-300);
}
.ant-drawer-header {
background: var(--bg-vanilla-200);
border-bottom: 1px solid var(--bg-vanilla-300);

.ant-drawer-header-title {
.ant-drawer-close {
border-right: 1px solid var(--bg-vanilla-300);
}

.ant-drawer-title {
color: var(--bg-ink-400);
}
}
}
.ant-drawer-body {
background: var(--bg-vanilla-200);
}

.details-drawer-tabs {
.ant-tabs-tab {
border: 1px solid var(--bg-vanilla-300);
background: var(--bg-vanilla-300);
color: var(--bg-ink-400);
}

.ant-tabs-tab-active {
background: var(--bg-vanilla-200);
}

.ant-tabs-tab + .ant-tabs-tab {
border-left: none;
}
}
}
}
57 changes: 57 additions & 0 deletions frontend/src/components/DetailsDrawer/DetailsDrawer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import './DetailsDrawer.styles.scss';

import { Drawer, Tabs, TabsProps } from 'antd';
import cx from 'classnames';
import { Dispatch, SetStateAction } from 'react';

interface IDetailsDrawerProps {
open: boolean;
setOpen: Dispatch<SetStateAction<boolean>>;
title: string;
descriptiveContent: JSX.Element;
defaultActiveKey: string;
items: TabsProps['items'];
detailsDrawerClassName?: string;
tabBarExtraContent?: JSX.Element;
}

function DetailsDrawer(props: IDetailsDrawerProps): JSX.Element {
const {
open,
setOpen,
title,
descriptiveContent,
defaultActiveKey,
detailsDrawerClassName,
items,
tabBarExtraContent,
} = props;
return (
<Drawer
width="60%"
open={open}
afterOpenChange={setOpen}
mask={false}
title={title}
onClose={(): void => setOpen(false)}
className="details-drawer"
>
<div>{descriptiveContent}</div>
<Tabs
items={items}
addIcon
defaultActiveKey={defaultActiveKey}
animated
className={cx('details-drawer-tabs', detailsDrawerClassName)}
tabBarExtraContent={tabBarExtraContent}
/>
</Drawer>
);
}

DetailsDrawer.defaultProps = {
detailsDrawerClassName: '',
tabBarExtraContent: null,
};

export default DetailsDrawer;
Loading
Loading