$npx -y skills add getsentry/sentry-for-ai --skill sentry-go-sdkFull 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.
| 1 | > [All Skills](../../SKILL_TREE.md) > [SDK Setup](../sentry-sdk-setup/SKILL.md) > Go SDK |
| 2 | |
| 3 | # Sentry Go SDK |
| 4 | |
| 5 | Opinionated wizard that scans your Go project and guides you through complete Sentry setup. |
| 6 | |
| 7 | ## Invoke This Skill When |
| 8 | |
| 9 | - User asks to "add Sentry to Go" or "setup Sentry" in a Go app |
| 10 | - User wants error monitoring, tracing, logging, metrics, or crons in Go |
| 11 | - User mentions `sentry-go`, `github.com/getsentry/sentry-go`, or Go Sentry SDK |
| 12 | - User wants to monitor panics, HTTP handlers, or scheduled jobs in Go |
| 13 | |
| 14 | > **Note:** SDK versions and APIs below reflect Sentry docs at time of writing (sentry-go v0.43.0+). |
| 15 | > As of v0.33.0+, the SDK requires **Go 1.25 or later** (supports the two most recent Go major versions). |
| 16 | > Always verify against [docs.sentry.io/platforms/go/](https://docs.sentry.io/platforms/go/) before implementing. |
| 17 | |
| 18 | --- |
| 19 | |
| 20 | ## Phase 1: Detect |
| 21 | |
| 22 | Run these commands to understand the project before making any recommendations: |
| 23 | |
| 24 | ```bash |
| 25 | # Check existing Sentry dependency |
| 26 | grep -i sentry go.mod 2>/dev/null |
| 27 | |
| 28 | # Detect web framework |
| 29 | grep -E "gin-gonic/gin|labstack/echo|gofiber/fiber|valyala/fasthttp|kataras/iris|urfave/negroni" go.mod 2>/dev/null |
| 30 | |
| 31 | # Detect gRPC |
| 32 | grep "google.golang.org/grpc" go.mod 2>/dev/null |
| 33 | |
| 34 | # Detect logging libraries |
| 35 | grep -E "sirupsen/logrus|go.uber.org/zap|rs/zerolog|log/slog" go.mod go.sum 2>/dev/null |
| 36 | |
| 37 | # Detect cron / scheduler patterns |
| 38 | grep -E "robfig/cron|go-co-op/gocron|jasonlvhit/gocron" go.mod 2>/dev/null |
| 39 | |
| 40 | # Detect OpenTelemetry usage |
| 41 | grep "go.opentelemetry.io" go.mod 2>/dev/null |
| 42 | |
| 43 | # Check for companion frontend |
| 44 | ls frontend/ web/ client/ ui/ 2>/dev/null |
| 45 | ``` |
| 46 | |
| 47 | **What to note:** |
| 48 | - Is `sentry-go` already in `go.mod`? If yes, skip to Phase 2 (configure features). |
| 49 | - Which framework is used? (Determines which sub-package and middleware to install.) |
| 50 | - Which logging library? (Enables automatic log capture.) |
| 51 | - Are cron/scheduler patterns present? (Triggers Crons recommendation.) |
| 52 | - Is there a companion frontend directory? (Triggers Phase 4 cross-link.) |
| 53 | |
| 54 | --- |
| 55 | |
| 56 | ## Phase 2: Recommend |
| 57 | |
| 58 | Based on what you found, present a concrete recommendation. Don't ask open-ended questions — lead with a proposal: |
| 59 | |
| 60 | **Recommended (core coverage):** |
| 61 | - ✅ **Error Monitoring** — always; captures panics and unhandled errors |
| 62 | - ✅ **Tracing** — if HTTP handlers, gRPC, or DB calls are detected |
| 63 | - ✅ **Logging** — if logrus, zap, zerolog, or slog is detected |
| 64 | |
| 65 | **Optional (enhanced observability):** |
| 66 | - ⚡ **Metrics** — custom counters and gauges for business KPIs / SLOs |
| 67 | - ⚡ **Crons** — detect silent failures in scheduled jobs |
| 68 | - ⚠️ **Profiling** — removed in sentry-go v0.31.0; see `references/profiling.md` for alternatives |
| 69 | |
| 70 | **Recommendation logic:** |
| 71 | |
| 72 | | Feature | Recommend when... | |
| 73 | |---------|------------------| |
| 74 | | Error Monitoring | **Always** — non-negotiable baseline | |
| 75 | | Tracing | `net/http`, gin, echo, fiber, gRPC, or DB calls detected | |
| 76 | | Logging | logrus, zap, zerolog, or `log/slog` imports detected | |
| 77 | | Metrics | Business events, SLO tracking, or counters needed | |
| 78 | | Crons | `robfig/cron`, `gocron`, or scheduled job patterns detected | |
| 79 | | Profiling | ⚠️ **Removed in v0.31.0** — do not recommend; see `references/profiling.md` | |
| 80 | |
| 81 | Propose: *"I recommend setting up Error Monitoring + Tracing [+ Logging if applicable]. Want me to also add Metrics or Crons?"* |
| 82 | |
| 83 | --- |
| 84 | |
| 85 | ## Phase 3: Guide |
| 86 | |
| 87 | ### Install |
| 88 | |
| 89 | ```bash |
| 90 | # Core SDK (always required) |
| 91 | go get github.com/getsentry/sentry-go |
| 92 | |
| 93 | # Framework sub-package — install only what matches detected framework: |
| 94 | go get github.com/getsentry/sentry-go/http # net/http |
| 95 | go get github.com/getsentry/sentry-go/gin # Gin |
| 96 | go get github.com/getsentry/sentry-go/echo # Echo |
| 97 | go get github.com/getsentry/sentry-go/fiber # Fiber |
| 98 | go get github.com/getsentry/sentry-go/fasthttp # FastHTTP |
| 99 | |
| 100 | # Logging sub-packages — install only what matches detected logging lib: |
| 101 | go get github.com/getsentry/sentry-go/logrus # Logrus |
| 102 | go get github.com/getsentry/sentry-go/slog # slog (stdlib, Go 1.21+) |
| 103 | go get github.com/getsentry/sentry-go/zap # Zap |
| 104 | go get github.com/getsentry/sentry-go/zerolog # Zerolog |
| 105 | |
| 106 | # gRPC interceptors (only if google.golang.org/grpc is detected): |
| 107 | go get github.com/getsentry/sentry-go/grpc |
| 108 | |
| 109 | # OpenTelemetry bridge (only if OTel is already in use): |
| 110 | go get github.com/getsentry/sentry-go/otel |
| 111 | ``` |
| 112 | |
| 113 | ### Quick Start — Recommended Init |
| 114 | |
| 115 | Add to `main()` before any other code. This config enables the most features with sensible defaults: |
| 116 | |
| 117 | ```go |
| 118 | import ( |
| 119 | "log" |
| 120 | "os" |
| 121 | "time" |
| 122 | "github.com/getsentry/sentry-go" |
| 123 | ) |
| 124 | |
| 125 | err := sentry.Init(sentry.ClientOptions{ |
| 126 | Dsn: os.Getenv("SEN |