Legacy SDK
Deprecation Warning
A new Go SDK has superseded this deprecated version. Sentry preserves this documentation for customers using the old raven-go
client. Learn more about the
projectRepresents your service in Sentry and allows you to scope events to a distinct application.
on GitHub and check out our migration guide.Raven-Go provides a Sentry client implementation for the Go programming language.
Getting Started
Getting started with Sentry is a three step process:
Installation
Raven-Go can be installed like any other Go library through go get
:
Copied
go get github.com/getsentry/raven-go
Configuration
To use raven-go
, you’ll need to import the raven
package, then initialize your
DSNThe Data Source Name (DSN) key tells the Sentry SDK where to send events, ensuring they go to the right project.
globally. If you specify the SENTRY_DSN
environment variable, this will be done automatically for you. The release and environment can also be specified in the environment variables SENTRY_RELEASE
and SENTRY_ENVIRONMENT
respectively.
More on this in Configuration section.
Copied
package main
import "github.com/getsentry/raven-go"
func init() {
raven.SetDSN("https://examplePublicKey@o0.ingest.sentry.io/0")
}
Next Steps
For more detailed information about how to get the most out of raven-go
there is additional documentation available that covers all the rest:
Resources:
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) to suggesting an update ("yeah, this would be better").
- Package:
- github:getsentry/sentry-go
- Version:
- 0.25.0
- Repository:
- https://github.com/getsentry/sentry-go/
- API Documentation:
- https://pkg.go.dev/github.com/getsentry/sentry-go