Go
Capture panics and errors from Go services with sentry-go pointed at Epure.
Use official sentry-go (fixture captured at 0.28.0). Point Dsn at your Epure host. No Epure Go module.
Use this guide when the process is Go: net/http, Gin, Echo, chi, Fiber, workers, CLIs. Do not use this for JS/TS (→ Browser, Node, Next.js). Full map: Pick your SDK.
Capture exceptions in Go
Install sentry-go, call sentry.Init once, recover or CaptureException, then Flush before exit. Envelope ingest. Grouping uses raw frames.
How do I install sentry-go?
go get github.com/getsentry/sentry-goKeep existing framework middleware. Only the DSN host changes.
Init the Go SDK
err := sentry.Init(sentry.ClientOptions{
Dsn: "http://YOUR_PUBLIC_KEY@localhost:8080/YOUR_PROJECT_ID",
Environment: "local",
Release: "my-api@0.0.0",
TracesSampleRate: 0,
})
if err != nil {
panic(err)
}
defer sentry.Flush(2 * time.Second)| Option | Value |
|---|---|
Dsn | Required: public key + Epure host + project UUID |
Environment | Tag for the dashboard filter strip |
Release | Version string on the issue |
TracesSampleRate | 0; transactions discarded |
Flush before exit
Short-lived jobs and CLIs drop the last event if the process exits before the transport drains. Always Flush (or equivalent) on shutdown.
How do I capture errors?
sentry.CaptureException(err)
defer func() {
if rec := recover(); rec != nil {
sentry.CurrentHub().Recover(rec)
sentry.Flush(2 * time.Second)
panic(rec)
}
}()Gin / Echo / chi middleware that already calls CaptureException keeps working after the DSN swap.
What should I see after ingest?
202, then an issue whose title matches the panic or error string, with a stack as sentry-go sent it.
Why does Go never send?
| What you see | What to do |
|---|---|
| CLI exits with no issue | sentry.Flush(2 * time.Second) before os.Exit |
| 401 / 403 | Recopy the DSN from Settings → SDK connection |
| 202, empty Issues | Match the environment chip to Environment |
No SDK yet? Store curl: Other runtimes.
Next
Does Epure demangle Go stacks?
No. There is no Go symbol server. Grouping uses file, function, and line as sentry-go sends them. Call Flush on shutdown so CLI jobs do not lose the last panic.
Are traces stored?
No. Set TracesSampleRate to 0. Transaction items are discarded on ingest. Exception events plus breadcrumbs stay.