Django infrastructure monitoring with Slack alerts via Jinkies
Project description
Jinkies Monitor
Django infrastructure monitoring package that sends alerts to Slack via Jinkies.
Features
- 🚀 API Performance Monitoring - Alert on slow requests (>2s)
- 🔴 Error Rate Tracking - Detect error spikes
- 🔍 404 Monitoring - Track missing endpoints
- 🔐 Failed Login Detection - Security monitoring
- 💾 Redis Memory Alerts - Memory usage tracking
- 📊 Celery Queue Monitoring - Task backlog alerts
- 💿 Disk Space Alerts - Storage monitoring
- 🌐 External API Health - Monitor Stripe, HubSpot, etc.
- ⚡ Auto-deduplication - Prevent alert spam
Installation
pip install jinkies-monitor
Quick Start
1. Add to INSTALLED_APPS
INSTALLED_APPS = [
# ...
'jinkies_monitor',
]
2. Add Middleware
MIDDLEWARE = [
# ...
'jinkies_monitor.middleware.InfrastructureMonitoringMiddleware',
'jinkies_monitor.middleware.FailedLoginMonitorMiddleware',
]
3. Configure Settings
JINKIES_MONITOR = {
'WEBHOOK_URL': 'https://your-jinkies-webhook-url',
'SERVICE_NAME': 'my-app',
'ENVIRONMENT': 'production',
# Thresholds
'SLOW_REQUEST_THRESHOLD': 2.0,
'ERROR_RATE_THRESHOLD': 20,
'404_RATE_THRESHOLD': 50,
'REDIS_MEMORY_THRESHOLD': 80,
'CELERY_QUEUE_THRESHOLD': 100,
# Enable/disable checks
'CHECK_REDIS_MEMORY': True,
'CHECK_CELERY_QUEUE': True,
'CHECK_DISK_SPACE': True,
'MONITOR_STRIPE': True,
}
4. Setup Celery Beat (Optional)
from celery.schedules import crontab
CELERY_BEAT_SCHEDULE = {
'check-redis-memory': {
'task': 'jinkies_monitor.tasks.check_redis_memory',
'schedule': crontab(minute='*/5'),
},
'check-celery-queue': {
'task': 'jinkies_monitor.tasks.check_celery_queue',
'schedule': crontab(minute='*/5'),
},
'check-disk-space': {
'task': 'jinkies_monitor.tasks.check_disk_space',
'schedule': crontab(minute='*/10'),
},
}
Configuration Options
| Setting | Default | Description |
|---|---|---|
WEBHOOK_URL |
'' |
Jinkies webhook URL (required) |
SERVICE_NAME |
'django-app' |
Service identifier |
ENVIRONMENT |
'production' |
Environment name |
SLOW_REQUEST_THRESHOLD |
2.0 |
Seconds before alerting |
ERROR_RATE_THRESHOLD |
20 |
Errors per 5 min |
404_RATE_THRESHOLD |
50 |
404s per 5 min |
REDIS_MEMORY_THRESHOLD |
80 |
Percent |
CELERY_QUEUE_THRESHOLD |
100 |
Tasks |
DISK_SPACE_THRESHOLD |
80 |
Percent |
DEDUPE_WINDOW |
300 |
Seconds |
ENABLED |
True |
Master switch |
Manual Alerts
from jinkies_monitor.utils import send_alert
send_alert(
title="Custom Alert",
message="Something important happened",
severity="WARNING",
fields={'Key': 'Value'},
dedupe_key='my_alert'
)
Requirements
- Django >= 4.0
- Celery >= 5.0 (optional, for periodic checks)
- Redis (optional, for caching)
- psutil >= 5.9
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
jinkies_monitor-0.1.0.tar.gz
(9.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file jinkies_monitor-0.1.0.tar.gz.
File metadata
- Download URL: jinkies_monitor-0.1.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5fc5cdb5cb9cfdf8d1b6a546729ee3232ab03583ef8299d494610eed3ee58f9d
|
|
| MD5 |
146f175656e25a4d33606d132b470853
|
|
| BLAKE2b-256 |
5bf962870cfbb4a96a73a4c896d5ab306ef3be934b85c0eaf4527ee66134408e
|
File details
Details for the file jinkies_monitor-0.1.0-py3-none-any.whl.
File metadata
- Download URL: jinkies_monitor-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
df071b4dd55c0b6b662d9cddbc55af9c9a32f52fb4c700e089bf78e856133660
|
|
| MD5 |
649f4478d2426cb56d061cb4db97c6f2
|
|
| BLAKE2b-256 |
53e2ce80b4e2e76c451aeafc3037d8240e62c636ebb2bf8b2e27dbdf7bf29f8f
|