feat(v1.47): production synthetic monitoring - #71
Open
MP2EZ wants to merge 1 commit into
Open
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.ymlnightly is a release gate that tests staging, never live prod. This adds active/synthetic monitoring of the real site.Changes
/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 throughindex.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 vshttps://campable.co, and on failure uploads the report, emails via Resend, and opens aprod-downissue.docs/MONITORING.md— the 4-layer model (UptimeRobot / daily monitor / release gate / PostHog) + setup.docs/ROADMAP.md— v1.47 entry.Verification
/healthz→{"status":"ok","db":true,"version":"1.47"}, takes precedence over SPA fallback/healthztests (ok + 503) pass; fulltest_api_endpoints.py36/36 passesRequired config before email alerts work
Under Settings → Secrets and variables → Actions:
RESEND_API_KEYALERT_EMAIL_TO(your@palouselabs.comaddress)ALERT_EMAIL_FROM(defaultalerts@campable.co; domain must be verified in Resend)If unset, the email step skips gracefully and the GitHub issue still fires.
🤖 Generated with Claude Code