Monitoring¶
Observability setup for the Freeze Design webshop.
Monitoring Stack¶
| Tool | Purpose | Dashboard |
|---|---|---|
| Sentry | Error tracking | sentry.io/freezedesign |
| PostHog | Product analytics | eu.posthog.com |
| Upptime | Uptime monitoring | GitHub Pages |
📊 PostHog Setup: See the full PostHog Analytics Guide for configuration, custom events, feature flags, and A/B testing.
Sentry Setup¶
Backend Errors¶
Sentry captures all Django errors automatically:
View errors at: Sentry Dashboard → Issues
Frontend Errors¶
Next.js errors are captured via @sentry/nextjs:
// sentry.client.config.ts
Sentry.init({
dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
tracesSampleRate: 0.1,
});
Error Alerts¶
Configure alerts in Sentry:
- Go to Settings → Alerts
- Create alert rule
- Set conditions (e.g., new errors)
- Configure notifications (email, Slack)
Uptime Monitoring¶
GitHub Actions checks endpoints every 5 minutes:
Monitored Endpoints¶
| Endpoint | Expected Status |
|---|---|
| https://api.freezedesign.nl/api/products/ | 200 |
| https://www.freezedesign.nl/ | 200 |
Status Page¶
Public status page at: https://freezedesign.github.io/upptime/
Application Logs¶
View Backend Logs¶
# Docker logs
docker logs backend --tail 100 -f
# Application logs
docker exec backend tail -f /app/logs/django.log
Log Levels¶
| Level | Use Case |
|---|---|
| DEBUG | Development only |
| INFO | Normal operations |
| WARNING | Unexpected but handled |
| ERROR | Errors requiring attention |
| CRITICAL | Service affecting |
Health Checks¶
Backend Health¶
Response:
Frontend Health¶
Performance Monitoring¶
Sentry Performance¶
Enable transaction tracing:
View in: Sentry → Performance
Key Metrics¶
| Metric | Target | Alert Threshold |
|---|---|---|
| Response time (p95) | < 500ms | > 2000ms |
| Error rate | < 0.1% | > 1% |
| Uptime | > 99.9% | < 99% |
Runbook: High Error Rate¶
- Check Sentry for new errors
- Review recent deployments
- Check infrastructure status
- If needed, rollback deployment
Runbook: Slow Response Times¶
- Check database query performance
- Review cache hit rates
- Check for resource constraints
- Scale if needed