Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(frontend)[AGE-1342]: Auto-refresh observability tables #2290

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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