Back to Skills

sentry-go-sdk

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.

238stars30forksUpdated 7/16/2026

Security Assessment

High Risk(30/100)

Detected risks:

Persistence([references/crons.md] Crontab)
Sensitive File Access([references/logging.md] .env, [references/logging.md] .Env, [references/metrics.md] .env)
Security Score30/100

About sentry-go-sdk

The sentry-go-sdk skill is an opinionated wizard that scans a Go project and guides a complete Sentry setup for error monitoring, tracing, logging, metrics, and crons. It solves the problem of correctly wiring the getsentry/sentry-go SDK into diverse Go applications, supporting net/http, Gin, Echo, Fiber, FastHTTP, Iris, Negroni, and gRPC. It is invoked when a user asks to add Sentry to a Go app, install sentry-go, or configure observability features for Go. The docs note the SDK reflects sentry-go v0.43.0+ and that v0.33.0+ requires Go 1.25 or later.

The skill follows a three-phase workflow: Detect, Recommend, and Guide. Phase 1 runs grep commands against go.mod and go.sum to detect existing Sentry dependencies, web frameworks, logging libraries (logrus, zap, zerolog, log/slog), cron schedulers (robfig/cron, gocron), OpenTelemetry usage, and companion frontend directories. Phase 2 presents a concrete recommendation using a logic table, always recommending Error Monitoring, adding Tracing when HTTP/gRPC/DB calls are detected, and Logging when a supported logging library is found. Phase 3 provides install commands (go get github.com/getsentry/sentry-go plus framework and logging sub-packages), a recommended sentry.Init configuration using ClientOptions with Dsn from SENTRY_DSN, Environment, Release injected via -ldflags, EnableTracing, TracesSampleRate, and EnableLogs, plus a deferred sentry.Flush. A middleware table specifies per-framework import paths, middleware calls, and correct Repanic and WaitForDelivery settings, and covers hub access and gRPC interceptors.

This skill targets Go developers and teams instrumenting applications for observability with Sentry. It requires a Go project and a Sentry DSN, and per-feature reference files (error-monitoring.md, tracing.md, logging.md, metrics.md, crons.md, profiling.md) are loaded one at a time as features are configured. Stated limitations include that Profiling was removed in sentry-go v0.31.0 and should not be recommended, and Fiber and FastHTTP require Repanic: false with WaitForDelivery: true because valyala/fasthttp has no built-in recovery. The docs advise verifying against the official Sentry Go platform documentation before implementing.

FAQ

Which Go frameworks and integrations are supported?

It supports net/http, Gin, Echo, Fiber, FastHTTP, Iris, and Negroni via framework sub-packages, plus gRPC through sentrygrpc interceptors and an OpenTelemetry bridge when OTel is already in use.

What Go version and prerequisites are required?

The docs reflect sentry-go v0.43.0+, and as of v0.33.0+ the SDK requires Go 1.25 or later (supporting the two most recent Go major versions). You configure a Sentry DSN via the SENTRY_DSN environment variable in sentry.Init.

How does the skill decide which features to set up?

In Phase 1 it greps go.mod and go.sum to detect frameworks, logging libraries, cron schedulers, and OTel. Error Monitoring is always recommended; Tracing is added when HTTP, gRPC, or DB calls are detected; and Logging when logrus, zap, zerolog, or log/slog is present. Metrics and Crons are optional.

Is profiling available?

No. Profiling was removed in sentry-go v0.31.0 and the skill explicitly does not recommend it; see references/profiling.md for alternatives.

Why do Fiber and FastHTTP use different middleware options?

Fiber and FastHTTP are built on valyala/fasthttp, which has no built-in recovery, so their middleware should be configured with Repanic: false and WaitForDelivery: true, unlike net/http, Gin, Echo, Iris, and Negroni which use Repanic: true and WaitForDelivery: false.

All Files

7 files
references/logging.md10.3 KB
View
references/profiling.md1.3 KB
View
references/metrics.md7.8 KB
View
references/crons.md8.2 KB
View
SKILL.md12.4 KB
View
references/tracing.md11.6 KB
View
references/error-monitoring.md11.6 KB
View

Install sentry-go-sdk

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill