+
+
+
+
+ {podName && (
+
+
+
+ Pod
+
+
+ )}
+
+ {/* TODO(Rahul): Make a common config driven component for this and other infra metrics components */}
+ {selectedView === VIEW_TYPES.NODE && (
+
+ )}
+ {selectedView === VIEW_TYPES.POD && podName && (
+
+ )}
+
+ );
+}
+
+export default InfraMetrics;
diff --git a/frontend/src/container/LogDetailedView/InfraMetrics/NodeMetrics.tsx b/frontend/src/container/LogDetailedView/InfraMetrics/NodeMetrics.tsx
new file mode 100644
index 0000000000..3c935c8b89
--- /dev/null
+++ b/frontend/src/container/LogDetailedView/InfraMetrics/NodeMetrics.tsx
@@ -0,0 +1,140 @@
+import { Card, Col, Row, Skeleton, Typography } from 'antd';
+import cx from 'classnames';
+import Uplot from 'components/Uplot';
+import { ENTITY_VERSION_V4 } from 'constants/app';
+import dayjs from 'dayjs';
+import { useIsDarkMode } from 'hooks/useDarkMode';
+import { useResizeObserver } from 'hooks/useDimensions';
+import { GetMetricQueryRange } from 'lib/dashboard/getQueryResults';
+import { getUPlotChartOptions } from 'lib/uPlotLib/getUplotChartOptions';
+import { getUPlotChartData } from 'lib/uPlotLib/utils/getUplotChartData';
+import { useMemo, useRef } from 'react';
+import { useQueries, UseQueryResult } from 'react-query';
+import { SuccessResponse } from 'types/api';
+import { MetricRangePayloadProps } from 'types/api/metrics/getQueryRange';
+
+import {
+ getHostQueryPayload,
+ getNodeQueryPayload,
+ hostWidgetInfo,
+ nodeWidgetInfo,
+} from './constants';
+
+function NodeMetrics({
+ nodeName,
+ clusterName,
+ hostName,
+ logLineTimestamp,
+}: {
+ nodeName: string;
+ clusterName: string;
+ hostName: string;
+ logLineTimestamp: string;
+}): JSX.Element {
+ const { start, end, verticalLineTimestamp } = useMemo(() => {
+ const logTimestamp = dayjs(logLineTimestamp);
+ const now = dayjs();
+ const startTime = logTimestamp.subtract(3, 'hour');
+
+ const endTime = logTimestamp.add(3, 'hour').isBefore(now)
+ ? logTimestamp.add(3, 'hour')
+ : now;
+
+ return {
+ start: startTime.unix(),
+ end: endTime.unix(),
+ verticalLineTimestamp: logTimestamp.unix(),
+ };
+ }, [logLineTimestamp]);
+
+ const queryPayloads = useMemo(() => {
+ if (nodeName) {
+ return getNodeQueryPayload(clusterName, nodeName, start, end);
+ }
+ return getHostQueryPayload(hostName, start, end);
+ }, [nodeName, hostName, clusterName, start, end]);
+
+ const widgetInfo = nodeName ? nodeWidgetInfo : hostWidgetInfo;
+ const queries = useQueries(
+ queryPayloads.map((payload) => ({
+ queryKey: ['metrics', payload, ENTITY_VERSION_V4, 'NODE'],
+ queryFn: (): Promise