Skip to main content

Source: ocean/docs/setup-sentry-alerts.md | ✏️ Edit on GitHub

Quick Sentry Alert Setup

1. First, ensure Slack is connected to Sentry

Go to: https://sentry.io/settings/YOUR_ORG/integrations/slack/

If not connected:

  • Click "Add Workspace"
  • Select "Goldfish" workspace
  • Authorize

2. Create Critical Alerts (Do these first!)

pg_net Critical Alert

  1. Go to: Alerts → Create Alert → Issue Alert
  2. Set:
    • Name: 🚨 pg_net Critical Backlog
    • Environment: production
    • When: ALL conditions match:
      • An event is seen
      • Event message contains: pg_net backlog
      • Event tags match: pg_net_status = critical
    • Then: Send Slack to #alerts-critical
    • Rate limit: Once per 5 minutes

Stripe Payment Failed Alert

  1. Create New Alert → Issue Alert
  2. Set:
    • Name: 💳 Payment Processing Failed
    • Environment: production
    • When: ALL conditions match:
      • Level = Error
      • Message contains: payment failed OR stripe OR tags match payment_error = true
    • Then: Send Slack to #alerts-critical
    • Rate limit: Once per minute

Stripe Webhook Failed Alert

  1. Create New Alert → Issue Alert
  2. Set:
    • Name: 🔄 Stripe Webhook Failed
    • When: ALL conditions match:
      • Level = Error
      • Message contains: webhook
      • Message contains: stripe
    • Then: Send Slack to #alerts-critical
    • Rate limit: Once per 10 minutes

3. Test Your Alerts

Run this in your browser console on your app:

// Test pg_net alert
Sentry.captureMessage('CRITICAL: pg_net backlog detected - 15000 items in queue', {
level: 'error',
tags: {
pg_net_status: 'critical',
queue_size: 15000,
},
})

// Test Stripe alert
Sentry.captureException(new Error('Test: Stripe payment failed'), {
level: 'error',
tags: {
payment_error: true,
test: true,
},
})

4. Verify in Slack

You should see alerts in your configured channels within 1-2 minutes.

Your Current Setup Status

✅ pg_net monitoring sending to Sentry (every 5 minutes) ✅ Slack webhook configured and working ✅ Sentry DSN in production ⏳ Need to create alert rules in Sentry UI

Important Tags Being Sent

  • pg_net_status: 'critical' | 'warning'
  • db_slow_query: true
  • payment_error: true
  • webhook_error: true

These tags are what Sentry uses to route alerts!