The Go SDK builds an envelope from a Go error, scrubs your context and posts it. Standard library only, and the capture path is guarded so it never panics into your application.
| Module | github.com/bliptrace/bliptrace-go (fetched from GitHub; no tagged release yet) |
Install
go get github.com/bliptrace/bliptrace-go@main
Use it
import (
"os"
"time"
bliptrace "github.com/bliptrace/bliptrace-go"
)
client := bliptrace.New(bliptrace.Config{
Key: os.Getenv("BLIPTRACE_KEY"),
Endpoint: "https://ingest.bliptrace.com",
Environment: "production",
Release: "[email protected]",
BasePath: "/srv/app", // marks your code as in-app
ScrubKeys: []string{"password", "token", "authorization"},
Timeout: 3 * time.Second,
})
if err := doWork(); err != nil {
client.Capture(err, map[string]interface{}{
"user": map[string]interface{}{"id": "u_123"},
"custom": map[string]interface{}{"feature": "reset-password"},
})
}
| Field | Default | |
|---|---|---|
Key |
"" |
Capture does nothing without it |
Endpoint |
legacy host | Set https://ingest.bliptrace.com |
Environment |
production |
|
Release |
"" |
|
Timeout |
3s |
|
MaxFrames / MaxMessage |
30 / 2000 |
|
IgnoreErrors |
nil |
Error type names, e.g. *mypkg.NotFound |
ScrubKeys |
nil |
Replaced with [REDACTED], case-insensitive |
BasePath |
"" |
A frame is in-app when its file starts with it |
Disabled |
false |
Set true to opt out |
To send later: env, ok := client.BuildEnvelope(err, ctx) then client.SendEnvelope(env) when ok.