Alerts & Notifications

    Configure real-time alerts for errors and performance issues.

    Stay informed about issues in your application with ActiveRabbit's flexible alerting system. Get notified through Slack, email, PagerDuty, or webhooks.

    Alert Types

    Error Alerts

    • New Error - First occurrence of an error type
    • Regression - Previously resolved error reoccurs
    • Spike - Error count exceeds threshold
    • High Impact - Error affecting many users

    Performance Alerts

    • Slow Response - P95 latency exceeds threshold
    • Apdex Drop - User satisfaction score drops
    • Throughput Change - Traffic anomaly detected
    • Database Issue - Slow queries or N+1 detected

    Notification Channels

    Slack Integration

    # 1. Install the Slack app from the dashboard
    #    Settings → Integrations → Slack → Install
    
    # 2. Configure channels for different alert types
    # 
    # #errors-critical   → New errors, regressions (P1)
    # #errors-warnings   → Error spikes, high impact (P2)
    # #performance       → Latency, Apdex alerts

    Slack notifications include:

    • Error summary with stack trace preview
    • Quick link to full error details
    • Action buttons: Resolve, Ignore, Assign
    • AI-generated fix suggestion (when available)

    Email Notifications

    # Configure email alerts in the dashboard
    # Settings → Notifications → Email
    #
    # Options:
    # - Immediate: Send as errors occur
    # - Digest: Daily/weekly summary
    # - Threshold: Only when count exceeds N

    PagerDuty Integration

    # Connect PagerDuty for on-call alerting
    # Settings → Integrations → PagerDuty
    #
    # Configure:
    # - Service key
    # - Severity mapping (Error level → PD severity)
    # - Auto-resolve when error is resolved

    Webhooks

    # Send alerts to any HTTP endpoint
    # Settings → Integrations → Webhooks
    
    # Webhook payload example:
    {
      "event": "error.new",
      "timestamp": "2024-01-15T10:30:00Z",
      "error": {
        "id": "err_abc123",
        "type": "NoMethodError",
        "message": "undefined method 'name' for nil",
        "count": 1,
        "users_affected": 1,
        "url": "https://app.activerabbit.ai/errors/err_abc123"
      },
      "project": {
        "id": "proj_xyz",
        "name": "MyApp"
      }
    }

    Alert Rules

    Creating Custom Rules

    # In the dashboard: Alerts → New Rule
    
    # Example: Alert when checkout errors spike
    # 
    # Conditions:
    #   - Tag: feature = "checkout"
    #   - Error count > 10 in 5 minutes
    #   - Environment: production
    #
    # Actions:
    #   - Send to #checkout-team Slack channel
    #   - Send to PagerDuty (High urgency)
    #   - Send email to [email protected]

    Rule Conditions

    ConditionDescriptionExample
    error.countNumber of occurrences> 100 in 1 hour
    error.usersUnique users affected> 50 users
    error.typeException class= 'Stripe::CardError'
    error.tagCustom tag valuefeature = 'payments'
    perf.p9595th percentile latency> 2000ms
    perf.apdexApdex score< 0.8

    Programmatic Alerts

    # Trigger alerts from code
    ActiveRabbit.alert(
      title: "Payment processing failed",
      message: "Stripe webhook returned error: #{error.message}",
      severity: :critical,
      tags: {
        feature: 'payments',
        payment_id: payment.id
      }
    )
    
    # With custom notification routing
    ActiveRabbit.alert(
      title: "Daily limit exceeded",
      severity: :warning,
      notify: ['#billing-team', '[email protected]']
    )

    Alert Fatigue Prevention

    Deduplication

    # Alerts are deduplicated by default
    # Same error won't trigger multiple alerts within cooldown period
    
    # Configure cooldown (in dashboard):
    # - Default: 1 hour
    # - Per rule: 5 minutes to 24 hours

    Quiet Hours

    # Set quiet hours for non-critical alerts
    # Settings → Notifications → Quiet Hours
    #
    # During quiet hours:
    # - Critical alerts: Always sent
    # - High: Sent after 30 min if unresolved
    # - Medium/Low: Batched for morning digest

    Smart Batching

    # Group related alerts together
    # 
    # Instead of 50 separate alerts:
    # "🔴 Error spike detected
    #  
    #  50 new errors in the last 5 minutes:
    #  - NoMethodError (23)
    #  - ActiveRecord::RecordNotFound (15)
    #  - Timeout::Error (12)
    #  
    #  Common factor: All from /api/v1/orders endpoint"

    On-Call Schedules

    # Integrate with your on-call rotation
    # Settings → On-Call → Configure Schedule
    #
    # Supports:
    # - PagerDuty schedules
    # - Opsgenie
    # - Custom webhook with @oncall mention

    Alert History

    View and analyze past alerts:

    • Timeline view - See all alerts chronologically
    • Correlation - Link alerts to deployments
    • Statistics - MTTR, alert frequency, resolution rates
    • Export - Download for analysis

    🔔 Alerting Best Practices

    • Start with fewer, high-signal alerts and add more as needed
    • Use different channels for different severities
    • Set up quiet hours to prevent overnight noise
    • Review and tune alert thresholds monthly