Go SDK
Panics and errors at any request or goroutine boundary.For any Go service. Standard library only, no dependencies.You will need a project key
Create a project first and this page fills in your real key everywhere it appears.
Install
go get github.com/vigil/vigil-go/vigil
Initialize
import "github.com/vigil/vigil-go/vigil"
func main() {
vigil.Init(vigil.Config{
Key: "vg_pub_YOUR_KEY",
Endpoint: "https://vigill.dev/api/ingest",
})
defer vigil.Close()
if err := doWork(); err != nil {
vigil.CaptureError(err)
}
}
// Capture-and-re-panic at a goroutine or request boundary:
func handler() {
defer vigil.Recover()
// ...
}
What it captures automatically
These arrive with zero extra code — the unhandled failures that would otherwise crash or vanish.- Panics, wherever you place `defer vigil.Recover()` — typically at each request handler and each goroutine boundary.
When to capture manually
Go returns errors rather than throwing them, so most failures are values you check, not panics. Report the ones that matter with vigil.CaptureError(err) — the panic recovery only covers actual panics.func checkout(w http.ResponseWriter, r *http.Request) {
defer vigil.Recover() // catches panics
if err := charge(r); err != nil {
vigil.CaptureError(err) // report the handled error too
http.Error(w, "Payment failed", 500)
return
}
}
Configuration
Config{} carries environment, release and tags alongside the key and endpoint.vigil.Init(vigil.Config{
Key: "vg_pub_YOUR_KEY",
Endpoint: "https://vigill.dev/api/ingest",
Environment: "production",
Release: os.Getenv("GIT_SHA"),
Tags: map[string]string{"service": "api"},
})
Verify it works
Add a handler that panics behind `defer vigil.Recover()`, hit it once, and watch it appear on the dashboard.
What you get
- Init(Config{Key, Endpoint, Environment, Release, Tags})
- CaptureError(err) · CaptureMessage(message, level) · Flush() / Close()
- Recover() — deferred; captures a panic then re-panics so behaviour is unchanged
The one thing people miss
Recover re-panics on purpose — a monitoring tool that swallowed panics would change your program, which it must never do.