Skip to main content

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

Sentry Alerts & Issue Ownership Setup Guide

Overview

This guide helps you configure alerts and issue ownership in your Sentry dashboard to maximize the value of error tracking.

1. Setting Up Alerts

  1. Go to your Sentry project: https://sentry.io/organizations/goldfish-io/alerts/
  2. Click "Create Alert"

Critical Error Alert

Type: Issue Alert

When: An issue is first seen
If: The issue is unhandled AND level is error
Then: Send email to engineering@goldfish.io

High Error Rate Alert

Type: Metric Alert

When: Error rate is above 5% for 5 minutes
Environment: production
Then: Send Slack notification to #alerts channel

Performance Degradation Alert

When: p95 transaction duration > 3 seconds
For: user-flow.* transactions
Environment: production
Then: Send email to engineering@goldfish.io

Failed Cron Job Alert

When: Cron monitor weekly-build-health-check fails
Then: Send Slack notification to #devops channel

Authentication Failures Spike

When: Event count > 50 in 10 minutes
Filter: transaction = "user-flow.authentication" AND status = "internal_error"
Then: Send PagerDuty alert

2. Issue Ownership Rules

  1. Go to Settings → Projects → ocean → Issue Owners
  2. Click "Add Rule"

Ownership Rules by Path

# Frontend Routes
path:src/routes/login.tsx #team-frontend @jane.doe
path:src/routes/dashboard/* #team-frontend @john.smith
path:src/components/ui/* #team-design @design.lead

# Backend Services
path:supabase/functions/handle-stripe-* #team-billing @billing.lead
path:supabase/functions/graphql-v2/* #team-backend @backend.lead

# Authentication & Security
path:src/services/auth.ts #team-security @security.lead
path:src/lib/jwt-verifier.ts #team-security @security.lead

# Performance Monitoring
transaction:user-flow.billing #team-billing
transaction:user-flow.authentication #team-security
transaction:user-flow.onboarding #team-product

Ownership Rules by Tags

# By User Plan
tags.user.plan:pro #team-customer-success
tags.user.plan:enterprise #team-enterprise @account.manager

# By Feature Area
tags.feature:billing #team-billing
tags.feature:authentication #team-security

# By Error Type
level:error url:*stripe.com* #team-billing
level:error message:"GraphQL Error" #team-backend

3. Slack Integration

Setup Slack Integration

  1. Go to Settings → Integrations → Slack
  2. Click "Add Workspace"
  3. Authorize Sentry

Configure Alert Channels

#alerts          - All production errors
#alerts-billing - Billing/Stripe issues
#alerts-security - Auth failures, suspicious activity
#alerts-perf - Performance degradation

4. Alert Fatigue Prevention

Smart Alerting Strategies

  1. Use Alert Conditions

    Only alert if:
    - Error affects > 10 unique users
    - Error occurred > 100 times in 1 hour
    - Error is new (first seen)
  2. Time-based Suppression

    - Mute alerts during deployment windows
    - Different thresholds for business hours vs off-hours
  3. Grouping Similar Issues

    - Use fingerprinting to group related errors
    - Aggregate by transaction or URL pattern

5. Dashboard Configuration

Create Custom Dashboards

  1. Executive Dashboard

    • Error rate trend
    • User impact (affected users)
    • Top errors by frequency
    • Performance overview
  2. Developer Dashboard

    • Recent errors by owner
    • Unresolved issues assigned to me
    • Performance by transaction
    • Release health
  3. On-Call Dashboard

    • Real-time error feed
    • Critical alerts status
    • System health indicators
    • Recent deployments

6. Best Practices

  1. Start Conservative

    • Begin with fewer, high-value alerts
    • Add more as you understand patterns
  2. Regular Review

    • Weekly review of alert effectiveness
    • Adjust thresholds based on false positives
    • Archive resolved ownership rules
  3. Clear Escalation

    • Define who gets alerted when
    • Have backup contacts for critical alerts
    • Document response procedures
  4. Use Alert Budgets

    • Max 5 alerts per developer per day
    • Critical alerts should be < 1 per week
    • Review if exceeding budgets

7. Monitoring Your Monitors

Set up meta-alerts to track:

  • Alert volume (too many/too few)
  • Response time to alerts
  • False positive rate
  • Unassigned issues

Example Alert Workflow

  1. Error Occurs → Sentry captures
  2. Ownership Rule → Assigns to team/person
  3. Alert Triggered → Notification sent
  4. Developer Responds → Acknowledges in Sentry
  5. Fix Deployed → Linked to release
  6. Alert Resolved → Automatically closed

Remember: Good alerting finds the balance between visibility and noise!