Monitoring and Error Tracking
Here's a question every app builder should answer:
If your app crashes at 3 AM, how will you find out?
If the answer is "a user will email me," you have a problem. By the time users are emailing you, they've already had a bad experience — and some of them have already left.
Monitoring and error tracking are how you know what's happening with your app when you're not looking at it.
Why Monitoring Matters
| Without Monitoring | With Monitoring |
|---|---|
| Users tell you something is broken | You know before users notice |
| You guess what went wrong | You see exactly what happened |
| You spend hours reproducing bugs | You have the error details immediately |
| You don't know if your app is slow | You see performance trends |
| You find out about problems randomly | You get alerted automatically |
Two Types of Monitoring
1. Error Tracking
Error tracking captures detailed information when something goes wrong in your app:
- What error occurred
- Where in the code it happened
- What the user was doing
- What browser/device they were using
- What data was involved
- How many users were affected
Think of it as a black box recorder for your app.
2. Uptime Monitoring
Uptime monitoring checks whether your app is accessible and responding correctly:
- Is the server reachable?
- Does the homepage load?
- Are API endpoints responding?
- Is the database connected?
- Is the SSL certificate valid?
Think of it as a smoke detector for your app.
What to Monitor
Critical: Monitor These From Day One
| What | Why | Tool Example |
|---|---|---|
| App crashes | Know immediately when something breaks | Sentry |
| Server uptime | Know when your app goes offline | Uptime Robot |
| API errors | Catch backend failures | Sentry |
| Database connectivity | Detect database issues early | Server monitoring |
Important: Add These as You Grow
| What | Why | Tool Example |
|---|---|---|
| Page load time | Catch performance issues | Google Analytics |
| User sign-ups | Track growth and spot registration issues | Analytics |
| Failed logins | Detect brute force attacks | Custom logging |
| Slow queries | Find database performance problems | Database monitoring |
| Server resources | CPU, memory, disk usage | Server monitoring |
Nice to Have: For Mature Apps
| What | Why |
|---|---|
| User behavior analytics | Understand how users interact with your app |
| Business metrics | Revenue, conversion rates, churn |
| Custom dashboards | Combine all metrics in one view |
Free Monitoring Tools to Start With
You don't need an expensive enterprise solution. These free tiers are enough for most small apps:
| Tool | What It Monitors | Free Tier |
|---|---|---|
| Sentry | Error tracking | 5,000 events/month |
| Uptime Robot | Uptime monitoring | 50 monitors, 5-minute checks |
| Better Stack | Uptime + status pages | 10 monitors, 3-minute checks |
| Google Analytics | User behavior, performance | Unlimited |
| Logtail | Log management | 1GB/month |
| Healthchecks.io | Cron job monitoring | 20 checks |
How to Set Up Error Tracking
Step 1: Sign Up for Sentry
Go to sentry.io and create a free account. Sentry is the industry standard for error tracking and has a generous free tier.
Step 2: Install Sentry in Your App
Ask your AI tool to add Sentry to your project:
Add Sentry error tracking to my [framework] app.
Requirements:
- Install the Sentry SDK for [framework/language]
- Initialize Sentry with my DSN (stored in environment variable SENTRY_DSN)
- Capture unhandled exceptions automatically
- Set up source maps for readable stack traces
- Include user context (user ID if logged in)
- Set environment to production/staging based on NODE_ENV
- Do not send errors in development mode
Step 3: Test It
Trigger an intentional error in your app and verify it appears in Sentry's dashboard.
Step 4: Set Up Alerts
Configure Sentry to notify you when:
- A new error type appears
- An existing error increases in frequency
- An error affects more than X users
How to Set Up Uptime Monitoring
Step 1: Sign Up for Uptime Robot
Go to uptimerobot.com and create a free account.
Step 2: Add Your App URL
Add a monitor for your app's URL. Set it to check every 5 minutes.
Step 3: Add Key Endpoints
Monitor more than just your homepage:
https://yourapp.com/— homepagehttps://yourapp.com/api/health— API health endpoint (if you have one)https://yourapp.com/login— login page
Step 4: Set Up Notifications
Configure alerts via:
- SMS (paid plans)
- Slack / Discord / Telegram webhooks
What to Do When You Get an Alert
Error Alert
- Don't panic. Errors happen. You have monitoring precisely so you can catch them calmly.
- Check Sentry for the full error details — stack trace, user context, environment.
- Reproduce the issue if possible. Try to understand what the user was doing.
- Fix the bug — use AI to help, but review the fix carefully.
- Deploy the fix following your deployment process.
- Verify the error stops appearing in Sentry.
- Document what happened and how it was fixed.
Uptime Alert
- Check if you can access the app from your browser.
- Check your hosting provider's status page — they may have an outage.
- Check server resources — CPU, memory, disk (if you have server monitoring).
- Restart the app if needed.
- Investigate the cause after restoring service.
- Document what happened and how to prevent it.
The Monitoring Checklist
- Error tracking is installed (Sentry or similar)
- Uptime monitoring is configured
- Alerts are set up (email, Slack, etc.)
- Someone is responsible for responding to alerts
- Error tracking works in production (tested)
- Source maps are uploaded for readable errors
- User context is included in error reports
- Performance monitoring is configured
- Database query monitoring is set up
- Server resource monitoring is configured
- A response plan is documented for common alerts
The Bottom Line
You can't fix what you don't know is broken.
Monitoring and error tracking are not optional extras. They are the minimum requirement for running a professional application. Set them up before you launch, not after your first user reports a problem.
The free tiers of Sentry and Uptime Robot are enough for most small apps. There's no excuse not to have them.