A robust, self-hosted uptime monitoring and observability platform
Monitor your infrastructure's health in real-time β’ Detect statistical anomalies β’ Get instant Telegram alerts
Features β’ Quick Start β’ Architecture β’ Deployment β’ Contributing
- Real-time Monitoring - HTTP(s) and TCP endpoint monitoring with configurable check intervals
- Predictive Anomaly Detection - Z-Score statistical analysis to detect latency spikes before they become outages
- Instant Alerts - Telegram notifications with "Magic Link" authentication
- Scalable Architecture - Dedicated Celery workers for check execution and alerting
- Interactive Dashboards - Response time heatmaps, uptime statistics, and performance leaderboards
- Self-Hosted - Full control over your monitoring data and infrastructure
StatusHawk uses an event-driven microservices architecture to separate monitoring logic from the web interface, ensuring the dashboard remains responsive even when monitoring thousands of endpoints.
graph TD
User[Browser / Client] -->|HTTPS| Ingress[K8s Ingress / Nginx]
subgraph Cluster [Kubernetes Cluster]
Ingress -->|/| Frontend[Frontend Pod <br/> React + Vite]
Ingress -->|/api| Backend[Backend Pod <br/> Django REST Framework]
Backend -->|Read/Write| DB[(PostgreSQL)]
Backend -->|Push Tasks| Redis[(Redis Broker)]
subgraph Workers [Background Workers]
Runner[Celery Runner] -->|Pop Check Tasks| Redis
Notifier[Celery Notification] -->|Pop Alert Tasks| Redis
end
end
subgraph External [External World]
Runner -->|HTTP/TCP Ping| TargetSites[Target Websites]
Notifier -->|API Call| Telegram[Telegram API]
end
Runner -- "Detects Latency Spike (Z-Score)" --> Redis
- React 19 with Vite for fast development
- Shadcn/UI + TailwindCSS for modern UI components
- TanStack Query (React Query) for data fetching
- Recharts for data visualization
- Python 3.12 + Django 6
- Django REST Framework for API endpoints
- Celery for asynchronous task processing
- NumPy/Statistics for anomaly detection algorithms
- PostgreSQL - Primary database
- Redis - Message broker and cache
- Docker & Docker Compose - Local development
- Kubernetes + Helm - Production deployment
- Docker & Docker Compose installed
- (Optional) Kubernetes cluster for production deployment
# Clone the repository
git clone https://github.com/yourusername/statushawk.git
cd statushawk
# Create environment file
cp .env.example .env
# Start all services
docker compose up -d --build
# Access the application
# Frontend: http://localhost:5173
# Backend API: http://localhost:8000/apiThe application will automatically:
- Run database migrations
- Create a superuser (admin/admin_password_123)
- Start Celery workers for monitoring and notifications
Best for local development and testing:
docker compose up -dProduction-ready deployment with auto-scaling and high availability:
Create my-secrets.yaml (do NOT commit this file):
telegram:
token: "YOUR_TELEGRAM_BOT_TOKEN"
django:
secretKey: "YOUR_SECURE_DJANGO_SECRET_KEY"
postgresql:
auth:
postgresPassword: "SECURE_DATABASE_PASSWORD"# Install or upgrade the release
helm upgrade --install statushawk ./infra/charts/statushawk \
-f ./infra/charts/statushawk/values.yaml \
-f my-secrets.yaml
# Check deployment status
kubectl get pods
kubectl get servicesFor Minikube:
# Get Minikube IP
minikube ip
# Add to /etc/hosts
echo "$(minikube ip) api.statushawk.local" | sudo tee -a /etc/hosts
# Access at http://api.statushawk.localFor production clusters, configure your DNS to point to the Ingress controller.
statushawk/
βββ services/
β βββ backend/ # Django Backend
β β βββ app/
β β β βββ monitor/ # Monitoring logic & services
β β β βββ notifications/ # Alert system
β β β βββ common/ # Shared utilities
β β βββ config/ # Django settings
β β βββ manage.py
β βββ frontend/ # React Frontend
β βββ src/
β β βββ components/ # UI components
β β βββ pages/ # Page components
β β βββ lib/ # Utilities
β βββ package.json
βββ infra/
β βββ charts/
β βββ statushawk/ # Helm chart
β βββ templates/ # K8s manifests
β βββ values.yaml # Configuration
βββ docker-compose.yaml # Local development
βββ README.md
# Run all tests
docker compose exec backend pytest
# Run with coverage
docker compose exec backend pytest --cov=app
# Run specific test module
docker compose exec backend pytest app/monitor/test/test_services.py- 194 total tests covering models, services, APIs, and integrations
- Monitor app: 120 tests
- Notifications app: 56 tests
- Common utilities: 18 tests
Key environment variables (see .env.example):
# Django
DJANGO_SETTINGS_MODULE=config.settings.local
SECRET_KEY=your-secret-key
# Database
DB_ENGINE=django.db.backends.postgresql
DB_HOST=postgres
DB_PORT=5432
DB_NAME=statushawk
DB_USER=postgres
DB_PASSWORD=password
# Redis
CELERY_BROKER_URL=redis://redis:6379/0
# Telegram
TELEGRAM_BOT_TOKEN=your-bot-token
TELEGRAM_BOT_NAME=your-bot-nameCustomize deployment in values.yaml:
# Scale API pods
api:
replicaCount: 3
# Configure worker autoscaling
runner:
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 70StatusHawk uses Z-Score statistical analysis to detect latency anomalies:
- Calculates baseline from last 50 successful checks
- Flags responses > 2 standard deviations from mean
- No training required - works out of the box
- Configurable sensitivity threshold
- Magic Link authentication (no password needed)
- Instant downtime alerts
- Anomaly detection notifications
- Customizable alert templates
- HTTP/HTTPS monitoring with custom headers
- TCP port monitoring
- Configurable check intervals (1-60 minutes)
- Response time tracking
- Status code validation
- SSL certificate monitoring
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Write tests for new features
- Follow PEP 8 for Python code
- Use ESLint/Prettier for JavaScript/TypeScript
- Update documentation for API changes
Distributed under the MIT License. See LICENSE for more information.
- Built with Django and React
- UI components from Shadcn/UI
- Deployed on Kubernetes
Project Link: https://github.com/yourusername/statushawk