diff --git a/ui/src/api/queries/logs.ts b/ui/src/api/queries/logs.ts index cb21e652..416b0e85 100644 --- a/ui/src/api/queries/logs.ts +++ b/ui/src/api/queries/logs.ts @@ -15,6 +15,7 @@ export interface LogEntryResponse { instanceId: string | null; application: string | null; mdc: Record | null; + source: string | null; } export interface LogSearchPageResponse { @@ -29,6 +30,7 @@ export interface LogSearchParams { level?: string; application?: string; agentId?: string; + source?: string; exchangeId?: string; logger?: string; from?: string; @@ -45,6 +47,7 @@ async function fetchLogs(params: LogSearchParams): Promise fetchLogs(params), enabled: !!application, placeholderData: (prev) => prev, diff --git a/ui/src/pages/AgentHealth/AgentHealth.tsx b/ui/src/pages/AgentHealth/AgentHealth.tsx index 2c43c55e..fd227e2c 100644 --- a/ui/src/pages/AgentHealth/AgentHealth.tsx +++ b/ui/src/pages/AgentHealth/AgentHealth.tsx @@ -87,6 +87,11 @@ const LOG_LEVEL_ITEMS: ButtonGroupItem[] = [ { value: 'trace', label: 'Trace', color: 'var(--text-muted)' }, ]; +const LOG_SOURCE_ITEMS: ButtonGroupItem[] = [ + { value: 'app', label: 'App' }, + { value: 'agent', label: 'Agent' }, +]; + // ── AgentHealth page ───────────────────────────────────────────────────────── export default function AgentHealth() { @@ -138,9 +143,10 @@ export default function AgentHealth() { const [logSearch, setLogSearch] = useState(''); const [logLevels, setLogLevels] = useState>(new Set()); + const [logSource, setLogSource] = useState(''); // '' = all, 'app', 'agent' const [logSortAsc, setLogSortAsc] = useState(false); const [logRefreshTo, setLogRefreshTo] = useState(); - const { data: rawLogs } = useApplicationLogs(appId, undefined, { toOverride: logRefreshTo }); + const { data: rawLogs } = useApplicationLogs(appId, undefined, { toOverride: logRefreshTo, source: logSource || undefined }); const logEntries = useMemo(() => { const mapped = (rawLogs || []).map((l) => ({ timestamp: l.timestamp ?? '', @@ -554,6 +560,11 @@ export default function AgentHealth() { )} + setLogSource(v.size === 0 ? '' : [...v][0])} + /> {logLevels.size > 0 && ( )} + setLogSource(v.size === 0 ? '' : [...v][0])} + /> {logLevels.size > 0 && (