feat(monitoring): add stats counters API and public status page

Add GET /api/stats exposing cumulative counters (feeds created/deleted,
emails received/rejected, recent date-times) plus live values (active
feeds, active WebSub subscriptions). Counters persist in a stats:counters
KV singleton and are incremented at the email-processing chokepoint and
feed create/delete paths. Replace the / → /admin redirect with a public
status page rendering these figures with a link to the admin.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Julien Herr
2026-05-23 09:50:51 +02:00
parent f4d5edda0e
commit b534ce5bf8
15 changed files with 484 additions and 6 deletions
+3
View File
@@ -21,3 +21,6 @@ export const MAX_LEASE_SECONDS = 30 * 24 * 3600; // 30 days
/** KV key for the global feed list. */
export const FEEDS_LIST_KEY = "feeds:list";
/** KV key for the monitoring counters singleton. */
export const STATS_KEY = "stats:counters";