Skip to main content

Satellite Observability for Django - A modern debugging and observability tool

Project description

๐Ÿ›ฐ๏ธ Django Orbit

Satellite Observability for Django

A modern debugging and observability tool that orbits your Django application without touching it.

Demo

Star on GitHub

Python Django License Code Style Buy Me a Coffee

๐Ÿ“š Documentation ยท ๐ŸŽฎ Live Demo ยท โญ Star on GitHub


โœจ Features

Core Observability

  • ๐ŸŒ Request Tracking - Capture HTTP requests with headers, body, and response
  • ๐Ÿ—„๏ธ SQL Recording - Log queries with N+1 detection and slow query alerts
  • ๐Ÿ“ Log Aggregation - Automatically capture Python logging output
  • ๐Ÿšจ Exception Tracking - Full traceback capture for errors
  • โฑ๏ธ Performance Metrics - Duration tracking for requests and queries

Extended Monitoring (v0.2.0+)

  • ๐ŸŸฃ Management Commands - Track python manage.py executions
  • ๐ŸŸ  Cache Operations - Monitor hits, misses, sets, deletes
  • ๐Ÿ”ต Model Events - ORM create/update/delete auditing
  • ๐Ÿฉท HTTP Client - Outgoing API request monitoring
  • ๐Ÿ“ง Mail Capture - Track sent emails
  • โšก Django Signals - Event dispatch monitoring

Advanced Features (v0.5.0+)

  • โฐ Background Jobs - Celery, Django-Q, RQ, APScheduler monitoring
  • ๐Ÿ”ด Redis Operations - Track GET, SET, DEL, and more
  • ๐Ÿ›ก๏ธ Gates/Permissions - Authorization check auditing
  • ๐Ÿ“Š Stats Dashboard - Apdex score, percentiles, interactive charts

New in v0.6.0

  • ๐Ÿ”„ Database Transactions - Track atomic blocks, commits, rollbacks
  • ๐Ÿ“ Storage Operations - Monitor file saves, reads, deletes (S3/Local)

New in v0.6.3 - Plug-and-Play System

  • ๐Ÿ’š Health Dashboard (/orbit/health/) - Visual module status with green/red/yellow indicators
  • ๐Ÿ”Œ Modular Architecture - Each watcher operates independently; failures don't crash your app
  • ๐Ÿ” Diagnostics API - get_watcher_status(), get_failed_watchers() for programmatic checks
  • ๐Ÿ› ๏ธ Graceful Degradation - Failed modules auto-disable while others continue working

Dashboard Features

  • ๐ŸŒ™ Beautiful Dark UI - Space-themed mission control
  • โšก Live Updates - HTMX-powered real-time feed
  • ๐Ÿ”— Event Correlation - Link related events with family grouping
  • ๐Ÿ”’ Zero DOM Injection - Lives at its own URL, no template pollution

๐ŸŽฏ Philosophy

"Satellite Observability" - Like a satellite, Orbit observes your application from a distance without interfering with it.

Unlike Django Debug Toolbar which injects HTML into your templates, Django Orbit runs on its own isolated URL (/orbit/). This means:

  • โœ… No DOM pollution
  • โœ… No CSS conflicts
  • โœ… Works with any frontend (React, Vue, HTMX, etc.)
  • โœ… API-friendly debugging
  • โœ… Clean separation of concerns

๐Ÿ“ฆ Installation

pip install django-orbit

๐ŸŽฎ Try the Demo

git clone https://github.com/astro-stack/django-orbit.git
cd django-orbit
pip install -e .
python demo.py setup    # Creates sample data with ALL entry types
python manage.py runserver

Then visit:

๐Ÿš€ Quick Start

1. Add to Installed Apps

# settings.py
INSTALLED_APPS = [
    # ...
    'orbit',
]

2. Add Middleware

# settings.py
MIDDLEWARE = [
    'orbit.middleware.OrbitMiddleware',  # Add early
    # ...
]

3. Include URLs

# urls.py
from django.urls import path, include

urlpatterns = [
    path('orbit/', include('orbit.urls')),
    # ...
]

4. Run Migrations

python manage.py migrate orbit

5. Visit the Dashboard

Navigate to http://localhost:8000/orbit/ ๐Ÿš€

โš™๏ธ Configuration

# settings.py
ORBIT_CONFIG = {
    'ENABLED': True,
    'SLOW_QUERY_THRESHOLD_MS': 500,
    'STORAGE_LIMIT': 1000,
    
    # Core watchers
    'RECORD_REQUESTS': True,
    'RECORD_QUERIES': True,
    'RECORD_LOGS': True,
    'RECORD_EXCEPTIONS': True,
    
    # Extended watchers
    'RECORD_COMMANDS': True,
    'RECORD_CACHE': True,
    'RECORD_MODELS': True,
    'RECORD_HTTP_CLIENT': True,
    'RECORD_MAIL': True,
    'RECORD_SIGNALS': True,
    
    # Advanced watchers (v0.5.0+)
    'RECORD_JOBS': True,
    'RECORD_REDIS': True,
    'RECORD_GATES': True,
    
    # v0.6.0 watchers
    'RECORD_TRANSACTIONS': True,
    'RECORD_STORAGE': True,
    
    # Security
    'AUTH_CHECK': lambda request: request.user.is_staff,
    'IGNORE_PATHS': ['/orbit/', '/static/', '/media/'],
}

๐Ÿ“Š Stats Dashboard

The new Stats Dashboard (/orbit/stats/) provides advanced analytics:

Metric Description
Apdex Score User satisfaction index (0-1)
Percentiles P50, P75, P95, P99 response times
Error Rate Failure percentage with trend
Throughput Requests per minute/hour
Database Slow queries, N+1 detection
Cache Hit rate with sparkline chart
Jobs Success rate, failure tracking
Permissions Top denied permissions

๐Ÿ’š Health Dashboard & Plug-and-Play

The Health Dashboard (/orbit/health/) shows the status of all Orbit modules:

  • ๐ŸŸข Green - Module is healthy and working
  • ๐Ÿ”ด Red - Module failed to initialize (click for details)
  • ๐ŸŸก Yellow - Module is disabled via configuration

Modular Architecture

Each watcher/module operates independently:

  • If Celery isn't installed, the Celery watcher fails gracefully
  • Other watchers continue working normally
  • Failed modules are logged and visible in the Health dashboard

Programmatic Access

from orbit import get_watcher_status, get_failed_watchers

# Get status of all watchers
status = get_watcher_status()
# {'cache': {'installed': True, 'error': None, 'disabled': False}, ...}

# Get only failed watchers
failed = get_failed_watchers()
# {'celery': 'ModuleNotFoundError: No module named celery'}

Configuration

ORBIT_CONFIG = {
    # Control error behavior
    'WATCHER_FAIL_SILENTLY': True,  # Default: log errors but continue
    
    # Disable specific watchers
    'RECORD_CACHE': False,
    'RECORD_REDIS': False,
    # ... etc
}

๐Ÿ”ง Background Job Integrations

Orbit automatically detects and monitors:

Backend Integration
Celery Via signals (automatic)
Django-Q Via signals (automatic)
RQ Worker patching (automatic)
APScheduler register_apscheduler(scheduler)
django-celery-beat Via model signals (automatic)

๐Ÿ›ก๏ธ Security

# Restrict access to staff users
ORBIT_CONFIG = {
    'AUTH_CHECK': lambda request: request.user.is_staff,
}

# Or disable in production
ORBIT_CONFIG = {
    'ENABLED': DEBUG,
}

Orbit automatically hides sensitive data (passwords, tokens, API keys).

๐Ÿ—บ๏ธ Roadmap

Implemented โœ…

  • Request/Query/Log/Exception tracking
  • N+1 detection with duplicate navigation
  • Management Commands, Cache, Models, HTTP Client
  • Mail, Signals watchers
  • Jobs (Celery, Django-Q, RQ, APScheduler)
  • Redis operations
  • Gates/Permissions
  • Stats Dashboard with Apdex, charts
  • Dashboard authentication
  • Search, Export, Pagination

Future ๐Ÿ”ฎ

  • External storage backends (Redis, PostgreSQL)
  • Performance recommendations
  • Custom dashboards
  • Webhook integrations

โ˜• Support the Project

If Django Orbit helps you debug faster, consider buying me a coffee!

Buy Me a Coffee

๐Ÿค Contributing

We welcome contributions! See CONTRIBUTING.md.

๐Ÿ“„ License

MIT License - see LICENSE.

๐Ÿ’– Acknowledgments

Inspired by Laravel Telescope, Spatie Ray, and Django Debug Toolbar.


Built with โค๏ธ for the Django community

โญ Star us on GitHub ยท ๐Ÿ“š Read the Docs

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_orbit-0.6.3.tar.gz (83.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_orbit-0.6.3-py3-none-any.whl (78.2 kB view details)

Uploaded Python 3

File details

Details for the file django_orbit-0.6.3.tar.gz.

File metadata

  • Download URL: django_orbit-0.6.3.tar.gz
  • Upload date:
  • Size: 83.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for django_orbit-0.6.3.tar.gz
Algorithm Hash digest
SHA256 ec55b97a91c0833855c7d8870964535d700545cbcf862a46a52aca2ad518085f
MD5 90b2c5121d638d67cb710167123820b2
BLAKE2b-256 67fbead2a39aa49711c3502981a6a9f67301d5e8d8f1467d195d015bf5acf671

See more details on using hashes here.

File details

Details for the file django_orbit-0.6.3-py3-none-any.whl.

File metadata

  • Download URL: django_orbit-0.6.3-py3-none-any.whl
  • Upload date:
  • Size: 78.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for django_orbit-0.6.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e4203ba944938603682159081f56ba2835a49e08fdedd7afb2780e4ee0f007e5
MD5 19c6996048e153206e76d17f67a04f8a
BLAKE2b-256 53fe43adde2f2745abd04461f8136179ec9e5e9006bc1a416e0fa70f4e7a3733

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page