Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Full Sentry SDK setup for Go. Use when asked to \"add Sentry to Go\", \"install sentry-go\", \"setup Sentry in Go\", or configure error monitoring, tracing, logging, metrics, or crons for Go applications. Supports net/http, Gin, Echo, Fiber, FastHTTP, Iris, Negroni, and gRPC.
.claude/skills/kunanonj-cursor-plugin-sentry-sentry-go-sdk/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-07 | ✗→✓ | ▲ Improved | 86% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 161% | 0% |
| case-14 | ✗→✓ | ▲ Improved | 202% | 0% |
| case-20 | ✗→✓ | ▲ Improved | 161% | 0% |
| case-22 | ✗→✓ | ▲ Improved | 116% | 0% |
> All Skills > SDK Setup > Go SDK
Opinionated wizard that scans your Go project and guides you through complete Sentry setup.
sentry-go, github.com/getsentry/sentry-go, or Go Sentry SDK> Note: SDK versions and APIs below reflect Sentry docs at time of writing (sentry-go v0.43.0+). > As of v0.33.0+, the SDK requires Go 1.25 or later (supports the two most recent Go major versions). > Always verify against docs.sentry.io/platforms/go/ before implementing.
Run these commands to understand the project before making any recommendations:
bash# Check existing Sentry dependency grep -i sentry go.mod 2>/dev/null # Detect web framework grep -E "gin-gonic/gin|labstack/echo|gofiber/fiber|valyala/fasthttp|kataras/iris|urfave/negroni" go.mod 2>/dev/null # Detect gRPC grep "google.golang.org/grpc" go.mod 2>/dev/null # Detect logging libraries grep -E "sirupsen/logrus|go.uber.org/zap|rs/zerolog|log/slog" go.mod go.sum 2>/dev/null # Detect cron / scheduler patterns grep -E "robfig/cron|go-co-op/gocron|jasonlvhit/gocron" go.mod 2>/dev/null # Detect OpenTelemetry usage grep "go.opentelemetry.io" go.mod 2>/dev/null # Check for companion frontend ls frontend/ web/ client/ ui/ 2>/dev/null
What to note:
sentry-go already in go.mod? If yes, skip to Phase 2 (configure features).Based on what you found, present a concrete recommendation. Don't ask open-ended questions — lead with a proposal:
Recommended (core coverage):
Optional (enhanced observability):
references/profiling.md for alternativesRecommendation logic:
| Feature | Recommend when... | |---------|------------------| | Error Monitoring | Always — non-negotiable baseline | | Tracing | net/http, gin, echo, fiber, gRPC, or DB calls detected | | Logging | logrus, zap, zerolog, or log/slog imports detected | | Metrics | Business events, SLO tracking, or counters needed | | Crons | robfig/cron, gocron, or scheduled job patterns detected | | Profiling | ⚠️ Removed in v0.31.0 — do not recommend; see references/profiling.md |
Propose: "I recommend setting up Error Monitoring + Tracing [+ Logging if applicable]. Want me to also add Metrics or Crons?"
bash# Core SDK (always required) go get github.com/getsentry/sentry-go # Framework sub-package — install only what matches detected framework: go get github.com/getsentry/sentry-go/http # net/http go get github.com/getsentry/sentry-go/gin # Gin go get github.com/getsentry/sentry-go/echo # Echo go get github.com/getsentry/sentry-go/fiber # Fiber go get github.com/getsentry/sentry-go/fasthttp # FastHTTP # Logging sub-packages — install only what matches detected logging lib: go get github.com/getsentry/sentry-go/logrus # Logrus go get github.com/getsentry/sentry-go/slog # slog (stdlib, Go 1.21+) go get github.com/getsentry/sentry-go/zap # Zap go get github.com/getsentry/sentry-go/zerolog # Zerolog # gRPC interceptors (only if google.golang.org/grpc is detected): go get github.com/getsentry/sentry-go/grpc # OpenTelemetry bridge (only if OTel is already in use): go get github.com/getsentry/sentry-go/otel
Add to main() before any other code. This config enables the most features with sensible defaults:
goimport ( "log" "os" "time" "github.com/getsentry/sentry-go" ) err := sentry.Init(sentry.ClientOptions{ Dsn: os.Getenv("SENTRY_DSN"), Environment: os.Getenv("SENTRY_ENVIRONMENT"), // "production", "staging", etc. Release: release, // inject via -ldflags at build time SendDefaultPII: true, AttachStacktrace: true, // Tracing (adjust sample rate for production) EnableTracing: true, TracesSampleRate: 1.0, // lower to 0.1–0.2 in high-traffic production // Logs EnableLogs: true, }) if err != nil { log.Fatalf("sentry.Init: %s", err) } defer sentry.Flush(2 * time.Second)
Injecting Release at build time (recommended):
govar release string // set by -ldflags // go build -ldflags="-X main.release=my-app@$(git describe --tags)"
After sentry.Init, register the Sentry middleware for your framework:
| Framework | Import path | Middleware call | Repanic | WaitForDelivery | |-----------|------------|----------------|-----------|-------------------| | net/http | .../sentry-go/http | sentryhttp.New(opts).Handle(h) | true | false | | Gin | .../sentry-go/gin | router.Use(sentrygin.New(opts)) | true | false | | Echo | .../sentry-go/echo | e.Use(sentryecho.New(opts)) | true | false | | Fiber | .../sentry-go/fiber | app.Use(sentryfiber.New(opts)) | false | true | | FastHTTP | .../sentry-go/fasthttp | sentryfasthttp.New(opts).Handle(h) | false | true | | Iris | .../sentry-go/iris | app.Use(sentryiris.New(opts)) | true | false | | Negroni | .../sentry-go/negroni | n.Use(sentrynegroni.New(opts)) | true | false |
> Note: Fiber and FastHTTP are built on valyala/fasthttp which has no built-in recovery. Use Repanic: false, WaitForDelivery: true for those.
Hub access in handlers:
go// net/http, Negroni: hub := sentry.GetHubFromContext(r.Context()) // Gin: hub := sentrygin.GetHubFromContext(c) // Echo: hub := sentryecho.GetHubFromContext(c) // Fiber: hub := sentryfiber.GetHubFromContext(c)
For gRPC servers and clients, use the sentrygrpc interceptors instead:
goimport sentrygrpc "github.com/getsentry/sentry-go/grpc" // Server: register interceptors when creating the gRPC server server := grpc.NewServer( grpc.UnaryInterceptor(sentrygrpc.UnaryServerInterceptor()), grpc.StreamInterceptor(sentrygrpc.StreamServerInterceptor()), ) // Client: register interceptors when dialing conn, err := grpc.NewClient( address, grpc.WithUnaryInterceptor(sentrygrpc.UnaryClientInterceptor()), grpc.WithStreamInterceptor(sentrygrpc.StreamClientInterceptor()), ) // Hub access inside a gRPC handler: hub := sentry.GetHubFromContext(ctx)
Walk through features one at a time. Load the reference file for each, follow its steps, and verify before moving to the next:
| Feature | Reference file | Load when... | |---------|---------------|-------------| | Error Monitoring | ${SKILL_ROOT}/references/error-monitoring.md | Always (baseline) | | Tracing | ${SKILL_ROOT}/references/tracing.md | HTTP handlers / distributed tracing | | Profiling | ${SKILL_ROOT}/references/profiling.md | Performance-sensitive production apps | | Logging | ${SKILL_ROOT}/references/logging.md | logrus / zap / zerolog / slog detected | | Metrics | ${SKILL_ROOT}/references/metrics.md | Business KPIs / SLO tracking | | Crons | ${SKILL_ROOT}/references/crons.md | Scheduler / cron job patterns detected |
For each feature: Read ${SKILL_ROOT}/references/<feature>.md, follow steps exactly, verify it works.
ClientOptions Fields| Option | Type | Default | Purpose | |--------|------|---------|---------| | Dsn | string | "" | SDK disabled if empty; env: SENTRY_DSN | | Environment | string | "" | e.g., "production"; env: SENTRY_ENVIRONMENT | | Release | string | "" | e.g., "my-app@1.0.0"; env: SENTRY_RELEASE | | SendDefaultPII | bool | false | Include IP, request headers | | AttachStacktrace | bool | false | Stack traces on CaptureMessage calls | | SampleRate | float64 | 1.0 | Error event sample rate (0.0 treated as 1.0) | | EnableTracing | bool | false | Enable performance tracing | | TracesSampleRate | float64 | 0.0 | Transaction sample rate | | TracesSampler | TracesSampler | nil | Custom per-transaction sampling (overrides rate) | | EnableLogs | bool | false | Enable Sentry Logs feature | | MaxBreadcrumbs | int | 100 | Max breadcrumbs per event | | MaxErrorDepth | int | 100 | Max depth for unwrapping error chains | | Debug | bool | false | Verbose SDK debug output | | BeforeSend | func | nil | Hook to mutate/drop error events | | BeforeSendTransaction | func | nil | Hook to mutate/drop transaction events | | IgnoreErrors | []string | nil | Regex patterns for errors to drop | | IgnoreTransactions | []string | nil | Regex patterns for transactions to drop |
| Variable | Maps to | Purpose | |----------|---------|---------| | SENTRY_DSN | Dsn | Data Source Name | | SENTRY_RELEASE | Release | App version (e.g., my-app@1.0.0) | | SENTRY_ENVIRONMENT | Environment | Deployment environment | | HTTP_PROXY / HTTPS_PROXY | HTTPProxy / HTTPSProxy | Outbound proxy |
Options set in ClientOptions override environment variables.
Test that Sentry is receiving events:
go// In a handler or test — triggers a real error event: sentry.CaptureMessage("Sentry Go SDK test") // Or trigger a captured panic (with recovery middleware in place): panic("sentry test panic")
Check the Sentry dashboard within a few seconds. If nothing appears:
Debug: true in ClientOptions — prints SDK internals to stdoutsentry.Flush(2 * time.Second) is called (events are async by default)After completing Go setup, check for a companion frontend missing Sentry coverage:
bashls frontend/ web/ client/ ui/ 2>/dev/null cat frontend/package.json web/package.json 2>/dev/null | grep -E '"react"|"svelte"|"vue"|"next"'
If a frontend directory exists without Sentry configured, suggest the matching skill:
| Frontend detected | Suggest skill | |-------------------|--------------| | React / Next.js | sentry-react-sdk | | Svelte / SvelteKit | sentry-svelte-sdk | | Vue | Use @sentry/vue — see docs.sentry.io/platforms/javascript/guides/vue/ | | Other JS/TS | sentry-react-sdk (covers generic browser JS patterns) |
| Issue | Solution | |-------|----------| | Events not appearing | Set Debug: true, check DSN, verify sentry.Flush() is called | | sentry.Init returns error | Malformed DSN — check format: https://<key>@o<org>.ingest.sentry.io/<project> | | Panics not captured | Ensure framework middleware is registered before handlers | | defer sentry.Flush not running | os.Exit() skips defer — call sentry.Flush() explicitly before os.Exit() | | Missing stack traces | Set AttachStacktrace: true for CaptureMessage; works automatically for CaptureException | | Goroutine events missing context | Clone hub before spawning goroutine: hub := sentry.CurrentHub().Clone() | | Too many transactions | Lower TracesSampleRate or use TracesSampler to drop health checks / metrics endpoints | | Fiber/FastHTTP not recovering | Use Repanic: false, WaitForDelivery: true for fasthttp-based frameworks | | SampleRate: 0.0 sending all events | 0.0 is treated as 1.0; to drop all, set Dsn: "" instead |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-04 | pass→fail | 9,116 | 10,521 | +15% | 1 | 1 | 0% | 1,868 | 5,337 | +186% | 0 | 0 | — |
case-05 | pass→pass | 12,553 | 8,426 | -33% | 1 | 1 | 0% | 2,888 | 5,540 | +92% | 0 | 0 | — |
case-10 | pass→pass | 17,986 | 3,164 | -82% | 1 | 1 | 0% | 3,325 | 4,344 | +31% | 0 | 0 | — |
case-01 | fail→fail | 14,030 | 8,015 | -43% | 1 | 1 | 0% | 2,818 | 4,006 | +42% | 0 | 0 | — |
case-02 | fail→fail | 14,218 | 7,337 | -48% | 1 | 1 | 0% | 3,084 | 3,998 | +30% | 0 | 0 | — |
case-03 | fail→fail | 17,230 | 3,614 | -79% | 1 | 1 | 0% | 3,249 | 4,147 | +28% | 0 | 0 | — |
case-06 | pass→fail | 6,964 | 8,458 | +21% | 1 | 1 | 0% | 1,493 | 5,636 | +277% | 0 | 0 | — |
case-07 | fail→pass | 14,168 | 7,554 | -47% | 1 | 1 | 0% | 2,805 | 5,230 | +86% | 0 | 0 | — |
case-08 | fail→pass | 9,079 | 4,956 | -45% | 1 | 1 | 0% | 1,785 | 4,657 | +161% | 0 | 0 | — |
case-09 | fail→fail | 13,304 | 6,424 | -52% | 1 | 1 | 0% | 2,630 | 5,005 | +90% | 0 | 0 | — |
case-11 | pass→pass | 14,048 | 8,005 | -43% | 1 | 1 | 0% | 2,856 | 5,447 | +91% | 0 | 0 | — |
case-12 | pass→pass | 8,884 | 4,349 | -51% | 1 | 1 | 0% | 1,766 | 4,586 | +160% | 0 | 0 | — |
case-13 | pass→pass | 11,176 | 5,763 | -48% | 1 | 1 | 0% | 2,157 | 4,813 | +123% | 0 | 0 | — |
case-14 | fail→pass | 6,515 | 4,101 | -37% | 1 | 1 | 0% | 1,495 | 4,518 | +202% | 0 | 0 | — |
case-15 | pass→pass | 9,921 | 5,809 | -41% | 1 | 1 | 0% | 2,138 | 4,962 | +132% | 0 | 0 | — |
case-16 | pass→pass | 11,328 | 3,615 | -68% | 1 | 1 | 0% | 2,438 | 4,467 | +83% | 0 | 0 | — |
case-17 | pass→pass | 19,334 | 3,383 | -83% | 1 | 1 | 0% | 4,032 | 4,422 | +10% | 0 | 0 | — |
case-18 | pass→pass | 4,125 | 1,910 | -54% | 1 | 1 | 0% | 767 | 4,082 | +432% | 0 | 0 | — |
case-19 | pass→pass | 4,935 | 2,034 | -59% | 1 | 1 | 0% | 1,066 | 4,077 | +282% | 0 | 0 | — |
case-20 | fail→pass | 7,649 | 2,585 | -66% | 1 | 1 | 0% | 1,594 | 4,162 | +161% | 0 | 0 | — |
case-21 | pass→pass | 9,470 | 2,822 | -70% | 1 | 1 | 0% | 1,654 | 4,203 | +154% | 0 | 0 | — |
case-22 | fail→pass | 13,673 | 7,505 | -45% | 1 | 1 | 0% | 2,413 | 5,219 | +116% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of 0 percentage points is the difference between those two pass rates over the 22 comparable cases. 5 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.