Refactor Activity Page (#710)

- inference handles to store an activity record for all inference endpoints
- add path, status code, and content type to Activities page
- toggle on/off columns no Activities page 
- add configurable capture level for inference endpoints so large binary blobs are not stored in memory
- store captures in compressed binary format
This commit is contained in:
Benson Wong
2026-04-28 20:33:03 -07:00
committed by GitHub
parent a846c4f18c
commit fd3c28ffc5
16 changed files with 1397 additions and 651 deletions
+12 -4
View File
@@ -1,5 +1,13 @@
import { writable } from "svelte/store";
import type { Model, Metrics, VersionInfo, LogData, APIEventEnvelope, ReqRespCapture, InFlightStats } from "../lib/types";
import type {
Model,
ActivityLogEntry,
VersionInfo,
LogData,
APIEventEnvelope,
ReqRespCapture,
InFlightStats,
} from "../lib/types";
import { connectionState } from "./theme";
const LOG_LENGTH_LIMIT = 1024 * 100; /* 100KB of log data */
@@ -8,7 +16,7 @@ const LOG_LENGTH_LIMIT = 1024 * 100; /* 100KB of log data */
export const models = writable<Model[]>([]);
export const proxyLogs = writable<string>("");
export const upstreamLogs = writable<string>("");
export const metrics = writable<Metrics[]>([]);
export const metrics = writable<ActivityLogEntry[]>([]);
export const inFlightRequests = writable<number>(0);
export const versionInfo = writable<VersionInfo>({
build_date: "unknown",
@@ -62,7 +70,7 @@ export function enableAPIEvents(enabled: boolean): void {
const newModels = JSON.parse(message.data) as Model[];
// Sort models by name and id
newModels.sort((a, b) => {
return (a.name + a.id).localeCompare(b.name + b.id, undefined, { numeric : true} );
return (a.name + a.id).localeCompare(b.name + b.id, undefined, { numeric: true });
});
models.set(newModels);
break;
@@ -82,7 +90,7 @@ export function enableAPIEvents(enabled: boolean): void {
}
case "metrics": {
const newMetrics = JSON.parse(message.data) as Metrics[];
const newMetrics = JSON.parse(message.data) as ActivityLogEntry[];
metrics.update((prevMetrics) => [...newMetrics, ...prevMetrics]);
break;
}