This document outlines the recommended Sentry alert configuration for Protocol Guide production monitoring.
- Create a Sentry account at https://sentry.io
- Create a new project for Protocol Guide (Node.js)
- Get your DSN from Project Settings > Client Keys (DSN)
- Set
SENTRY_DSNenvironment variable in production
# Production .env
SENTRY_DSN=https://your-key@o12345.ingest.sentry.io/67890Triggers when there's a sudden increase in errors, indicating a potential incident.
Settings:
- Name: Critical Error Spike
- Environment: production
- Trigger: When error count increases by 300% in 10 minutes compared to the previous hour
- Action: Send to PagerDuty/Slack/Email (high priority)
- Filter: Exclude rate limit errors
{
"name": "Critical Error Spike",
"conditions": [
{
"id": "sentry.rules.conditions.event_frequency.EventFrequencyPercentCondition",
"interval": "10m",
"comparisonInterval": "1h",
"value": 300
}
],
"filters": [
{
"id": "sentry.rules.filters.tagged_event.TaggedEventFilter",
"key": "code",
"match": "ne",
"value": "rate_limit"
}
],
"actions": [
{
"id": "sentry.integrations.slack.notify_action.SlackNotifyServiceAction",
"channel": "#alerts-critical"
}
]
}Triggers when database connection errors occur, indicating infrastructure issues.
Settings:
- Name: Database Connectivity Issues
- Environment: production
- Trigger: When an error contains "database" or "ECONNREFUSED" in the message
- Action: Send to infrastructure channel
- Threshold: More than 5 occurrences in 5 minutes
{
"name": "Database Connectivity Issues",
"conditions": [
{
"id": "sentry.rules.conditions.event_frequency.EventFrequencyCondition",
"interval": "5m",
"value": 5
}
],
"filters": [
{
"id": "sentry.rules.filters.issue_occurrences.IssueOccurrencesFilter",
"value": 5
},
{
"id": "sentry.rules.filters.tagged_event.TaggedEventFilter",
"key": "error.type",
"match": "co",
"value": "database"
}
]
}Triggers when Claude/Gemini APIs are having issues (Voyage removed 2026-03-24).
Settings:
- Name: AI Service Degradation
- Environment: production
- Trigger: Errors with code CLAUDE_* or GEMINI_*
- Action: Send to engineering channel
- Threshold: More than 10 occurrences in 10 minutes
{
"name": "AI Service Degradation",
"conditions": [
{
"id": "sentry.rules.conditions.event_frequency.EventFrequencyCondition",
"interval": "10m",
"value": 10
}
],
"filters": [
{
"id": "sentry.rules.filters.tagged_event.TaggedEventFilter",
"key": "code",
"match": "sw",
"value": "CLAUDE_"
}
]
}Monitors for potential security issues or auth system problems.
Settings:
- Name: Authentication Failures
- Environment: production
- Trigger: High volume of 401/403 errors
- Action: Send to security channel
- Threshold: More than 50 occurrences in 15 minutes (could indicate attack)
Triggers when response times exceed acceptable thresholds.
Settings:
- Name: High Latency Detected
- Environment: production
- Trigger: Average transaction duration > 5 seconds
- Action: Send to performance channel
- Go to Sentry > Settings > Integrations > Slack
- Connect your Slack workspace
- Create channels:
#alerts-critical- PagerDuty integration for on-call#alerts-engineering- Engineering team notifications#alerts-security- Security-related alerts
- Go to Sentry > Settings > Integrations > PagerDuty
- Connect your PagerDuty account
- Map Sentry projects to PagerDuty services
- Set escalation policies for critical alerts
- Go to Sentry > Settings > Integrations > Email
- Configure email addresses for different alert severities
- Set up digest emails for non-critical issues
Enable performance monitoring to track:
- API response times
- Database query performance
- External API latency (Claude, Gemini)
// Already configured in server/_core/sentry.ts
tracesSampleRate: ENV.isProduction ? 0.1 : 1.0,Protocol Guide automatically adds these tags to errors:
| Tag | Description | Example Values |
|---|---|---|
section |
App section where error occurred | search, voice, protocol_viewer |
platform |
Client platform | web, ios, android |
tier |
User subscription tier | free, pro, premium |
code |
Error code | CLAUDE_RATE_LIMITED, GEMINI_TIMEOUT |
Create a Sentry dashboard with:
- Error Rate Over Time - Line chart showing error count
- Top Issues - Table of most frequent errors
- User Impact - Number of users affected
- Service Health - Circuit breaker states
- Response Times - P50, P95, P99 latencies
- Check
/api/healthendpoint for service status - Check
/api/resiliencefor circuit breaker states - Review recent deployments
- Check external service status (Supabase, Claude, Gemini)
- Check Supabase status page
- Verify connection pool status
- Check for slow queries in Supabase dashboard
- Review circuit breaker state for database
- Check Anthropic/Google AI status pages
- Verify API keys are valid
- Check rate limit headers in responses
- Consider enabling fallback responses
To test that alerts are working:
// In development, temporarily enable error reporting:
// EXPO_PUBLIC_REPORT_DEV_ERRORS=true
// Then trigger a test error:
captureMessage('Test alert - please ignore', 'error');During planned maintenance:
- Set up a maintenance window in Sentry
- Temporarily mute non-critical alerts
- Update status page
- Re-enable alerts after maintenance
For questions about Sentry configuration, contact the Platform team.