Skip to content

Commit

Permalink
Merge pull request #2290 from Agenta-AI/AGE-1342/-auto-refresh-observ…
Browse files Browse the repository at this point in the history
…ability-tables

(frontend)[AGE-1342]: Auto-refresh observability tables
  • Loading branch information
mmabrouk authored Nov 22, 2024
2 parents 6b98e63 + 4e9e842 commit b8fb3a3
Showing 1 changed file with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -71,6 +71,7 @@ const ObservabilityDashboard = () => {
setSort,
pagination,
setPagination,
fetchTraces,
} = useObservabilityData()
const appId = useAppId()
const router = useRouter()
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -480,6 +487,14 @@ const ObservabilityDashboard = () => {

<div className="flex justify-between gap-2 flex-col 2xl:flex-row 2xl:items-center">
<Space>
<Button
icon={<ReloadOutlined />}
onClick={() => {
fetchTraces()
}}
>
Reload
</Button>
<Input.Search
placeholder="Search"
value={searchQuery}
Expand Down

0 comments on commit b8fb3a3

Please sign in to comment.