sentry-go

The official Go SDK for capturing errors, panics, and performance traces and sending them to Sentry.

SDK
Go
vv0.49.0
1,103stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
95/100Excellent
Development Activity96
Maintenance96
Community88
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
86/100Excellent
Architecture88
Code Quality90
Innovation85
Learning Curve80

sentry-go is the official Go client for Sentry, the error-tracking and performance-monitoring platform. It captures unhandled panics and errors, attaches breadcrumbs and contextual scope data, and reports them to Sentry with stack traces resolved from Go’s runtime. Beyond error capture, it implements distributed tracing (transactions and spans), structured logging, and metrics, all configurable through a single ClientOptions struct passed to Init.

The SDK ships first-class middleware for a wide range of Go web frameworks and HTTP libraries — net/http, Gin, Echo, Fiber, Iris, fasthttp, gRPC, Negroni — plus adapters for popular loggers (logrus, slog, zap, zerolog) and an OpenTelemetry bridge, so most Go services can wire up error and performance monitoring with a few lines of setup code.

What You Get

  • Panic and error capture with resolved Go stack traces via CaptureException and Recover/RecoverWithContext
  • Distributed tracing with StartTransaction/StartSpan, trace propagation headers, and configurable sampling
  • Framework middleware for net/http, Gin, Echo, Fiber, Iris, fasthttp, gRPC, and Negroni
  • Logger integrations for logrus, slog, zap, and zerolog that forward log entries as breadcrumbs or events
  • Structured logging and metrics APIs alongside error/performance reporting
  • Configurable HTTP transports (async batching or HTTPSyncTransport for serverless) with rate-limit handling

Common Use Cases

  • Reporting unhandled panics from production HTTP servers with full stack traces and request context
  • Instrumenting distributed traces across microservices using StartTransaction and ContinueTrace
  • Correlating structured logs from logrus/zap/zerolog with Sentry events via breadcrumbs
  • Monitoring scheduled/cron jobs with CaptureCheckIn and MonitorConfig
  • Attaching custom user, tag, and extra-data context to errors via Scope

Under The Hood

Architecture The SDK centers on a Hub/Scope/Client pattern (hub.go, scope.go, client.go): a Hub holds a stack of Scopes and a bound Client, and package-level functions in sentry.go (Init, CaptureException, Recover, WithScope) delegate to CurrentHub(). Context-based hub retrieval (GetHubFromContext/SetHubOnContext) enables per-request isolation — the http/sentryhttp.go middleware clones a fresh hub per request, starts a transaction, and defers panic recovery against that hub. The transport layer (transport.go) implements batching and rate-limit handling independently of capture logic, so swapping HTTPTransport for HTTPSyncTransport requires no changes elsewhere. Tracing (tracing.go) is a parallel subsystem built on Span/Transaction structs threaded through context.Context and consumed uniformly by the 13+ framework-integration packages. Wire-format, rate-limiting, and telemetry concerns are isolated under internal/, keeping the public API surface small; changing the Hub/Scope contract would require touching every framework integration and both context helpers.

Tech Stack The root module (github.com/getsentry/sentry-go, go.mod, Go 1.25) carries minimal dependencies — go-errors/errors, pingcap/errors, and pkg/errors for compatibility across different error-wrapping styles, plus stretchr/testify, google/go-cmp, and uber-go/goleak for testing. Framework integrations (gin/, echo/, fiber/, grpc/, and others) live as separate Go modules coordinated through a root go.work file, so consumers only pull in the framework dependency they actually use rather than the full integration matrix. CI runs golangci-lint, govulncheck, and CodeQL across a Go version matrix.

Code Quality 307 test functions across 34 test files in the root package alone, with additional suites inside each framework-integration submodule. Tests use testify for assertions, go-cmp for deep-equal diffs, and goleak to catch goroutine leaks in the concurrency-heavy batch processor and telemetry code. Errors are returned rather than swallowed in the reviewed core files (client.go, sentry.go, http/sentryhttp.go), and CI enforces linting, dependency vulnerability scanning, and static analysis on every pull request.

API Design The public API is a small set of package-level functions (Init, CaptureException, CaptureMessage, Recover, WithScope) that delegate to a hidden global Hub, so a minimal integration is a single Init call plus a deferred Recover. Power users can reach the same functionality through an explicit context-scoped Hub for goroutine-safe, multi-tenant use. Configuration uses a declarative ClientOptions struct rather than functional options, and every framework integration follows the same New(Options) *Handler plus Handle/HandleFunc middleware shape, so moving between frameworks doesn’t require relearning the integration surface. Extensive godoc comments and 26 runnable examples under _examples/ shorten the path to a working integration.

Used by 13 apps in this directory

Python
55%
Other

authentik

Authentication · Security

25,245

The self-hosted Identity Provider that replaces Okta, Auth0, and Entra ID with a unified SSO platform supporting SAML, OAuth2/OIDC, LDAP, RADIUS, and WebAuthn.

View details
92
Repo Health
81
Technical
67
Dependency
Built with
Python55%
TypeScript34%
Updated today
Go
55%
Apache 2.0

Authgear

Authentication

2,014

Open-source, self-hostable authentication platform with passkeys, biometric login, SSO, MFA, and GraphQL admin API — a full Auth0/Clerk/Firebase alternative for SaaS and mobile apps.

View details
88
Repo Health
81
Technical
69
Dependency
Built with
Go55%
HTML25%
TypeScript17%
Updated 4 days ago
Go
73%
Other

Convoy

Developer Tools · Devops

2,862

Convoy is an open-source, cloud-native webhooks gateway that ingests events over HTTP or straight from Kafka, SQS, Google Pub/Sub, and RabbitMQ, then reliably delivers them to subscriber endpoints with signed payloads, automatic retries, circuit breaking, and JavaScript-based transformations.

View details
89
Repo Health
81
Technical
66
Dependency
Built with
Go73%
TypeScript13%
HTML12%
Updated yesterday
Go
75%
MIT

Digger

Devops · Automation · Developer Tools

5,033

Run Terraform and OpenTofu natively inside your existing CI pipeline — no separate runners, no third-party secrets, no extra compute costs.

View details
71
Repo Health
73
Technical
67
Dependency
Built with
Go75%
TypeScript15%
Updated 2 weeks ago
Go
84%
MIT

Hatchet

AI Development · Developer Tools · Automation

7,812

A Postgres-backed orchestration engine for background tasks, AI agents, and durable workflows that replaces Redis queues and multi-datastore durable execution platforms with a single self-hostable service.

View details
88
Repo Health
83
Technical
68
Dependency
Built with
Go84%
PLpgSQL11%
Updated today
Go
58%
MIT

hoop

Security · Monitoring

805

A wire-protocol gateway that enforces data masking, command blocking, approval workflows, and full session recording for engineers and AI agents accessing production infrastructure.

View details
85
Repo Health
80
Technical
65
Dependency
Built with
Go58%
Clojure19%
JavaScript14%
Updated 2 days ago
Go
91%
AGPL 3.0

Lago

Ecommerce · Invoicing Finance

10,444

Open-source metering, billing, and revenue infrastructure for product-led companies that need complete control over their pricing stack.

View details
86
Repo Health
81
Technical
74
Dependency
Built with
Go91%
Updated 2 days ago
TypeScript
51%
Other

Mattermost

Team Chat · Collaboration · Devops

38,940

Open core, self-hosted team collaboration with chat, AI agents, voice calling, and deep DevOps integrations — all under your control.

View details
96
Repo Health
87
Technical
65
Dependency
Built with
TypeScript51%
Go40%
Updated yesterday
TypeScript
55%
Other

OpenReplay

Analytics

12,605

Self-hosted session replay and product analytics suite that lets you see exactly what users do on your web app — without sending data to third parties.

View details
90
Repo Health
77
Technical
71
Dependency
Built with
TypeScript55%
Go12%
Python10%
Updated 3 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search