feat(telemetry): rollups, alerts, scheduler, health checks, admin server fns

- pure rollup accumulators with tests; daily upserts keyed date/metric/dim
- alert checks with db-backed cooldown and push to admin players
- in-process scheduler started from health probes
- health endpoint checks pb + supertokens, stale-while-revalidate, always 200
- sse connection counter moved to emitter
- telemetry feature server fns: events/errors/groups/rollups/alerts/status
This commit is contained in:
2026-08-25 21:38:08 -07:00
parent e2863c1f6c
commit 06fe1f4ed7
12 changed files with 1009 additions and 11 deletions
+14
View File
@@ -68,6 +68,20 @@ export const emitServerEvent = (event: ServerEvent) => {
serverEvents.emit(event.type, event);
};
let activeConnections = 0;
export const incrementConnections = () => {
activeConnections++;
return activeConnections;
};
export const decrementConnections = () => {
activeConnections = Math.max(0, activeConnections - 1);
return activeConnections;
};
export const getActiveConnectionCount = () => activeConnections;
if (process.env.NODE_ENV === 'development') {
setInterval(() => {
const listenerCounts = Object.fromEntries(