From d518169ce94aaeb0e815fe7b0312d6aeb60e399a Mon Sep 17 00:00:00 2001 From: Till JS Date: Thu, 23 Apr 2026 18:30:49 +0200 Subject: [PATCH] =?UTF-8?q?feat(website):=20M7=20=E2=80=94=20observability?= =?UTF-8?q?=20+=20analytics=20+=20GC=20+=20M2-polish?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes the plan. Prometheus metrics across the website endpoints, a cookieless analytics block users can opt in to, a read-only orphan- asset scan script, plus two M2 debts (rollback UI + determinism test). apps/api: - New /metrics endpoint (unauth; internal-network only via reverse proxy). Scrape with the existing Prometheus config that already covers mana-ai. - lib/metrics.ts with prom-client Registry and default-metrics prefix `mana_api_`. Website-specific counters/histograms: website_publish_total{result=success|slug_taken|invalid|error} website_publish_duration_seconds (Histogram) website_submissions_total{result=received|spam|rate_limit|not_found|invalid} website_host_resolve_total{result=hit|miss|error} website_domain_verify_total{result=verified|failed} website_public_reads_total{result=hit|not_found} website_public_read_age_seconds (Histogram — age of served snapshot) - Instrument publish.ts, submit.ts, public-routes.ts, domains.ts with .inc() calls on every code path. packages/website-blocks: - New `analytics` block: Plausible + Umami support with self-hosted script-URL override. Hidden in edit/preview, emits exactly one