diff --git a/agenta-web/src/components/pages/observability/ObservabilityDashboard.tsx b/agenta-web/src/components/pages/observability/ObservabilityDashboard.tsx index 1c2251f875..0d447677c0 100644 --- a/agenta-web/src/components/pages/observability/ObservabilityDashboard.tsx +++ b/agenta-web/src/components/pages/observability/ObservabilityDashboard.tsx @@ -16,7 +16,7 @@ import {formatCurrency, formatLatency, formatTokenUsage} from "@/lib/helpers/for import {getNodeById} from "@/lib/helpers/observability_helpers" import {Filter, FilterConditions, JSSTheme} from "@/lib/Types" import {_AgentaRootsResponse} from "@/services/observability/types" -import {SwapOutlined} from "@ant-design/icons" +import {ReloadOutlined, SwapOutlined} from "@ant-design/icons" import { Button, Input, @@ -71,6 +71,7 @@ const ObservabilityDashboard = () => { setSort, pagination, setPagination, + fetchTraces, } = useObservabilityData() const appId = useAppId() const router = useRouter() @@ -250,6 +251,12 @@ const ObservabilityDashboard = () => { } }, [activeTrace, selected]) + useEffect(() => { + const interval = setInterval(fetchTraces, 300000) + + return () => clearInterval(interval) + }, []) + const selectedItem = useMemo( () => (traces?.length ? getNodeById(traces, selected) : null), [selected, traces], @@ -480,6 +487,14 @@ const ObservabilityDashboard = () => {