Monitoring Systems Guide
Overview
DutyCall's monitoring infrastructure provides real-time visibility into system health, performance, and errors across the full stack. This guide covers error tracking, uptime monitoring, alerting, and incident response procedures.
Why Monitoring Matters:
- Detect issues before users do - Proactive alerts prevent customer impact
- Reduce mean time to resolution (MTTR) - Faster debugging with detailed error context
- Track reliability metrics - Measure uptime, error rates, and performance
- Ensure compliance - Audit logs and incident tracking for security/compliance
Monitoring Stack:
- Error Monitoring: Sentry (backend + frontend)
- Uptime Monitoring: UptimeRobot (4 monitors, 5-minute intervals)
- Deployment Platforms: Railway (backend) + Vercel (frontend)
- Future Enhancement: In-app monitoring dashboard widgets
Quick Reference Card
Production URLs
- Frontend: https://dutycall.vercel.app
- Backend API: https://dutycall-production.up.railway.app
- Sentry Dashboard: https://sentry.io
- UptimeRobot Dashboard: https://uptimerobot.com/dashboard
Emergency Contacts
- Primary On-Call: [Contact project lead for details]
- Escalation: [Contact project lead for details]
Status at a Glance
- Sentry Projects:
dutycall-backend,dutycall-frontend - UptimeRobot Status: [View dashboard for current status]
Target SLAs
- Uptime: 99.9% (43 minutes downtime/month max)
- Error Rate: < 1% of requests
- API Response Time: < 500ms average
- MTTR (Critical): < 1 hour
1. Error Monitoring (Sentry)
- 👨💻 Human Developer
- 🤖 AI Agent
What is Sentry?
Sentry is a real-time error tracking platform that captures exceptions, crashes, and performance issues across your application stack. When an error occurs in production, Sentry:
- Captures the error with full stack trace and context
- Groups similar errors to avoid alert fatigue
- Notifies the team via email, Slack, or other channels
- Provides debugging context - user actions, environment, release version
- Tracks error trends over time to identify regressions
Why we use Sentry:
- Catch errors in production that don't occur in development
- Debug issues without user reports (proactive monitoring)
- Track error resolution and verify fixes deployed successfully
- Monitor performance bottlenecks and slow transactions
Our Sentry Projects
We maintain two separate Sentry projects:
Backend Project: dutycall-backend
- Technology: Laravel 11 (PHP 8.2+)
- Monitors: API endpoints, database queries, background jobs
- Integration: Sentry Laravel SDK
- Environment Variable:
SENTRY_LARAVEL_DSN
Frontend Project: dutycall-frontend
- Technology: Next.js 15 (React, TypeScript)
- Monitors: UI errors, React errors, API client errors
- Integration: Sentry Next.js SDK with source maps
- Environment Variable:
NEXT_PUBLIC_SENTRY_DSN
Accessing Sentry
- Login: Visit https://sentry.io and login with your credentials
- Select Project: Choose
dutycall-backendordutycall-frontend - Dashboard: View error trends, recent issues, and performance metrics
Required Permissions: Developer access or higher (contact admin for access)
Key Features We Use
Real-Time Error Tracking
Every unhandled exception is automatically captured and sent to Sentry with:
- Full stack trace showing exactly where the error occurred
- Request context (URL, HTTP method, headers)
- User context (if authenticated - user ID, email, role)
- Environment details (production vs local, server info)
Source Maps (Frontend)
For frontend errors, Sentry uploads source maps during build to show:
- Original TypeScript/React code (not minified JavaScript)
- Exact line numbers in your source files
- Component names and function names
This makes debugging production errors as easy as debugging locally.
Performance Monitoring
Track slow database queries, API calls, and page loads:
- Transactions: Track complete request lifecycles
- Spans: Break down transactions into steps (DB query, API call, etc.)
- LCP/FID/CLS: Core Web Vitals for frontend performance
Session Replay (Frontend)
Watch a video replay of user sessions leading up to an error:
- See exactly what the user clicked
- View network requests and console logs
- Understand the context of the error
Privacy Note: Session replay is configured to mask sensitive data (passwords, credit cards, etc.)
Alert Notifications
Receive immediate notifications when errors occur:
- Email: Instant alerts for new error types
- Slack (optional): Team channel notifications
- Alert Rules: Custom thresholds (e.g., alert if error rate > 10/minute)