Python SDK
Django, Flask, FastAPI, or a plain worker. Standard library only.For any Python service. No dependencies — it vendors cleanly if you prefer.You will need a project key
Create a project first and this page fills in your real key everywhere it appears.
Initialize
import vigil
vigil.init(key="vg_pub_YOUR_KEY", endpoint="https://vigill.dev/api/ingest")
try:
charge_card(order)
except Exception:
vigil.capture_exception()
raise
What it captures automatically
These arrive with zero extra code — the unhandled failures that would otherwise crash or vanish.- Uncaught exceptions, via sys.excepthook — the ones that would end the process.
- Uncaught exceptions on threads (threading.excepthook) where available.
When to capture manually
A web framework catches exceptions to return a 500 page rather than crashing the worker, so sys.excepthook never fires. Call vigil.capture_exception() inside your except block to report the handled error.@app.post("/checkout")
def checkout():
try:
charge_card(request.json)
return {"ok": True}
except Exception:
vigil.capture_exception(tags={"route": "checkout"})
return {"error": "Payment failed"}, 500
Configuration
Set environment and release so a bad deploy groups separately from the last one.vigil.init(
key="vg_pub_YOUR_KEY",
endpoint="https://vigill.dev/api/ingest",
environment="production",
release=os.environ.get("GIT_SHA"),
tags={"service": "api"},
)
Verify it works
Add a route that raises, request it once, and watch it land on the dashboard. Then remove it.
What you get
- init(key, endpoint=..., environment=..., release=..., tags=...)
- capture_exception(exc=None, tags=None) — call inside an except block
- capture_message(message, level="info", tags=None) · flush() / close()
The one thing people miss
The uncaught hook chains to whatever sys.excepthook was already installed, so a crash behaves exactly as it would without Vigil.