Monitoring and Analytics Setup
Complete guide for setting up monitoring, error tracking, and analytics for Dashtray.Overview
This guide covers:- Error tracking with Sentry
- Uptime monitoring
- Performance monitoring
- Usage analytics
- Alert configuration
1. Error Tracking (Sentry)
1.1 Create Sentry Account
- Sign up at sentry.io
- Create a new organization: “Dashtray”
- Create a new project:
- Platform: SvelteKit
- Name: “dashtray-production”
1.2 Install Sentry SDK
1.3 Configure Sentry
Createsrc/hooks.client.ts:
src/hooks.server.ts:
1.4 Add Sentry to Convex
In Convex functions, log errors to Sentry:1.5 Configure Alerts
In Sentry dashboard:- Go to Alerts → Create Alert
- Configure alert rules:
- High error rate: > 10 errors in 5 minutes
- New error: First occurrence of an error
- Regression: Error that was resolved returns
- Set notification channels:
- Slack
- PagerDuty (for critical alerts)
1.6 Set Up Releases
Track deployments in Sentry:2. Uptime Monitoring
2.1 UptimeRobot (Free)
- Sign up at uptimerobot.com
- Create monitors:
- Type: HTTPS
- URL:
https://dashtray.com - Interval: 5 minutes
- Alert contacts: Email, Slack
- Type: HTTPS
- URL:
https://dashtray.com/api/health - Interval: 5 minutes
- Alert contacts: Email, Slack
- Type: HTTPS
- URL:
https://your-deployment.convex.site/api/health - Interval: 5 minutes
- Alert contacts: Email, Slack
2.2 Create Health Check Endpoint
2.3 Configure Alerts
In UptimeRobot:- Go to Alert Contacts
- Add contacts:
- Email: ops@dashtray.com
- Slack webhook
- SMS (for critical alerts)
- Set alert thresholds:
- Alert after: 2 failed checks
- Alert frequency: Every 5 minutes until resolved
3. Performance Monitoring
3.1 Convex Dashboard
- Go to Convex Dashboard
- Select your production deployment
- Monitor:
- Function execution times
- Database query performance
- Cron job status
- Error rates
3.2 Set Up Convex Alerts
In Convex dashboard:- Go to Settings → Alerts
- Configure alerts:
- Function duration > 5s
- Database query time > 1s
- Error rate > 1%
- Cron job failures
3.3 Cloudflare Analytics
- Go to Cloudflare Pages dashboard
- View analytics:
- Page views
- Unique visitors
- Bandwidth usage
- Response times
- Error rates (4xx, 5xx)
3.4 Web Vitals Monitoring
Add Web Vitals tracking:src/routes/+layout.svelte:
4. Usage Analytics
4.1 Plausible Analytics (Privacy-Friendly)
- Sign up at plausible.io
- Add your domain:
dashtray.com - Get tracking script
src/app.html:
4.2 Track Custom Events
4.3 Convex Usage Tracking
Track usage in Convex:5. Business Metrics Dashboard
5.1 Key Metrics to Track
User Metrics:- Total users
- Active users (DAU, WAU, MAU)
- New signups per day
- Churn rate
- User retention
- MRR (Monthly Recurring Revenue)
- ARR (Annual Recurring Revenue)
- ARPU (Average Revenue Per User)
- Conversion rate (Free → Paid)
- Churn rate
- Integrations connected per user
- Dashboards created per user
- Alerts created per user
- API usage (Scale+ users)
- Feature adoption rates
- Error rate
- Response time (p50, p95, p99)
- Uptime percentage
- Database query performance
- Function execution time
5.2 Create Analytics Dashboard
Use Convex queries to aggregate metrics:5.3 Visualize Metrics
Create an internal admin dashboard:6. Log Aggregation
6.1 Convex Logs
View logs in real-time:6.2 Structured Logging
Use structured logging in Convex:7. Alert Configuration
7.1 Critical Alerts (PagerDuty)
For critical issues that require immediate attention:- Sign up at pagerduty.com
- Create service: “Dashtray Production”
- Set up escalation policy
- Integrate with Sentry and UptimeRobot
- Site down (> 5 minutes)
- Error rate > 5%
- Payment processing failures
- Database connection failures
7.2 Warning Alerts (Slack)
For issues that need attention but aren’t critical:- Create Slack channel:
#dashtray-alerts - Add incoming webhook
- Configure integrations to post to Slack
- Error rate > 1%
- Response time > 2s
- Webhook failures
- Sync failures
- Low disk space
7.3 Info Alerts (Email)
For informational notifications: Info alerts:- Daily metrics summary
- Weekly usage report
- Monthly revenue report
- New user signups (digest)
8. Status Page
8.1 Create Status Page
Use statuspage.io or self-host:- Create status page:
status.dashtray.com - Add components:
- Website
- API
- Integrations
- Payments
- Configure automated updates from UptimeRobot
8.2 Incident Management
When incidents occur:- Detect: Monitoring alerts
- Acknowledge: Team member acknowledges
- Investigate: Diagnose the issue
- Update status page: Keep users informed
- Resolve: Fix the issue
- Post-mortem: Document and learn
9. Monitoring Checklist
Daily
- Check error rates in Sentry
- Review Convex logs for errors
- Check uptime status
- Monitor response times
- Review user feedback
Weekly
- Review performance trends
- Check for slow queries
- Review security alerts
- Analyze usage patterns
- Check for dependency updates
Monthly
- Review all metrics
- Analyze user growth
- Review revenue metrics
- Check infrastructure costs
- Plan optimizations
10. Dashboards
10.1 Operations Dashboard
Create a dashboard with:- Current error rate
- Response times (p50, p95, p99)
- Active users
- Recent errors
- System health
10.2 Business Dashboard
Create a dashboard with:- MRR/ARR
- User growth
- Conversion rates
- Churn rate
- Feature adoption
10.3 Technical Dashboard
Create a dashboard with:- Function execution times
- Database query performance
- API usage
- Webhook success rates
- Integration health
Need Help?
- Sentry Docs: docs.sentry.io
- UptimeRobot Docs: uptimerobot.com/help
- Convex Monitoring: docs.convex.dev/production/monitoring
- Cloudflare Analytics: developers.cloudflare.com/analytics