Observability Standards
Guidelines for structured logging, performance metrics, Celery task monitoring, and audit logging.
Structured Logging Rules
MetaPilot uses Python's standard library configured via Django settings.
loggingLOGGINGFormatting Standard
Logs use a simple structured format:
text
{levelname} {asctime} {module} {message}
Example Output:
text
INFO 2026-07-24 01:15:22 scheduler_service Claimed 1 jobs for processing
ERROR 2026-07-24 01:16:04 websocket [Inbox WS] Redis connection timeout
Log Level Discipline
- : Detailed diagnostic info (SQL queries, internal variable dumps).
DEBUG - : Normal operational events (Tenant created, Job claimed, WS client connected).
INFO - : Recoverable non-fatal events (Rate limit hit, invalid login attempt).
WARNING - : Actionable errors requiring investigation (Database failures, API exceptions).
ERROR - : Emergency failures causing system shutdown.
CRITICAL
Audit Logging
Critical administrative actions are recorded in the table ():
AuditLogtenants.models.AuditLog- Super Admin actions (creating/deleting tenants, role modifications).
- Client configuration changes.
- High-volume broadcast triggers.
Audit log attributes include: , , , , , , .
tenantuseractionresourceip_addressdetails_jsoncreated_atCelery Worker Monitoring
Monitor Celery task queues using standard CLI tools:
bash
# View active tasks and worker stats
celery -A core inspect active
celery -A core events
For production UI monitoring, deploy Flower:
bash
celery -A core flower --port=5555