ADR-011: Telemetry and Observability Approach
Context
Continuous health monitoring, performance tracking, diagnostic logging, and billing usage insights are required to maintain production operational standards under a strict zero-dollar standby budget.
Decision
Standardize natively on Google Cloud Operations Suite (Cloud Logging, Cloud Monitoring, and Cloud Billing).
The Express backend emits machine-readable structured JSON logs directly to standard output, which Cloud Run automatically captures and parses. Custom events (such as AI workflow runs) are graphed using native Log-Based Metrics in Cloud Monitoring.
Quality is quantified, not vibes: client telemetry grades every measured span against numeric SLOs (static assets 200ms p99, AI responses 1500ms p95, cryptographic parsing 500ms p95) with a 1% error budget.
Amended 2026-10-16 (ADR-031): GA4 usage analytics were removed; page views are counted without cookies through the telemetry beacon.
Amended 2026-10-16: the logger gained a DEBUG level with a LOG_LEVEL floor, request-scoped trace and component context, Error Reporting grouping, and anonymized client IPs. Browser errors and SLO spans reach Cloud Logging through a rate-limited POST /api/telemetry beacon. Six log-based metrics (AI demo runs by demo type, model and location; logs and errors by component; client errors; client SLO spans; page views) feed four dashboards. Alerts go by email: Terraform manages a Turnstile fail-open alert and an availability-burn alert (5xx above 1% over 5 minutes), alongside an error-log alert for prod. Successful health-check logs are excluded.
Consequences
Benefits:
* Completely eliminates third-party agent dependencies, maintaining a 100% free operation tier under GCP limits.
* Preserves container start speeds (zero cold-start latency tax) by keeping the runtime process clean and lightweight.
* Provides beautiful, keyless dashboard analytics natively.
Alternatives considered
1. Third-party SaaS (Datadog/New Relic): Rejected due to custom agent dependency, continuous idle costs, and increased bundle sizes on the frontend.
2. Unstructured text logs: Rejected as they are difficult to query, filter, and alert on in automated monitoring consoles.