Skip to content

brainz-lab/signal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

109 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Signal

Unified alerting and notifications for all BrainzLab products.

CI CodeQL codecov License: OSAaSy Ruby

Quick Start

# With Docker Compose (from brainzlab root)
docker-compose --profile signal up

# Access at http://localhost:4005

Installation

With Docker Compose

From the brainzlab root directory:

docker-compose --profile signal up

Standalone Development

cd signal
bundle install
bin/rails db:create db:migrate
bin/rails server -p 4005

Configuration

Variable Description Default
DATABASE_URL PostgreSQL connection -
REDIS_URL Redis for Sidekiq redis://localhost:6379/0
FLUX_URL Flux service URL http://flux:3000
PULSE_URL Pulse service URL http://pulse:3000
REFLEX_URL Reflex service URL http://reflex:3000
RECALL_URL Recall service URL http://recall:3000
SIGNAL_URL Public URL for links https://signal.brainzlab.ai

Features

  • Alert Rules - Threshold, anomaly detection, absence detection, composite rules
  • Data Sources - Integrates with Flux (metrics), Pulse (APM), Reflex (errors), Recall (logs)
  • Notification Channels - Slack, PagerDuty, Email, Webhook, Discord, Microsoft Teams, Opsgenie
  • Incidents - Automatic incident grouping with timeline tracking
  • Escalation Policies - Multi-step escalation with configurable delays
  • On-call Schedules - Weekly and rotation-based scheduling
  • Maintenance Windows - Scheduled alert muting

Usage

Creating an Alert Rule

POST /api/v1/rules
{
  "rule": {
    "name": "High Error Rate",
    "source": "reflex",
    "source_name": "error_count",
    "rule_type": "threshold",
    "operator": "gt",
    "threshold": 100,
    "window": "5m",
    "severity": "critical",
    "notify_channels": ["<channel-uuid>"]
  }
}

Setting Up Notification Channels

Slack

POST /api/v1/channels
{
  "channel": {
    "name": "ops-alerts",
    "channel_type": "slack",
    "config": {
      "webhook_url": "https://hooks.slack.com/...",
      "channel": "#ops"
    }
  }
}

PagerDuty

POST /api/v1/channels
{
  "channel": {
    "name": "pagerduty-critical",
    "channel_type": "pagerduty",
    "config": {
      "routing_key": "your-routing-key",
      "severity_map": {
        "critical": "critical",
        "warning": "warning"
      }
    }
  }
}

Architecture

Signal
├── Alert Rules      # Define conditions for alerts
├── Alerts          # Active alert instances
├── Incidents       # Groups related alerts
├── Channels        # Notification destinations
├── Policies        # Escalation configurations
├── Schedules       # On-call rotations
└── Windows         # Maintenance periods

Background Jobs

  • RuleEvaluationJob - Evaluates all active rules (runs every minute)
  • NotificationJob - Sends notifications to channels
  • EscalationJob - Handles escalation steps
  • DigestJob - Sends periodic alert digests
  • CleanupJob - Removes old alerts and history

API Reference

Alerts

  • GET /api/v1/alerts - List alerts
  • POST /api/v1/alerts/:id/acknowledge - Acknowledge alert

Rules

  • GET /api/v1/rules - List alert rules
  • POST /api/v1/rules - Create rule
  • POST /api/v1/rules/:id/mute - Mute rule

Channels

  • GET /api/v1/channels - List notification channels
  • POST /api/v1/channels/:id/test - Test channel

Incidents

  • GET /api/v1/incidents - List incidents

MCP Tools

Tool Description
signal_list_alerts List active alerts
signal_acknowledge Acknowledge an alert
signal_create_rule Create alert rule
signal_mute Mute a rule
signal_incidents List incidents

Full documentation: docs.brainzlab.ai/products/signal

Self-Hosting

Docker Compose

services:
  signal:
    image: brainzllc/signal:latest
    ports:
      - "4005:3000"
    environment:
      DATABASE_URL: postgres://user:pass@db:5432/signal
      REDIS_URL: redis://redis:6379/0
      FLUX_URL: http://flux:3000
      PULSE_URL: http://pulse:3000
      REFLEX_URL: http://reflex:3000
      RECALL_URL: http://recall:3000
    depends_on:
      - db
      - redis

Testing

bin/rails test
bin/rubocop

Contributing

See CONTRIBUTING.md for development setup and contribution guidelines.

License

This project is licensed under the OSAaSy License.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

 
 
 

Contributors