From 65241c356b935243fe5fcb4eee304accc815879d Mon Sep 17 00:00:00 2001 From: Juan Denis Date: Tue, 10 Nov 2026 14:47:36 -0500 Subject: [PATCH] fix(ui): show the metrics error state when a poll fails --- .../components/service-detail/MetricsTab.jsx | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/service-detail/MetricsTab.jsx b/frontend/src/components/service-detail/MetricsTab.jsx index bdf4b037..34885786 100644 --- a/frontend/src/components/service-detail/MetricsTab.jsx +++ b/frontend/src/components/service-detail/MetricsTab.jsx @@ -2,7 +2,9 @@ import { useCallback, useState, useEffect, useRef } from 'react'; import api from '../../services/api'; import { Gauge } from '@/components/ds'; import EmptyState from '../EmptyState'; -import ErrorState from '../ErrorState'; +import { AlertTriangle } from 'lucide-react'; +import { Button } from '@/components/ui/button'; +import { errorReason } from '@/utils/errorMessage'; import { usePolling } from '@/hooks/usePolling'; import { useTranslation } from 'react-i18next'; import { normalizeContainerStats, resolveAppContainerId } from '@/utils/containerMetrics'; @@ -65,9 +67,16 @@ const MetricsTabContent = ({ app }) => { return ; } - // A failed poll keeps the last good numbers; only a failure with nothing to show becomes an error. - if (loadError && !stats && !processInfo) { - return { setLoading(true); loadMetrics(); }} />; + // A failed poll replaces the numbers: stale CPU/memory would read as live. + if (loadError) { + return ( + { setLoading(true); loadMetrics(); }}>{t('common.actions.retry', 'Retry')}} + /> + ); } if (isDocker && stats) {