Vercel monitoring
Vercel provides built-in monitoring for both services.Function logs
Access real-time and historical function logs:Access project logs
- Go to Vercel Dashboard
- Select your project (API or Web)
- Click Deployments
- Select a deployment
- Click Functions tab
View function execution
For each serverless function, you can see:
- Execution count
- Error rate
- Average duration
- Memory usage
- Individual invocation logs
Runtime logs
Access runtime logs via Vercel CLI:Deployment status
Monitor deployment health:- Build logs - Check for compilation errors
- Function builds - Verify all functions compiled successfully
- Deployment state - Ensure deployment is READY
Application monitoring
Health check endpoints
Implement health check endpoints for uptime monitoring: API health check:api/health.ts
Key metrics to monitor
API service metrics
- Response times - Track P50, P95, P99 latencies
- Error rates - Monitor 4xx and 5xx responses
- Function duration - Watch for timeout risks
- Anchor sync status - Track cron job success rate
- Database query performance - Monitor slow queries
Web service metrics
- Page load times - Core Web Vitals (LCP, FID, CLS)
- API request failures - Track frontend → backend errors
- User session errors - JavaScript exceptions
- Conversion rates - Payment completion rates
Database monitoring
Monitor your Supabase database:Access Supabase metrics
- Go to Supabase Dashboard
- Select your project
- Click Database → Query Performance
Key metrics to watch
- Active connections - Ensure you’re not hitting connection limits
- Query performance - Identify slow queries
- Database size - Track growth and plan for scaling
- Table sizes - Monitor
anchors_catalogandanchor_callback_events
Anchor catalog health
Monitor anchor catalog synchronization: Check operational anchors:Cron job monitoring
Vercel cron logs
Monitor cron job execution:Access cron logs
- Go to API project in Vercel Dashboard
- Click Settings → Cron Jobs
- View scheduled jobs and execution history
Manual cron testing
Test cron endpoints manually:Alerting on cron failures
Set up alerts for cron job failures:- Vercel Notifications - Enable email alerts for failed deployments
- Custom webhook - Send cron results to a monitoring service
- Database check - Monitor
last_checked_attimestamps
Error tracking
Implement structured logging
API service logging:Common error patterns
Monitor for these error patterns: API errors:SUPABASE_CONNECTION_ERROR- Database connectivity issuesSTELLAR_NETWORK_ERROR- Stellar Horizon API failuresANCHOR_TIMEOUT- Anchor API timeout errorsINVALID_STELLAR_TOML- Anchor configuration errors
API_REQUEST_FAILED- Backend API unreachableWALLET_CONNECTION_FAILED- Freighter wallet issuesINVALID_NETWORK- Wrong Stellar network selected
Performance monitoring
API response times
Track endpoint performance:Database query performance
Monitor slow queries in Supabase:Stellar network performance
Monitor Stellar Horizon API latency:- Test endpoint:
https://horizon.stellar.org/ - Track response times for account queries
- Monitor transaction submission times
Uptime monitoring
External monitoring services
Use external services to monitor uptime: Recommended services:- UptimeRobot - Free tier available
- Pingdom - Comprehensive monitoring
- Better Uptime - Modern uptime monitoring
Status page
Create a public status page:- Use Statuspage.io
- Or build a custom status dashboard
- Show API, database, and cron job status
Alerting
Critical alerts
Set up alerts for critical issues:Alert channels
Vercel notifications:- Go to project Settings → Notifications
- Enable email alerts for deployment failures
- Send alerts to Slack, Discord, or PagerDuty
- Configure in Vercel integrations or custom code
Debugging tools
Vercel CLI debugging
Database debugging
Check anchor catalog state:Stellar network debugging
Test Horizon connectivity:Best practices
Set up alerting thresholds
Define alert thresholds based on:
- Historical performance data
- Business SLAs
- User impact severity
Create runbooks
Document response procedures for common issues:
- API service down
- Database connection failures
- Anchor sync failures
- High error rates
Monitor user journeys
Track key user flows:
- Payment route comparison
- Payment execution
- Proof generation
- Wallet connection
Security monitoring
Monitor for suspicious activity
- Unusual request patterns - Spike in errors from single IP
- Failed authentication attempts - Multiple failed cron secret attempts
- Data exfiltration - Large data exports
- Configuration changes - Unexpected environment variable updates
Audit logs
Enable audit logging for:- Supabase admin operations
- Vercel project configuration changes
- Environment variable updates
- Production deployments