Skip to content
prod 352bb92
Browse

4 · Post-deploy monitoring & day-2 (P9)

Objective — watch the live app closely through the first 24–48h with smoke tests, integration checks, performance/security spot-checks, log triage, and recorded baselines — keeping rollback one command away — so issues that only surface under real load are caught before they compound.

Steps at a glance:

  1. Monitor the first 24–48 hours — Run the post-deploy checks, then keep watching.

Some issues only surface under real load, on timezone-bound cron jobs, or after a cache expires. Watch closely through the first two days — and keep rollback one command away the entire time.

Run the post-deploy checks, then keep watching.

The first substep is a browser-driven end-to-end pass. Use the same split as Phase 5: agent-drivable checks are executed, human-only credential/account/payment/email moments are tracked with owner and trigger.

For any provider console follow-up during the watch window — Sentry, MonSpark, Slack/Discord, Stripe, analytics, or Cloudflare — use the vendor console automation guide so the agent can verify non-secret state without handling credentials or live payment/email triggers.

  1. Smoke-test immediately — login page render, signup page render, auth guard, seeded reset request, logout after human login, and core features all work end-to-end; human-only registration/password-entry/real-mailbox/payment rows are tracked if not completed during launch.

    • ✅ Every agent-drivable core user flow works end-to-end in the browser, and every human-only remainder has an owner/trigger.
  2. Verify integrations — email delivery, key API routes, payment gateway, and queue workers all process.

    • ✅ Email, key API routes, payments, and queue workers all process.
  3. Spot-check performance and security — homepage/login/health response times are within target, .env is unreachable (403/404), uploaded media + module assets resolve, HTTPS/HSTS present, and APP_DEBUG=false.

    Terminal window
    curl -s -o /dev/null -w "Home: %{time_total}s\n" https://<DOMAIN>
    curl -s -o /dev/null -w "%{http_code}\n" https://<DOMAIN>/.env # Expected: 403 or 404
    # Assets must resolve — a dead public/storage symlink (vendors often ship it pointing at /var/www/...)
    # or a missing public/packages link 403/404s every uploaded image and in-tree module asset.
    curl -s -o /dev/null -w "logo: %{http_code}\n" https://<DOMAIN>/storage/<a-known-uploaded-asset> # Expected: 200
    # In-tree module apps only (e.g. WorkDo /packages/...): if used, a known module asset must also be 200.
    # SECURITY: a blanket public/packages symlink can expose raw PHP source — confirm .php under /packages is NOT served.
    curl -s -o /dev/null -w "pkg-php: %{http_code}\n" https://<DOMAIN>/packages/<vendor>/<module>/src/<any>.php # Expected: 403/404, never 200
    • ✅ Response times are within target, .env returns 403/404, uploaded/module assets return 200, and raw .php under /packages is not served (403/404). If media 404s, the per-env symlink wasn’t recreated on deploy (storage:link / the packages link); if .php is served, restrict /packages to asset extensions or publish module assets instead of symlinking the source tree.
  4. Watch logs and triage. Tail the app log, count errors, and classify anything that appears.

    SeverityDefinitionAction
    CriticalCore functionality brokenHotfix immediately
    HighMajor UX impactFix within 24–48h
    MediumMinor bugNext patch release
    LowCosmetic / edge caseBacklog
    • ✅ Logs are tailed and every error is classified and actioned by severity.
  5. Record baselines after 48h — error rate (< 0.1%), average response time (< 200ms), uptime (99.9%) — and note lessons learned.

    • ✅ Error rate, response time, and uptime baselines are recorded with lessons learned.

After the first launch, the cycle gets short: prepare the release (P1), push through the verified non-production target from Zaj-PROJECT.md → release branch (main in setup-new) → production deploy target, tag, and run an abbreviated P9. No installer, no manual .env, no 777 pass — migrations run automatically and every deploy carries built-in safety checks (pre-symlink smoke test, cache-failure blocking, HTTP health check, and automatic rollback if any check fails).

AspectFirst deploySubsequent deploys
DatabaseEmpty — installer creates schemaExists — migrations update schema
InstallerRequired (/install)Not needed
.env / server dirsCreate manuallyAlready in place
Permissions hardening (P3)One-timeSkip
flowchart LR
subgraph first["First deploy"]
F1[Empty DB] --> F2[Web installer]
F2 --> F3[Manual .env + dirs]
F3 --> F4[Full P9 watch]
end
subgraph day2["Subsequent deploys"]
S1[P1 prepare release] --> S2[non-production → production]
S2 --> S3[Auto migrations]
S3 --> S4[Abbreviated P9]
end
first --> day2

You’ve reached the end — the app is live, tagged, and monitored. From here the work is ongoing operations, not a further phase: routine updates, hotfix releases, vendor-version syncs (merging a new vendor release while preserving your customization markers), scheduled backups, and incident response — each one a small replay of P1 → P2 → P4 → P9.

Do not mark this step done until every box below is checked.

  • 🔀 Smoke tests pass — agent-drivable auth/render/reset-request/auth-guard/logout/core-feature checks pass; human-only registration/password-entry/real-mailbox/payment rows are completed or tracked with owner/trigger.
  • 🔀 Integrations verified — email, key API routes, payment gateway, and queue workers all process.
  • 🤖 Perf/security spot-checked — response times within target, .env returns 403/404, uploaded/module assets return 200 (per-env symlinks recreated), raw .php under /packages not served, HTTPS/HSTS present, APP_DEBUG=false.
  • 🤖 Logs triaged — app log tailed, every error classified by severity and actioned.
  • 🔀 Baselines recorded — error rate, response time, and uptime captured at 48h with lessons learned.
  • 🤖 Rollback rehearseddep rollback production (or tag-based redeploy) ready the whole window.

Return to the Laravel/CodeCanyon setup-new hub to revisit any phase, or use the subsequent-deploy cycle above as your day-2 runbook.