MCPcopy Index your code
hub / github.com/getsentry/sentry-go

github.com/getsentry/sentry-go @v0.47.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.47.0 ↗ · + Follow
2,358 symbols 10,652 edges 215 files 781 documented · 33% 88 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

  <img src="https://sentry-brand.storage.googleapis.com/sentry-logo-black.png" alt="Sentry" width="280">

Official Sentry SDK for Go

Build Status Go Report Card Discord X Follow go.dev

sentry-go provides a Sentry client implementation for the Go programming language. This is the next generation of the Go SDK for Sentry, intended to replace the raven-go package.

Looking for the old raven-go SDK documentation? See the Legacy client section here. If you want to start using sentry-go instead, check out the migration guide.

Requirements

The only requirement is a Go compiler.

We follow Go's official release policy, supporting the two most recent Go releases. Each major Go release is supported until there are two newer major releases. The exact versions are defined in GitHub workflow.

In addition, we run tests against the current master branch of the Go toolchain, though support for this configuration is best-effort.

Installation

sentry-go can be installed like any other Go library through go get:

$ go get github.com/getsentry/sentry-go@latest

Check out the list of released versions.

Configuration

To use sentry-go, you’ll need to import the sentry-go package and initialize it with your DSN and other options.

If not specified in the SDK initialization, the DSN, Release and Environment are read from the environment variables SENTRY_DSN, SENTRY_RELEASE and SENTRY_ENVIRONMENT, respectively.

More on this in the Configuration section of the official Sentry Go SDK documentation.

Usage

The SDK supports reporting errors and tracking application performance.

To get started, have a look at one of our examples: - Basic error instrumentation - Error and tracing for HTTP servers

We also provide a complete API reference.

For more detailed information about how to get the most out of sentry-go, check out the official documentation:

Resources

License

Licensed under The MIT License, see LICENSE.

Community

Join Sentry's #go channel on Discord to get involved and help us improve the SDK!

Extension points exported contracts — how you extend this code

Integration (Interface)
Integration allows for registering a functions that modify or discard captured events. [9 implementers]
client.go
TelemetryItem (Interface)
TelemetryItem represents any telemetry data that can be stored in buffers. [8 implementers]
internal/protocol/interfaces.go
ReportableItem (Interface)
ReportableItem is the minimal surface needed for client report accounting. [9 implementers]
report/interfaces.go
Transport (Interface)
Transport is used by the Client to deliver events to remote server. [5 implementers]
transport.go
LogEntry (Interface)
LogEntry defines the interface for a log entry that supports chaining attributes. [3 implementers]
interfaces.go
Hook (Interface)
Hook is the logrus hook for Sentry. It is not safe to configure the hook while logging is happening. Please perform all [2 …
logrus/logrusentry.go
WrapResponseWriter (Interface)
WrapResponseWriter is a proxy around an http.ResponseWriter that allows you to hook into various parts of the response p [1 …
internal/httputils/wrap_writer.go
TraceAware (Interface)
TraceAware is implemented by items that can expose a trace ID. BucketedBuffer uses this to group items by trace. [1 implementers]
internal/telemetry/trace_aware.go

Core symbols most depended-on inside this repo

Equal
called by 359
internal/ratelimit/deadline.go
String
called by 251
interfaces.go
Error
called by 243
interfaces.go
Fatal
called by 211
interfaces.go
Events
called by 146
mocks.go
Add
called by 118
internal/telemetry/scheduler.go
FlushTimeout
called by 115
internal/testutils/consts.go
Flush
called by 103
transport.go

Shape

Function 1,145
Method 898
Struct 246
TypeAlias 33
Interface 25
FuncType 11

Languages

Go100%

Modules by API surface

interfaces.go99 symbols
tracing.go66 symbols
transport.go57 symbols
scope_test.go54 symbols
client_test.go54 symbols
tracing_test.go43 symbols
client.go43 symbols
logrus/logrusentry.go40 symbols
internal/http/transport.go38 symbols
hub_test.go38 symbols
internal/otel/baggage/baggage_test.go36 symbols
sql/internal/fakedriver/conn.go35 symbols

For agents

$ claude mcp add sentry-go \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact