docs/deployment/monitoring.md
Monitor your Workers in production using Cloudflare's built-in tools and roll back quickly when issues arise.
Stream live logs from any worker:
# Tail production API logs
wrangler tail --config apps/api/wrangler.jsonc
# Filter to specific paths
wrangler tail --config apps/api/wrangler.jsonc --search-str="/api/trpc"
# Tail staging
wrangler tail --config apps/api/wrangler.jsonc --env=staging
Logs include request metadata, console.log output, and uncaught exceptions.
The Cloudflare dashboard provides per-worker metrics:
If a deploy introduces issues, roll back to the previous version:
# List recent deployments
wrangler deployments list --config apps/api/wrangler.jsonc
# Roll back to the previous stable version
wrangler rollback --config apps/api/wrangler.jsonc \
--message="Reverting due to auth regression"
Repeat for each affected worker (apps/app/, apps/web/).
::: warning Wrangler rollback reverts worker code but not database migrations. If a deploy included schema changes that the previous code depends on differently, you may need to deploy a fix-forward migration instead. See Database: Migrations. :::
Worker size limit – Cloudflare Workers have a 10 MB compressed size limit (3 MB on the free plan). If you hit it:
Database connection issues – If queries fail or time out:
wrangler.jsonc match Terraform outputAuthentication problems – If sign-in fails in production:
BETTER_AUTH_SECRET is set (wrangler secret list --config apps/api/wrangler.jsonc)APP_ORIGIN matches your actual domain (affects cookie domain)| Service | Free tier | Paid |
|---|---|---|
| Cloudflare Workers | 100,000 requests/day | $5/month for 10M requests |
| Neon PostgreSQL | 0.5 GB storage, auto-suspend compute | Scale-to-zero billing |
| Hyperdrive | Included with Workers paid plan | – |
| Resend | 100 emails/day | $20/month for 50K emails |
A typical growth-stage project runs around ~$45/month (Workers $5 + Neon $19 + Resend $20). Free tiers are sufficient through early production – monitor usage in the Cloudflare and Neon dashboards as traffic grows.