A small library with a net/http middleware, a manual `Notify()` call, and a `Recover()` helper for background goroutines. Explicit by design — you decide what gets captured.
go get github.com/errorgaphq/errorgap-goInitialize early in main and defer a clean shutdown so buffered events flush:
import (
"context"
"os"
errorgap "github.com/errorgaphq/errorgap-go"
)
func main() {
if err := errorgap.Init(errorgap.Config{
Endpoint: os.Getenv("ERRORGAP_ENDPOINT"),
ProjectSlug: os.Getenv("ERRORGAP_PROJECT_SLUG"),
APIKey: os.Getenv("ERRORGAP_API_KEY"),
}); err != nil {
panic(err)
}
defer errorgap.Close(context.Background())
// ...
}Wrap a net/http server with the recovery middleware:
import "github.com/errorgaphq/errorgap-go/stdhttp"
http.ListenAndServe(":8080", stdhttp.Recover(mux))And guard background goroutines with Recover():
go func() {
defer errorgap.Recover()
// ... work ...
}()Add a temporary route that panics through the recover handler:
mux.HandleFunc("/errorgap-test", func(w http.ResponseWriter, r *http.Request) {
panic("Errorgap test error")
})Confirm your key and endpoint reach errorgap before wiring anything else — send one event straight to the ingestion API:
curl -sS -X POST "$ERRORGAP_ENDPOINT/api/projects/$ERRORGAP_PROJECT_SLUG/notices" \
-H "content-type: application/json" \
-H "x-errorgap-project-key: $ERRORGAP_API_KEY" \
-d '{"errors":[{"type":"ErrorgapInstallTest","message":"Errorgap install verification"}]}'A 201 with a group_id means ingestion works (202 = received but sampled; 401 = wrong key). Then trigger the test error above through the SDK. Your onboarding screen's Verify step checks the stack off automatically once the first event lands — it polls every three seconds.
Next: the full ingestion API, or browse every SDK.