Skip to main content

Overview

Risk Legion includes built-in health monitoring endpoints and can integrate with external monitoring tools for comprehensive observability.

Built-in Health Checks

Health Endpoint

Response:

Docker Health Check

Configured in Dockerfile:

Uptime Monitoring

Using UptimeRobot

  1. Create account at uptimerobot.com
  2. Add monitors:
  1. Configure alerts (email, Slack, etc.)

Using Better Uptime

  1. Create account at betteruptime.com
  2. Add heartbeat monitors
  3. Configure status page (optional)

Error Tracking

Sentry Integration

Backend Setup

Frontend Setup

Alert Configuration

In Sentry Dashboard:
  1. Go to Alerts
  2. Create alert rules for:
    • Error spike detection
    • New issue alerts
    • Performance regression

Application Metrics

Prometheus Integration

Backend Metrics

Prometheus Configuration

Grafana Dashboards

Create dashboards for:
  • Request rate and latency
  • Error rate
  • Database query performance
  • Redis cache hit rate

Log Aggregation

Structured Logging

Log Output

Log Forwarding

Forward logs to:
  • AWS CloudWatch: Native EC2 integration
  • Datadog: Via agent or API
  • ELK Stack: Via Filebeat

Alerting

Alert Types

Notification Channels

Configure alerts via:
  • Email
  • Slack
  • PagerDuty
  • SMS (Twilio)

Example Slack Alert

Status Page

Using Atlassian Statuspage

  1. Create page at statuspage.io
  2. Add components:
    • API
    • Web Application
    • Database
    • Authentication
  3. Configure automation with API

Self-Hosted Option

Use Upptime for GitHub-powered status page.

Runbooks

API Unresponsive

  1. Check EC2 instance status
  2. SSH to instance
  3. Check Docker container: docker ps
  4. Check container logs: docker logs risk-legion-api
  5. Restart if needed: docker restart risk-legion-api

Database Connection Issues

  1. Check Supabase status
  2. Verify DATABASE_URL is correct
  3. Check connection pool status
  4. Restart application to reset connections

High Latency

  1. Check slow query logs
  2. Review recent deployments
  3. Check resource usage: docker stats
  4. Scale resources if needed

Checklist

  • Health endpoint configured
  • Uptime monitor active
  • Alert notifications set up
  • Sentry configured
  • Alert rules created
  • On-call rotation defined
  • Prometheus/metrics endpoint
  • Grafana dashboards
  • Performance baselines set
  • Structured logging enabled
  • Log aggregation configured
  • Log retention policy set