Skip to content

feat(v1.47): production synthetic monitoring - #71

Open
MP2EZ wants to merge 1 commit into
devfrom
feat/v1.47-prod-monitoring
Open

feat(v1.47): production synthetic monitoring#71
MP2EZ wants to merge 1 commit into
devfrom
feat/v1.47-prod-monitoring

Conversation

@MP2EZ

@MP2EZ MP2EZ commented Jun 18, 2026

Copy link
Copy Markdown
Owner

What & why

You asked for a daily job that tests all the site's features and alerts if something's down — and whether PostHog already does it. It doesn't (PostHog is passive — it only sees errors after a real user hits them). And the existing playwright.yml nightly is a release gate that tests staging, never live prod. This adds active/synthetic monitoring of the real site.

Changes

  • Real /healthz (src/pnw_campsites/api.py) — pings SQLite, returns {status,db,version}, 503 when the DB is unreachable. Registered before the SPA catch-all so it no longer false-greens through index.html (this also makes the existing deploy wait-loop check honest).
  • e2e/tests/prod-smoke.spec.ts — read-only, non-mutating Playwright smoke (homepage, search API, pricing, SEO state index). Safe against prod — no signup, no Stripe, no writes. The existing 4 flows mutate state and stay on staging.
  • .github/workflows/prod-monitor.yml — daily (15:00 UTC) + manual dispatch. Curls /healthz + /api/search, runs the smoke vs https://campable.co, and on failure uploads the report, emails via Resend, and opens a prod-down issue.
  • docs/MONITORING.md — the 4-layer model (UptimeRobot / daily monitor / release gate / PostHog) + setup.
  • docs/ROADMAP.md — v1.47 entry.

Verification

  • Live server: /healthz{"status":"ok","db":true,"version":"1.47"}, takes precedence over SPA fallback
  • /healthz tests (ok + 503) pass; full test_api_endpoints.py 36/36 passes
  • prod-smoke ran against live campable.co: 4/4 pass (real search returned in 875ms)
  • Both workflows parse

Required config before email alerts work

Under Settings → Secrets and variables → Actions:

  • Secret RESEND_API_KEY
  • Variable ALERT_EMAIL_TO (your @palouselabs.com address)
  • Optional ALERT_EMAIL_FROM (default alerts@campable.co; domain must be verified in Resend)

If unset, the email step skips gracefully and the GitHub issue still fires.

Note: the /healthz JSON check goes fully green once v1.47 reaches prod (this dev → main release deploys the route). The Playwright smoke + /api/search check already pass against current prod.

🤖 Generated with Claude Code

Add active/synthetic monitoring for live campable.co — distinct from the
existing playwright.yml release gate, which only tests staging.

- Real /healthz endpoint: pings SQLite, returns {status,db,version}, 503
  when DB unreachable. Registered before the SPA catch-all so it no longer
  false-greens through index.html (also fixes the deploy wait-loop check).
- prod-smoke.spec.ts: read-only, non-mutating Playwright smoke (homepage,
  search API, pricing, SEO) safe to run against production.
- prod-monitor.yml: daily workflow — curls /healthz + /api/search, runs the
  smoke vs prod, emails via Resend + opens a 'prod-down' issue on failure.
- docs/MONITORING.md: 4-layer model + UptimeRobot + Resend config.

Requires repo config: RESEND_API_KEY secret + ALERT_EMAIL_TO var (email
step skips gracefully if unset; GitHub issue still fires).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant