Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

feat(infrastructure-monitoring-v2): pod status/counts & couple more fixes (#12127)

Vinicius Lourençof24102c0dbb2
diff --git a/frontend/src/container/InfraMonitoringHostsV2/utils.tsx b/frontend/src/container/InfraMonitoringHostsV2/utils.tsx
index 1de1405b0c..aa6286a1c9 100644
--- a/frontend/src/container/InfraMonitoringHostsV2/utils.tsx
+++ b/frontend/src/container/InfraMonitoringHostsV2/utils.tsx
@@ -11,8 +11,6 @@ import { INFRA_MONITORING_ATTR_KEYS } from 'container/InfraMonitoringK8sV2/const
import { CellValueTooltip } from 'container/InfraMonitoringK8sV2/components';
import { DataTypes } from 'types/api/queryBuilder/queryAutocompleteResponse';
import { DataSource } from 'types/common/queryBuilder';
-import TanStackTable from 'components/TanStackTableView';
-
const HOSTNAME_DOCS_URL =
'https://signoz.io/docs/infrastructure-monitoring/hostmetrics/#host-name-is-blankempty';
@@ -23,11 +21,7 @@ export function HostnameCell({
}): React.ReactElement {
const isEmpty = !hostName || !hostName.trim();
if (!isEmpty) {
- return (
- <CellValueTooltip value={hostName}>
- <TanStackTable.Text>{hostName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={hostName} />;
}
return (
<>
diff --git a/frontend/src/container/InfraMonitoringK8sV2/Base/ColumnHeader.module.scss b/frontend/src/container/InfraMonitoringK8sV2/Base/ColumnHeader.module.scss
index 70d3c1d2df..bd75bc5ebc 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/Base/ColumnHeader.module.scss
+++ b/frontend/src/container/InfraMonitoringK8sV2/Base/ColumnHeader.module.scss
@@ -11,6 +11,6 @@
}
.columnHeaderLabel {
- text-align: center;
+ text-align: left;
padding: var(--spacing-2) var(--spacing-2) var(--spacing-2) 0px;
}
diff --git a/frontend/src/container/InfraMonitoringK8sV2/Clusters/table.config.tsx b/frontend/src/container/InfraMonitoringK8sV2/Clusters/table.config.tsx
index 722239c86b..57f50d36c1 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/Clusters/table.config.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/Clusters/table.config.tsx
@@ -8,7 +8,7 @@ import { ExpandButtonWrapper } from 'container/InfraMonitoringK8sV2/components';
import ColumnHeader from '../Base/ColumnHeader';
import EntityGroupHeader from '../Base/EntityGroupHeader';
import K8sGroupCell from '../Base/K8sGroupCell';
-import { formatBytes, getPodPhaseStatusItems } from '../commonUtils';
+import { formatBytes, getPodStatusItems } from '../commonUtils';
import {
CellValueTooltip,
GroupedStatusCounts,
@@ -77,11 +77,7 @@ export const k8sClustersColumnsConfig: ClusterTableColumnConfig[] = [
visibilityBehavior: 'hidden-on-expand',
cell: ({ value }): React.ReactNode => {
const clusterName = value as string;
- return (
- <CellValueTooltip value={clusterName}>
- <TanStackTable.Text>{clusterName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={clusterName} />;
},
},
{
@@ -121,23 +117,25 @@ export const k8sClustersColumnsConfig: ClusterTableColumnConfig[] = [
},
},
{
- id: 'podCountsByPhase',
+ id: 'podCountsByStatus',
header: (): React.ReactNode => (
- <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/clusters#pod-counts-by-phase">
- Pod Phases
+ <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/clusters#pod-counts-by-status">
+ Pod Status
</ColumnHeader>
),
- accessorFn: (row): InframonitoringtypesClusterRecordDTO['podCountsByPhase'] =>
- row.podCountsByPhase,
+ accessorFn: (
+ row,
+ ): InframonitoringtypesClusterRecordDTO['podCountsByStatus'] =>
+ row.podCountsByStatus,
width: { min: 250 },
enableSort: false,
cell: ({ row }): React.ReactNode => {
- const podCountsByPhase = row.podCountsByPhase;
- if (!podCountsByPhase) {
+ const podCountsByStatus = row.podCountsByStatus;
+ if (!podCountsByStatus) {
return <TanStackTable.Text>-</TanStackTable.Text>;
}
return (
- <GroupedStatusCounts items={getPodPhaseStatusItems(row.podCountsByPhase)} />
+ <GroupedStatusCounts items={getPodStatusItems(row.podCountsByStatus)} />
);
},
},
diff --git a/frontend/src/container/InfraMonitoringK8sV2/DaemonSets/table.config.tsx b/frontend/src/container/InfraMonitoringK8sV2/DaemonSets/table.config.tsx
index 6591e85dc0..21ddab5485 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/DaemonSets/table.config.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/DaemonSets/table.config.tsx
@@ -7,7 +7,7 @@ import ColumnHeader from '../Base/ColumnHeader';
import EntityGroupHeader from '../Base/EntityGroupHeader';
import K8sGroupCell from '../Base/K8sGroupCell';
import { SelectedItemParams } from '../hooks';
-import { formatBytes, getPodPhaseStatusItems } from '../commonUtils';
+import { formatBytes, getPodStatusItems } from '../commonUtils';
import {
CellValueTooltip,
EntityProgressBar,
@@ -87,11 +87,7 @@ export const k8sDaemonSetsColumnsConfig: DaemonSetTableColumnConfig[] = [
visibilityBehavior: 'hidden-on-expand',
cell: ({ value }): React.ReactNode => {
const daemonsetName = value as string;
- return (
- <CellValueTooltip value={daemonsetName}>
- <TanStackTable.Text>{daemonsetName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={daemonsetName} />;
},
},
{
@@ -108,35 +104,29 @@ export const k8sDaemonSetsColumnsConfig: DaemonSetTableColumnConfig[] = [
enableResize: true,
cell: ({ value }): React.ReactNode => {
const namespaceName = value as string;
- return (
- <CellValueTooltip value={namespaceName}>
- <TanStackTable.Text>{namespaceName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={namespaceName} />;
},
},
{
- id: 'pod_counts_by_phase',
+ id: 'pod_counts_by_status',
header: (): React.ReactNode => (
- <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/daemonsets#pod-counts-by-phase">
- Pod Phases
+ <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/daemonsets#pod-counts-by-status">
+ Pod Status
</ColumnHeader>
),
accessorFn: (
row,
- ): InframonitoringtypesDaemonSetRecordDTO['podCountsByPhase'] =>
- row.podCountsByPhase,
+ ): InframonitoringtypesDaemonSetRecordDTO['podCountsByStatus'] =>
+ row.podCountsByStatus,
width: { min: 250 },
enableSort: false,
enableResize: true,
cell: ({ row }): React.ReactNode => {
- const podCountsByPhase = row.podCountsByPhase;
- if (!podCountsByPhase) {
+ const podCountsByStatus = row.podCountsByStatus;
+ if (!podCountsByStatus) {
return <TanStackTable.Text>-</TanStackTable.Text>;
}
- return (
- <GroupedStatusCounts items={getPodPhaseStatusItems(podCountsByPhase)} />
- );
+ return <GroupedStatusCounts items={getPodStatusItems(podCountsByStatus)} />;
},
},
{
diff --git a/frontend/src/container/InfraMonitoringK8sV2/Deployments/table.config.tsx b/frontend/src/container/InfraMonitoringK8sV2/Deployments/table.config.tsx
index 061696cf2a..6c2b6638f2 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/Deployments/table.config.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/Deployments/table.config.tsx
@@ -7,7 +7,7 @@ import ColumnHeader from '../Base/ColumnHeader';
import EntityGroupHeader from '../Base/EntityGroupHeader';
import K8sGroupCell from '../Base/K8sGroupCell';
import { SelectedItemParams } from '../hooks';
-import { formatBytes, getPodPhaseStatusItems } from '../commonUtils';
+import { formatBytes, getPodStatusItems } from '../commonUtils';
import {
CellValueTooltip,
EntityProgressBar,
@@ -88,11 +88,7 @@ export const k8sDeploymentsColumnsConfig: TableColumnDef<InframonitoringtypesDep
visibilityBehavior: 'hidden-on-expand',
cell: ({ value }): React.ReactNode => {
const deploymentName = value as string;
- return (
- <CellValueTooltip value={deploymentName}>
- <TanStackTable.Text>{deploymentName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={deploymentName} />;
},
},
{
@@ -112,24 +108,22 @@ export const k8sDeploymentsColumnsConfig: TableColumnDef<InframonitoringtypesDep
),
},
{
- id: 'podCountsByPhase',
+ id: 'podCountsByStatus',
header: (): React.ReactNode => (
- <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/deployments#pod-counts-by-phase">
- Pod Phases
+ <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/deployments#pod-counts-by-status">
+ Pod Status
</ColumnHeader>
),
- accessorFn: (row): object | undefined => row.podCountsByPhase,
+ accessorFn: (row): object | undefined => row.podCountsByStatus,
width: { min: 250 },
enableSort: false,
enableResize: true,
cell: ({ row }): React.ReactNode => {
- const podCountsByPhase = row.podCountsByPhase;
- if (!podCountsByPhase) {
+ const podCountsByStatus = row.podCountsByStatus;
+ if (!podCountsByStatus) {
return <TanStackTable.Text>-</TanStackTable.Text>;
}
- return (
- <GroupedStatusCounts items={getPodPhaseStatusItems(podCountsByPhase)} />
- );
+ return <GroupedStatusCounts items={getPodStatusItems(podCountsByStatus)} />;
},
},
{
diff --git a/frontend/src/container/InfraMonitoringK8sV2/EntityDetailsUtils/EntityTraces/__tests__/EntityTraces.table.test.tsx b/frontend/src/container/InfraMonitoringK8sV2/EntityDetailsUtils/EntityTraces/__tests__/EntityTraces.table.test.tsx
index 8c619bba7e..247e6b7d45 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/EntityDetailsUtils/EntityTraces/__tests__/EntityTraces.table.test.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/EntityDetailsUtils/EntityTraces/__tests__/EntityTraces.table.test.tsx
@@ -87,7 +87,7 @@ describe('EntityTraces - Table Rendering', () => {
expect(badge).toHaveAttribute('data-variant', 'outline');
});
- it('should render N/A when http method is empty', async () => {
+ it('should render - when http method is empty', async () => {
mockQueryRangeV5WithTracesResponse({
customTraces: [{ httpMethod: '', responseStatusCode: '200' }],
});
@@ -96,7 +96,7 @@ describe('EntityTraces - Table Rendering', () => {
renderEntityTraces();
});
- await expect(screen.findByText('N/A')).resolves.toBeInTheDocument();
+ await expect(screen.findByText('-')).resolves.toBeInTheDocument();
expect(screen.queryByTestId('httpMethod')).not.toBeInTheDocument();
});
diff --git a/frontend/src/container/InfraMonitoringK8sV2/EntityDetailsUtils/EntityTraces/traceListColumns.module.scss b/frontend/src/container/InfraMonitoringK8sV2/EntityDetailsUtils/EntityTraces/traceListColumns.module.scss
index d562010691..0de6ffc3af 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/EntityDetailsUtils/EntityTraces/traceListColumns.module.scss
+++ b/frontend/src/container/InfraMonitoringK8sV2/EntityDetailsUtils/EntityTraces/traceListColumns.module.scss
@@ -4,4 +4,8 @@
.cellText {
color: var(--l2-foreground);
+
+ &[data-novalue='true'] {
+ opacity: 0.6;
+ }
}
diff --git a/frontend/src/container/InfraMonitoringK8sV2/EntityDetailsUtils/EntityTraces/traceListColumns.tsx b/frontend/src/container/InfraMonitoringK8sV2/EntityDetailsUtils/EntityTraces/traceListColumns.tsx
index fc8c3297ce..a94ed73911 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/EntityDetailsUtils/EntityTraces/traceListColumns.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/EntityDetailsUtils/EntityTraces/traceListColumns.tsx
@@ -89,8 +89,12 @@ export const getTraceListColumns = (
if (value === '') {
return (
<BlockLink to={getTraceLink(itemData)} openInNewTab>
- <Typography data-testid={key} className={styles.cellText}>
- N/A
+ <Typography
+ data-testid={key}
+ className={styles.cellText}
+ data-novalue="true"
+ >
+ -
</Typography>
</BlockLink>
);
@@ -102,7 +106,9 @@ export const getTraceListColumns = (
if (!httpMethod) {
return (
<BlockLink to={getTraceLink(itemData)} openInNewTab>
- <Typography className={styles.cellText}>N/A</Typography>
+ <Typography className={styles.cellText} data-novalue="true">
+ -
+ </Typography>
</BlockLink>
);
}
@@ -129,8 +135,11 @@ export const getTraceListColumns = (
if (!isValidCode) {
return (
<BlockLink to={getTraceLink(itemData)} openInNewTab>
- <Typography className={styles.cellText}>
- {numericCode === 0 || !statusCode ? 'N/A' : statusCode}
+ <Typography
+ className={styles.cellText}
+ data-novalue={numericCode === 0 || !statusCode}
+ >
+ {numericCode === 0 || !statusCode ? '-' : statusCode}
</Typography>
</BlockLink>
);
diff --git a/frontend/src/container/InfraMonitoringK8sV2/Jobs/table.config.tsx b/frontend/src/container/InfraMonitoringK8sV2/Jobs/table.config.tsx
index 3c84b3c5ea..5d603f5f3c 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/Jobs/table.config.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/Jobs/table.config.tsx
@@ -7,7 +7,7 @@ import ColumnHeader from '../Base/ColumnHeader';
import EntityGroupHeader from '../Base/EntityGroupHeader';
import K8sGroupCell from '../Base/K8sGroupCell';
import { SelectedItemParams } from '../hooks';
-import { formatBytes, getPodPhaseStatusItems } from '../commonUtils';
+import { formatBytes, getPodStatusItems } from '../commonUtils';
import {
CellValueTooltip,
EntityProgressBar,
@@ -81,11 +81,7 @@ export const k8sJobsColumnsConfig: JobTableColumnConfig[] = [
visibilityBehavior: 'hidden-on-expand',
cell: ({ value }): React.ReactNode => {
const jobName = value as string;
- return (
- <CellValueTooltip value={jobName}>
- <TanStackTable.Text>{jobName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={jobName} />;
},
},
{
@@ -102,33 +98,27 @@ export const k8sJobsColumnsConfig: JobTableColumnConfig[] = [
enableResize: true,
cell: ({ value }): React.ReactNode => {
const namespaceName = value as string;
- return (
- <CellValueTooltip value={namespaceName}>
- <TanStackTable.Text>{namespaceName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={namespaceName} />;
},
},
{
- id: 'pod_counts_by_phase',
+ id: 'pod_counts_by_status',
header: (): React.ReactNode => (
- <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/jobs#pod-counts-by-phase">
- Pod Phases
+ <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/jobs#pod-counts-by-status">
+ Pod Status
</ColumnHeader>
),
- accessorFn: (row): InframonitoringtypesJobRecordDTO['podCountsByPhase'] =>
- row.podCountsByPhase,
+ accessorFn: (row): InframonitoringtypesJobRecordDTO['podCountsByStatus'] =>
+ row.podCountsByStatus,
width: { min: 250 },
enableSort: false,
enableResize: true,
cell: ({ row }): React.ReactNode => {
- const podCountsByPhase = row.podCountsByPhase;
- if (!podCountsByPhase) {
+ const podCountsByStatus = row.podCountsByStatus;
+ if (!podCountsByStatus) {
return <TanStackTable.Text>-</TanStackTable.Text>;
}
- return (
- <GroupedStatusCounts items={getPodPhaseStatusItems(podCountsByPhase)} />
- );
+ return <GroupedStatusCounts items={getPodStatusItems(podCountsByStatus)} />;
},
},
{
diff --git a/frontend/src/container/InfraMonitoringK8sV2/Namespaces/table.config.tsx b/frontend/src/container/InfraMonitoringK8sV2/Namespaces/table.config.tsx
index a59fc792ae..8cb2750538 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/Namespaces/table.config.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/Namespaces/table.config.tsx
@@ -6,7 +6,7 @@ import { ExpandButtonWrapper } from 'container/InfraMonitoringK8sV2/components';
import ColumnHeader from '../Base/ColumnHeader';
import EntityGroupHeader from '../Base/EntityGroupHeader';
import K8sGroupCell from '../Base/K8sGroupCell';
-import { formatBytes, getPodPhaseStatusItems } from '../commonUtils';
+import { formatBytes, getPodStatusItems } from '../commonUtils';
import {
CellValueTooltip,
GroupedStatusCounts,
@@ -83,11 +83,7 @@ export const k8sNamespacesColumnsConfig: NamespaceTableColumnConfig[] = [
visibilityBehavior: 'hidden-on-expand',
cell: ({ value }): React.ReactNode => {
const namespaceName = value as string;
- return (
- <CellValueTooltip value={namespaceName}>
- <TanStackTable.Text>{namespaceName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={namespaceName} />;
},
},
{
@@ -106,25 +102,25 @@ export const k8sNamespacesColumnsConfig: NamespaceTableColumnConfig[] = [
),
},
{
- id: 'podCountsByPhase',
+ id: 'podCountsByStatus',
header: (): React.ReactNode => (
- <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/namespaces#pod-counts-by-phase">
- Pod Phases
+ <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/namespaces#pod-counts-by-status">
+ Pod Status
</ColumnHeader>
),
accessorFn: (
row,
- ): InframonitoringtypesNamespaceRecordDTO['podCountsByPhase'] =>
- row.podCountsByPhase,
+ ): InframonitoringtypesNamespaceRecordDTO['podCountsByStatus'] =>
+ row.podCountsByStatus,
width: { min: 250 },
enableSort: false,
cell: ({ row }): React.ReactNode => {
- const podCountsByPhase = row.podCountsByPhase;
- if (!podCountsByPhase) {
+ const podCountsByStatus = row.podCountsByStatus;
+ if (!podCountsByStatus) {
return <TanStackTable.Text>-</TanStackTable.Text>;
}
return (
- <GroupedStatusCounts items={getPodPhaseStatusItems(row.podCountsByPhase)} />
+ <GroupedStatusCounts items={getPodStatusItems(row.podCountsByStatus)} />
);
},
},
diff --git a/frontend/src/container/InfraMonitoringK8sV2/Nodes/table.config.tsx b/frontend/src/container/InfraMonitoringK8sV2/Nodes/table.config.tsx
index 292e5ecf9f..65c1239ac8 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/Nodes/table.config.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/Nodes/table.config.tsx
@@ -7,7 +7,7 @@ import { ExpandButtonWrapper } from 'container/InfraMonitoringK8sV2/components';
import ColumnHeader from '../Base/ColumnHeader';
import EntityGroupHeader from '../Base/EntityGroupHeader';
import K8sGroupCell from '../Base/K8sGroupCell';
-import { formatBytes, getPodPhaseStatusItems } from '../commonUtils';
+import { formatBytes, getPodStatusItems } from '../commonUtils';
import { INFRA_MONITORING_ATTR_KEYS } from '../constants';
import {
CellValueTooltip,
@@ -85,11 +85,7 @@ export const k8sNodesColumnsConfig: NodeTableColumnConfig[] = [
visibilityBehavior: 'hidden-on-expand',
cell: ({ value }): React.ReactNode => {
const nodeName = value as string;
- return (
- <CellValueTooltip value={nodeName}>
- <TanStackTable.Text>{nodeName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={nodeName} />;
},
},
{
@@ -132,23 +128,23 @@ export const k8sNodesColumnsConfig: NodeTableColumnConfig[] = [
},
},
{
- id: 'podCountsByPhase',
+ id: 'podCountsByStatus',
header: (): React.ReactNode => (
- <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/nodes#pod-counts-by-phase">
- Pod Phases
+ <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/nodes#pod-counts-by-status">
+ Pod Status
</ColumnHeader>
),
- accessorFn: (row): InframonitoringtypesNodeRecordDTO['podCountsByPhase'] =>
- row.podCountsByPhase,
+ accessorFn: (row): InframonitoringtypesNodeRecordDTO['podCountsByStatus'] =>
+ row.podCountsByStatus,
width: { min: 250 },
enableSort: false,
cell: ({ row }): React.ReactNode => {
- const podCountsByPhase = row.podCountsByPhase;
- if (!podCountsByPhase) {
+ const podCountsByStatus = row.podCountsByStatus;
+ if (!podCountsByStatus) {
return <TanStackTable.Text>-</TanStackTable.Text>;
}
return (
- <GroupedStatusCounts items={getPodPhaseStatusItems(row.podCountsByPhase)} />
+ <GroupedStatusCounts items={getPodStatusItems(row.podCountsByStatus)} />
);
},
},
diff --git a/frontend/src/container/InfraMonitoringK8sV2/Pods/table.config.tsx b/frontend/src/container/InfraMonitoringK8sV2/Pods/table.config.tsx
index 445de5a425..4f8d7214f5 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/Pods/table.config.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/Pods/table.config.tsx
@@ -1,9 +1,9 @@
import { Container } from '@signozhq/icons';
-import { Badge, BadgeColor } from '@signozhq/ui/badge';
+import { Badge } from '@signozhq/ui/badge';
import { TooltipSimple } from '@signozhq/ui/tooltip';
import {
- InframonitoringtypesPodPhaseDTO,
InframonitoringtypesPodRecordDTO,
+ InframonitoringtypesPodStatusDTO,
} from 'api/generated/services/sigNoz.schemas';
import TanStackTable, { TableColumnDef } from 'components/TanStackTableView';
import { ExpandButtonWrapper } from 'container/InfraMonitoringK8sV2/components';
@@ -11,7 +11,11 @@ import { ExpandButtonWrapper } from 'container/InfraMonitoringK8sV2/components';
import ColumnHeader from '../Base/ColumnHeader';
import EntityGroupHeader from '../Base/EntityGroupHeader';
import K8sGroupCell from '../Base/K8sGroupCell';
-import { formatBytes, getPodPhaseStatusItems } from '../commonUtils';
+import {
+ formatBytes,
+ getPodStatusItems,
+ POD_STATUS_COLORS,
+} from '../commonUtils';
import {
CellValueTooltip,
EntityProgressBar,
@@ -40,15 +44,6 @@ export function getK8sPodItemKey(
return pod.podUID;
}
-const POD_PHASE_COLORS: Record<string, BadgeColor> = {
- running: 'forest',
- pending: 'amber',
- succeeded: 'robin',
- failed: 'cherry',
- unknown: 'vanilla',
- no_data: 'vanilla',
-};
-
export type PodTableColumnConfig =
TableColumnDef<InframonitoringtypesPodRecordDTO>;
export const k8sPodColumnsConfig: PodTableColumnConfig[] = [
@@ -93,34 +88,30 @@ export const k8sPodColumnsConfig: PodTableColumnConfig[] = [
visibilityBehavior: 'hidden-on-expand',
cell: ({ value }): React.ReactNode => {
const podName = value as string;
- return (
- <CellValueTooltip value={podName}>
- <TanStackTable.Text>{podName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={podName} />;
},
},
{
- id: 'podPhase',
+ id: 'podStatus',
header: (): React.ReactNode => (
- <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/pods#pod-phase">
- Phase
+ <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/pods#pod-status">
+ Status
</ColumnHeader>
),
- accessorFn: (row): string => row.podPhase,
- width: { min: 120 },
+ accessorFn: (row): string => row.podStatus,
+ width: { min: 160 },
enableSort: false,
visibilityBehavior: 'hidden-on-expand',
cell: ({ row }): React.ReactNode => {
- if (!row.podPhase) {
+ if (!row.podStatus) {
return <></>;
}
- const color = POD_PHASE_COLORS[row.podPhase] || POD_PHASE_COLORS.unknown;
+ const color = POD_STATUS_COLORS[row.podStatus] || POD_STATUS_COLORS.unknown;
const label =
- row.podPhase === InframonitoringtypesPodPhaseDTO.no_data
+ row.podStatus === InframonitoringtypesPodStatusDTO.no_data
? 'No Data'
- : row.podPhase.charAt(0).toUpperCase() + row.podPhase.slice(1);
+ : row.podStatus.charAt(0).toUpperCase() + row.podStatus.slice(1);
return (
<Badge color={color} variant="outline">
{label}
@@ -129,24 +120,24 @@ export const k8sPodColumnsConfig: PodTableColumnConfig[] = [
},
},
{
- id: 'podCountsByPhase',
+ id: 'podCountsByStatus',
header: (): React.ReactNode => (
- <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/pods#pod-phase">
- Phases
+ <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/pods#pod-status">
+ Status
</ColumnHeader>
),
- accessorFn: (row): InframonitoringtypesPodRecordDTO['podCountsByPhase'] =>
- row.podCountsByPhase,
+ accessorFn: (row): InframonitoringtypesPodRecordDTO['podCountsByStatus'] =>
+ row.podCountsByStatus,
width: { min: 250 },
enableSort: false,
visibilityBehavior: 'hidden-on-collapse',
cell: ({ row }): React.ReactNode => {
- const podCountsByPhase = row.podCountsByPhase;
- if (!podCountsByPhase) {
+ const podCountsByStatus = row.podCountsByStatus;
+ if (!podCountsByStatus) {
return <TanStackTable.Text>-</TanStackTable.Text>;
}
return (
- <GroupedStatusCounts items={getPodPhaseStatusItems(row.podCountsByPhase)} />
+ <GroupedStatusCounts items={getPodStatusItems(row.podCountsByStatus)} />
);
},
},
@@ -172,6 +163,28 @@ export const k8sPodColumnsConfig: PodTableColumnConfig[] = [
return <TanStackTable.Text>{formatAge(age)}</TanStackTable.Text>;
},
},
+ {
+ id: 'podRestarts',
+ header: (): React.ReactNode => (
+ <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/pods#restarts">
+ Restarts
+ </ColumnHeader>
+ ),
+ accessorFn: (row): number => row.podRestarts,
+ width: { min: 100 },
+ enableSort: true,
+ cell: ({ value }): React.ReactNode => {
+ const restarts = value as number;
+ if (restarts === -1) {
+ return (
+ <TooltipSimple title="No data">
+ <Typography.Text>-</Typography.Text>
+ </TooltipSimple>
+ );
+ }
+ return <TanStackTable.Text>{restarts}</TanStackTable.Text>;
+ },
+ },
{
id: 'cpu_request',
header: (): React.ReactNode => (
diff --git a/frontend/src/container/InfraMonitoringK8sV2/StatefulSets/table.config.tsx b/frontend/src/container/InfraMonitoringK8sV2/StatefulSets/table.config.tsx
index bf4b15e45c..e28efcfa9c 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/StatefulSets/table.config.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/StatefulSets/table.config.tsx
@@ -7,7 +7,7 @@ import ColumnHeader from '../Base/ColumnHeader';
import EntityGroupHeader from '../Base/EntityGroupHeader';
import K8sGroupCell from '../Base/K8sGroupCell';
import { SelectedItemParams } from '../hooks';
-import { formatBytes, getPodPhaseStatusItems } from '../commonUtils';
+import { formatBytes, getPodStatusItems } from '../commonUtils';
import {
CellValueTooltip,
EntityProgressBar,
@@ -88,11 +88,7 @@ export const k8sStatefulSetsColumnsConfig: TableColumnDef<InframonitoringtypesSt
visibilityBehavior: 'hidden-on-expand',
cell: ({ value }): React.ReactNode => {
const statefulsetName = value as string;
- return (
- <CellValueTooltip value={statefulsetName}>
- <TanStackTable.Text>{statefulsetName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={statefulsetName} />;
},
},
{
@@ -109,35 +105,29 @@ export const k8sStatefulSetsColumnsConfig: TableColumnDef<InframonitoringtypesSt
enableResize: true,
cell: ({ value }): React.ReactNode => {
const namespaceName = value as string;
- return (
- <CellValueTooltip value={namespaceName}>
- <TanStackTable.Text>{namespaceName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={namespaceName} />;
},
},
{
- id: 'pod_counts_by_phase',
+ id: 'pod_counts_by_status',
header: (): React.ReactNode => (
- <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/statefulsets#pod-counts-by-phase">
- Pod Phases
+ <ColumnHeader docPath="/infrastructure-monitoring/kubernetes/statefulsets#pod-counts-by-status">
+ Pod Status
</ColumnHeader>
),
accessorFn: (
row,
- ): InframonitoringtypesStatefulSetRecordDTO['podCountsByPhase'] =>
- row.podCountsByPhase,
+ ): InframonitoringtypesStatefulSetRecordDTO['podCountsByStatus'] =>
+ row.podCountsByStatus,
width: { min: 250 },
enableSort: false,
enableResize: true,
cell: ({ row }): React.ReactNode => {
- const podCountsByPhase = row.podCountsByPhase;
- if (!podCountsByPhase) {
+ const podCountsByStatus = row.podCountsByStatus;
+ if (!podCountsByStatus) {
return <TanStackTable.Text>-</TanStackTable.Text>;
}
- return (
- <GroupedStatusCounts items={getPodPhaseStatusItems(podCountsByPhase)} />
- );
+ return <GroupedStatusCounts items={getPodStatusItems(podCountsByStatus)} />;
},
},
{
diff --git a/frontend/src/container/InfraMonitoringK8sV2/Volumes/table.config.tsx b/frontend/src/container/InfraMonitoringK8sV2/Volumes/table.config.tsx
index 0c4d76d047..088d2a11fc 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/Volumes/table.config.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/Volumes/table.config.tsx
@@ -81,11 +81,7 @@ export const k8sVolumesColumnsConfig: VolumeTableColumnConfig[] = [
visibilityBehavior: 'hidden-on-expand',
cell: ({ value }): React.ReactNode => {
const pvcName = value as string;
- return (
- <CellValueTooltip value={pvcName}>
- <TanStackTable.Text>{pvcName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={pvcName} />;
},
},
{
@@ -101,11 +97,7 @@ export const k8sVolumesColumnsConfig: VolumeTableColumnConfig[] = [
enableSort: false,
cell: ({ value }): React.ReactNode => {
const namespaceName = value as string;
- return (
- <CellValueTooltip value={namespaceName}>
- <TanStackTable.Text>{namespaceName}</TanStackTable.Text>
- </CellValueTooltip>
- );
+ return <CellValueTooltip value={namespaceName} />;
},
},
{
diff --git a/frontend/src/container/InfraMonitoringK8sV2/commonUtils.tsx b/frontend/src/container/InfraMonitoringK8sV2/commonUtils.tsx
index 0940792e71..1c98deb901 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/commonUtils.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/commonUtils.tsx
@@ -1,5 +1,9 @@
import { Color } from '@signozhq/design-tokens';
-import { InframonitoringtypesPodCountsByPhaseDTO } from 'api/generated/services/sigNoz.schemas';
+import { BadgeColor } from '@signozhq/ui/badge';
+import {
+ InframonitoringtypesPodCountsByStatusDTO,
+ InframonitoringtypesPodStatusDTO,
+} from 'api/generated/services/sigNoz.schemas';
import { StatusCountItem } from './components/GroupedStatusCounts';
@@ -64,17 +68,106 @@ export function getStrokeColorForLimitUtilization(value: number): string {
return Color.BG_SAKURA_500;
}
-/**
- * Builds StatusCountItem[] for GroupedStatusCounts from pod phase counts.
- */
-export function getPodPhaseStatusItems(
- counts: InframonitoringtypesPodCountsByPhaseDTO,
+export const POD_STATUS_COLORS: Record<
+ InframonitoringtypesPodStatusDTO,
+ BadgeColor
+> = {
+ [InframonitoringtypesPodStatusDTO.running]: 'forest',
+ [InframonitoringtypesPodStatusDTO.completed]: 'robin',
+ [InframonitoringtypesPodStatusDTO.pending]: 'amber',
+ [InframonitoringtypesPodStatusDTO.unknown]: 'vanilla',
+ [InframonitoringtypesPodStatusDTO.no_data]: 'vanilla',
+ [InframonitoringtypesPodStatusDTO.failed]: 'cherry',
+ [InframonitoringtypesPodStatusDTO.crashloopbackoff]: 'cherry',
+ [InframonitoringtypesPodStatusDTO.imagepullbackoff]: 'cherry',
+ [InframonitoringtypesPodStatusDTO.errimagepull]: 'cherry',
+ [InframonitoringtypesPodStatusDTO.createcontainerconfigerror]: 'cherry',
+ [InframonitoringtypesPodStatusDTO.containercreating]: 'amber',
+ [InframonitoringtypesPodStatusDTO.oomkilled]: 'cherry',
+ [InframonitoringtypesPodStatusDTO.error]: 'cherry',
+ [InframonitoringtypesPodStatusDTO.containercannotrun]: 'cherry',
+ [InframonitoringtypesPodStatusDTO.evicted]: 'cherry',
+ [InframonitoringtypesPodStatusDTO.nodeaffinity]: 'cherry',
+ [InframonitoringtypesPodStatusDTO.nodelost]: 'cherry',
+ [InframonitoringtypesPodStatusDTO.shutdown]: 'cherry',
+ [InframonitoringtypesPodStatusDTO.unexpectedadmissionerror]: 'cherry',
+};
+
+type PodStatusCategory =
+ | 'running'
+ | 'completed'
+ | 'pending'
+ | 'unknown'
+ | 'error';
+
+const POD_STATUS_CATEGORY_MAP: Record<
+ keyof InframonitoringtypesPodCountsByStatusDTO,
+ PodStatusCategory
+> = {
+ running: 'running',
+ completed: 'completed',
+ pending: 'pending',
+ unknown: 'unknown',
+ failed: 'error',
+ crashLoopBackOff: 'error',
+ imagePullBackOff: 'error',
+ errImagePull: 'error',
+ createContainerConfigError: 'error',
+ containerCreating: 'error',
+ oomKilled: 'error',
+ error: 'error',
+ containerCannotRun: 'error',
+ evicted: 'error',
+ nodeAffinity: 'error',
+ nodeLost: 'error',
+ shutdown: 'error',
+ unexpectedAdmissionError: 'error',
+};
+
+type ErrorStatusKey = {
+ [K in keyof InframonitoringtypesPodCountsByStatusDTO]: (typeof POD_STATUS_CATEGORY_MAP)[K] extends 'error'
+ ? K
+ : never;
+}[keyof InframonitoringtypesPodCountsByStatusDTO];
+
+const ERROR_STATUS_LABELS: Record<ErrorStatusKey, string> = {
+ failed: 'Failed',
+ crashLoopBackOff: 'CrashLoopBackOff',
+ imagePullBackOff: 'ImagePullBackOff',
+ errImagePull: 'ErrImagePull',
+ createContainerConfigError: 'CreateContainerConfigError',
+ containerCreating: 'ContainerCreating',
+ oomKilled: 'OOMKilled',
+ error: 'Error',
+ containerCannotRun: 'ContainerCannotRun',
+ evicted: 'Evicted',
+ nodeAffinity: 'NodeAffinity',
+ nodeLost: 'NodeLost',
+ shutdown: 'Shutdown',
+ unexpectedAdmissionError: 'UnexpectedAdmissionError',
+};
+
+export function getPodStatusItems(
+ counts: InframonitoringtypesPodCountsByStatusDTO,
): StatusCountItem[] {
+ const errorKeys = Object.keys(ERROR_STATUS_LABELS) as ErrorStatusKey[];
+
+ const errorTotal = errorKeys.reduce((sum, key) => sum + counts[key], 0);
+ const errorBreakdown = errorKeys.map((key) => ({
+ label: ERROR_STATUS_LABELS[key],
+ value: counts[key],
+ }));
+
return [
{ value: counts.running, label: 'Running', color: Color.BG_FOREST_500 },
+ { value: counts.completed, label: 'Completed', color: Color.BG_ROBIN_500 },
{ value: counts.pending, label: 'Pending', color: Color.BG_AMBER_500 },
- { value: counts.succeeded, label: 'Succeeded', color: Color.BG_ROBIN_500 },
- { value: counts.failed, label: 'Failed', color: Color.BG_CHERRY_500 },
{ value: counts.unknown, label: 'Unknown', color: Color.BG_SLATE_400 },
+ {
+ value: errorTotal,
+ label: 'Error Status',
+ color: Color.BG_CHERRY_500,
+ breakdown: errorBreakdown,
+ },
];
}
diff --git a/frontend/src/container/InfraMonitoringK8sV2/components/CellValueTooltip/CellValueTooltip.module.scss b/frontend/src/container/InfraMonitoringK8sV2/components/CellValueTooltip/CellValueTooltip.module.scss
index 2f3669c177..810814cd13 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/components/CellValueTooltip/CellValueTooltip.module.scss
+++ b/frontend/src/container/InfraMonitoringK8sV2/components/CellValueTooltip/CellValueTooltip.module.scss
@@ -52,3 +52,7 @@
.divider {
--divider-color: rgba(255, 255, 255, 0.14);
}
+
+.value {
+ width: fit-content;
+}
diff --git a/frontend/src/container/InfraMonitoringK8sV2/components/CellValueTooltip/CellValueTooltip.tsx b/frontend/src/container/InfraMonitoringK8sV2/components/CellValueTooltip/CellValueTooltip.tsx
index 8da063c6f7..88ec786190 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/components/CellValueTooltip/CellValueTooltip.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/components/CellValueTooltip/CellValueTooltip.tsx
@@ -1,8 +1,9 @@
-import { useCallback, type ReactNode, type MouseEvent } from 'react';
+import { useCallback, type MouseEvent } from 'react';
import { TooltipSimple } from '@signozhq/ui/tooltip';
import { toast } from '@signozhq/ui/sonner';
import { Copy, Minus, Plus } from '@signozhq/icons';
import { useCopyToClipboard } from 'react-use';
+import TanStackTable from 'components/TanStackTableView';
import { useInfraMonitoringCellActionsStore } from './useInfraMonitoringCellActionsStore';
@@ -11,12 +12,10 @@ import { Divider } from '@signozhq/ui/divider';
export interface CellValueTooltipProps {
value: string;
- children: ReactNode;
}
export function CellValueTooltip({
value,
- children,
}: CellValueTooltipProps): JSX.Element {
const [, copyToClipboard] = useCopyToClipboard();
const { lineClamp, increaseLineClamp, decreaseLineClamp } =
@@ -94,7 +93,7 @@ export function CellValueTooltip({
className: styles.tooltipContentWrapper,
}}
>
- {children}
+ <TanStackTable.Text className={styles.value}>{value}</TanStackTable.Text>
</TooltipSimple>
);
}
diff --git a/frontend/src/container/InfraMonitoringK8sV2/components/GroupedStatusCounts.module.scss b/frontend/src/container/InfraMonitoringK8sV2/components/GroupedStatusCounts.module.scss
index 38caeb4eaf..e9f2f66cfe 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/components/GroupedStatusCounts.module.scss
+++ b/frontend/src/container/InfraMonitoringK8sV2/components/GroupedStatusCounts.module.scss
@@ -17,9 +17,40 @@
flex-shrink: 0;
}
+.valueWrapper {
+ min-width: 4ch;
+}
+
+.valueWrapperTooltip {
+ display: block;
+ width: fit-content;
+}
+
.value {
font-variant-numeric: tabular-nums;
- min-width: 4ch;
text-align: left;
cursor: default;
+ min-width: min-content;
+}
+
+.tooltipContent {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+ min-width: 120px;
+}
+
+.tooltipHeader {
+ font-weight: 600;
+ margin-bottom: 2px;
+}
+
+.tooltipRow {
+ display: flex;
+ justify-content: space-between;
+ gap: 12px;
+}
+
+.tooltipValue {
+ font-variant-numeric: tabular-nums;
}
diff --git a/frontend/src/container/InfraMonitoringK8sV2/components/GroupedStatusCounts.tsx b/frontend/src/container/InfraMonitoringK8sV2/components/GroupedStatusCounts.tsx
index df3715ee2d..dc9c12faa9 100644
--- a/frontend/src/container/InfraMonitoringK8sV2/components/GroupedStatusCounts.tsx
+++ b/frontend/src/container/InfraMonitoringK8sV2/components/GroupedStatusCounts.tsx
@@ -2,11 +2,18 @@ import { TooltipSimple } from '@signozhq/ui/tooltip';
import styles from './GroupedStatusCounts.module.scss';
import TanStackTable from 'components/TanStackTableView';
+import { Typography } from '@signozhq/ui/typography';
+
+export interface StatusBreakdownItem {
+ label: string;
+ value: number;
+}
export interface StatusCountItem {
value: number;
label: string;
color: string;
+ breakdown?: StatusBreakdownItem[];
}
interface GroupedStatusCountsProps {
@@ -14,6 +21,45 @@ interface GroupedStatusCountsProps {
showZeroValues?: boolean;
}
+function buildTooltipContent(item: StatusCountItem): React.ReactNode {
+ if (!item.breakdown || item.breakdown.length === 0) {
+ return (
+ <Typography.Text>
+ {item.label}: {item.value}
+ </Typography.Text>
+ );
+ }
+
+ const nonZeroBreakdown = item.breakdown.filter((b) => b.value > 0);
+ if (nonZeroBreakdown.length === 0) {
+ return (
+ <div className={styles.tooltipContent}>
+ <Typography.Text className={styles.tooltipHeader}>
+ {item.label}
+ </Typography.Text>
+
+ <Typography.Text>No errors</Typography.Text>
+ </div>
+ );
+ }
+
+ return (
+ <div className={styles.tooltipContent}>
+ <Typography.Text className={styles.tooltipHeader}>
+ {item.label}
+ </Typography.Text>
+ {nonZeroBreakdown.map((b) => (
+ <div key={b.label} className={styles.tooltipRow}>
+ <Typography.Text>{b.label}</Typography.Text>
+ <Typography.Text className={styles.tooltipValue}>
+ {b.value}
+ </Typography.Text>
+ </div>
+ ))}
+ </div>
+ );
+}
+
export function GroupedStatusCounts({
items,
showZeroValues = true,
@@ -33,13 +79,15 @@ export function GroupedStatusCounts({
className={styles.separator}
style={{ backgroundColor: item.color }}
/>
- <TooltipSimple title={`${item.label}: ${item.value}`}>
- <span>
- <TanStackTable.Text className={styles.value}>
- {item.value || '-'}
- </TanStackTable.Text>
- </span>
- </TooltipSimple>
+ <div className={styles.valueWrapper}>
+ <TooltipSimple title={buildTooltipContent(item)} arrow align="start">
+ <span className={styles.valueWrapperTooltip}>
+ <TanStackTable.Text className={styles.value}>
+ {item.value || '-'}
+ </TanStackTable.Text>
+ </span>
+ </TooltipSimple>
+ </div>
</div>
))}
</div>