feat(observability): phase 1 - schema, models & event log backend
Add database foundation for observability features: - event_log table with severity/source filtering and pagination - standalone_proxies table for user-created reverse proxies - stale_threshold_days setting (default 7 days) - Auto-persist warn/error events from event bus to database - SSE broadcast of persistent events for real-time UI updates - Frontend types and API functions for downstream UI phases
This commit is contained in:
@@ -2,6 +2,8 @@ import type {
|
||||
ApiEnvelope,
|
||||
Deploy,
|
||||
DeployLog,
|
||||
EventLogEntry,
|
||||
EventLogStats,
|
||||
InspectResult,
|
||||
Instance,
|
||||
NpmCertificate,
|
||||
@@ -338,4 +340,29 @@ export function deleteVolume(
|
||||
return del<{ deleted: string }>(`/api/projects/${projectId}/volumes/${volId}`);
|
||||
}
|
||||
|
||||
// ── Event Log ───────────────────────────────────────────────────────
|
||||
|
||||
export function fetchEventLog(params?: {
|
||||
severity?: string;
|
||||
source?: string;
|
||||
since?: string;
|
||||
until?: string;
|
||||
limit?: number;
|
||||
offset?: number;
|
||||
}): Promise<EventLogEntry[]> {
|
||||
const query = new URLSearchParams();
|
||||
if (params?.severity) query.set('severity', params.severity);
|
||||
if (params?.source) query.set('source', params.source);
|
||||
if (params?.since) query.set('since', params.since);
|
||||
if (params?.until) query.set('until', params.until);
|
||||
if (params?.limit) query.set('limit', String(params.limit));
|
||||
if (params?.offset) query.set('offset', String(params.offset));
|
||||
const qs = query.toString();
|
||||
return get<EventLogEntry[]>(`/api/events/log${qs ? `?${qs}` : ''}`);
|
||||
}
|
||||
|
||||
export function fetchEventLogStats(): Promise<EventLogStats> {
|
||||
return get<EventLogStats>('/api/events/log/stats');
|
||||
}
|
||||
|
||||
export { ApiError };
|
||||
|
||||
Reference in New Issue
Block a user