From db2242e223be1bad917577d786b053ecef5f1660 Mon Sep 17 00:00:00 2001 From: Chris Opland Date: Fri, 25 Sep 2026 14:23:46 -0500 Subject: [PATCH] fix(o11y): add connections to footer (#50928) --- .../ComputeMetricsFooter.tsx | 28 +++++++++++++------ .../HaInstanceNode.tsx | 4 +-- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/ComputeMetricsFooter.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/ComputeMetricsFooter.tsx index 2250c7d0a84..b033530352a 100644 --- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/ComputeMetricsFooter.tsx +++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/ComputeMetricsFooter.tsx @@ -10,7 +10,11 @@ import { useComputeMetrics } from '@/hooks/analytics/useComputeMetrics' * to the database report. Metrics are project-scoped, which reports the * primary on both standard and High Availability projects. */ -export const ComputeMetricsFooter = ({ showConnections = true }: { showConnections?: boolean }) => { +export const ComputeMetricsFooter = ({ + isConnectionsAvailable = true, +}: { + isConnectionsAvailable?: boolean +}) => { const { ref } = useParams() const { @@ -25,6 +29,7 @@ export const ComputeMetricsFooter = ({ showConnections = true }: { showConnectio }) const observabilityUrl = `/project/${ref}/observability/database` + const hasConnectionMetrics = isConnectionsAvailable && connections !== null && connections.max > 0 return ( @@ -41,7 +46,8 @@ export const ComputeMetricsFooter = ({ showConnections = true }: { showConnectio <> {cpu === null && 'CPU unavailable. '} {disk === null && 'Disk unavailable. '} - {memory === null && 'RAM unavailable.'} + {memory === null && 'RAM unavailable. '} + {!hasConnectionMetrics && 'Connection metrics unavailable.'} )} @@ -70,14 +76,18 @@ export const ComputeMetricsFooter = ({ showConnections = true }: { showConnectio RAM - {showConnections && connections !== null && connections.max > 0 && ( - <> - · - + · + + {hasConnectionMetrics ? ( + <> {connections.peak}/{connections.max} conns - - - )} + + ) : ( + <> + Conns Unavailable + + )} + )} diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/HaInstanceNode.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/HaInstanceNode.tsx index f564131ad15..8ce3f52c735 100644 --- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/HaInstanceNode.tsx +++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/HaInstanceNode.tsx @@ -115,8 +115,8 @@ export const HaPrimaryNode = ({ data }: NodeProps>) => { )} {/* Whether connection metrics are meaningful through the multigateway - is unconfirmed, so they're left off for HA projects. */} - + is unconfirmed, so they're marked unavailable for HA projects. */} +