Operations runbook¶
What to do when something is wrong with a deployed panel. Each entry is the shortest safe path; the linked pages explain why.
Monitoring¶
-
Metrics. Set
VANTAGE["METRICS"] = TrueandVANTAGE["METRICS_TOKEN"](from your secret store), then scrape<panel>/_/metrics/withAuthorization: Bearer <token>. Gauges come from the database, so any worker gives the same answer:Metric Alert when vantage_jobs{status="failed"}it increases vantage_jobs{status="pending"}it stays above zero for longer than a job takes — no worker is running vantage_webhook_deliveries{status="failed"}it increases — a receiver is down or rejecting signatures vantage_webhook_deliveries{status="pending"}it grows — vantage_webhooksis not being runvantage_report_runs{status="failed"}it increases — mail is failing vantage_change_requests{status="pending"}it stays high — approvals are sitting unnoticed rate(vantage_process_slow_requests_total[5m])sustained; sum()across processes -
Slow requests. Add
vantage.metrics.SlowRequestMiddlewaretoMIDDLEWARE; panel requests overVANTAGE["SLOW_REQUEST_MS"](default 1000) are logged tovantage.requestswithvantage_path,vantage_view,vantage_msandvantage_statusas structured fields. - Health page. Superusers: System in the panel — migrations, cache, database, task backend.
Incidents¶
Something is changing data that should not be¶
- Freeze writes for everyone, superusers included, without a deploy: Settings →
Read-only, or
VANTAGE["READ_ONLY"] = "Frozen while we investigate.". Reads keep working. See Read-only mode. - Read the audit log: filter by actor, model and time. Impersonation is recorded under the real person, never the impersonated one.
- Revoke the account (
is_active = False) or its roles on the roles screen. - Repair individual records from their History page ("restore as of"), which saves through the normal form and is itself audited.
A credential or token was exposed¶
- Webhook signing secret: rotate it on the webhook's page; receivers must accept the new one. See Webhooks.
METRICS_TOKEN: change it in the secret store and redeploy; the old one stops working immediately.- A person's second factor: reset it (Two-factor sign-in);
on the server,
python manage.py vantage_two_factor_reset <username>. - Values in sensitive fields are never in the audit log, exports or webhook payloads; check who used Reveal, which is audited.
Restoring after a bad deletion¶
- Within
UNDO_WINDOWseconds, the toast's Undo restores it. - A soft-deleted row is in the model's Trash; restore it there.
- Otherwise restore from a database backup. Undo snapshots are not a backup: they are
purged once expired (
python manage.py vantage_purge_undo, safe to run any time).
Background jobs or webhooks are stuck¶
- Jobs run on the configured task backend (Django Tasks, Celery or RQ); a growing
pendingcount means no worker is consuming the queue named byJOB_QUEUE. - Webhook retries are sent by
python manage.py vantage_webhooks, normally from cron; run it by hand to drain the queue.
After an upgrade¶
python manage.py vantage_upgrade_check --from <previous version>
python manage.py migrate vantage
python manage.py check --deploy
See API stability and upgrades. To roll back, deploy the previous
version and migrate vantage back to the migration that version shipped with before
starting it.