diff --git a/frontend/src/api/types.ts b/frontend/src/api/types.ts index e8b52ab..2970e5b 100644 --- a/frontend/src/api/types.ts +++ b/frontend/src/api/types.ts @@ -208,6 +208,7 @@ export interface QueryMetricRow { cache_hit_days: number db_query_days: number client_ip: string | null + client_id: string | null } export interface QueryMetricsPage { @@ -252,7 +253,8 @@ export interface TimeSeriesBucket { } export interface TopClient { - client_ip: string + client: string + client_ip?: string query_count: number avg_elapsed_ms: number } @@ -261,6 +263,7 @@ export interface QueryMetricsTimeSeries { buckets: TimeSeriesBucket[] topClients: TopClient[] granularity: 'HOURLY' | 'DAILY' + groupBy?: 'ip' | 'id' } export interface QueryMetricsParams { diff --git a/frontend/src/pages/ApiMetrics.tsx b/frontend/src/pages/ApiMetrics.tsx index 264ec8d..c3e95fc 100644 --- a/frontend/src/pages/ApiMetrics.tsx +++ b/frontend/src/pages/ApiMetrics.tsx @@ -136,6 +136,10 @@ export default function ApiMetrics() { key: 'client_ip', label: t('metrics.clientIp'), sortable: false, render: (row) => row.client_ip ? {row.client_ip} : '-', }, + { + key: 'client_id', label: 'ID', sortable: false, + render: (row) => row.client_id ? {row.client_id} : '-', + }, ] return ( diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx index 42db6a9..e2c6e06 100644 --- a/frontend/src/pages/Dashboard.tsx +++ b/frontend/src/pages/Dashboard.tsx @@ -326,30 +326,31 @@ export default function Dashboard() { {/* Top Clients */} - {queryTs.topClients.length > 0 && ( -