Breaking Changes
-
Remove support for metrics. Read more about the end of the Metrics beta here. (#914)
-
Remove support for profiling. (#915)
-
Remove
Segment
field from theUser
struct. This field is no longer used in the Sentry product. (#928) -
Every integration is now a separate module, reducing the binary size and number of dependencies. Once you update
sentry-go
to latest version, you'll need togo get
the integration you want to use. For example, if you want to use theecho
integration, you'll need to rungo get github.com/getsentry/sentry-go/echo
(#919).
Features
-
Add the ability to override
hub
incontext
for integrations that use custom context. (#931) -
Add
HubProvider
Hook forsentrylogrus
, enabling dynamic Sentry hub allocation for each log entry or goroutine. (#936)
This change enhances compatibility with Sentry's recommendation of using separate hubs per goroutine. To ensure a separate Sentry hub for each goroutine, configure the HubProvider
like this:
hook, err := sentrylogrus.New(nil, sentry.ClientOptions{})
if err != nil {
log.Fatalf("Failed to initialize Sentry hook: %v", err)
}
// Set a custom HubProvider to generate a new hub for each goroutine or log entry
hook.SetHubProvider(func() *sentry.Hub {
client, _ := sentry.NewClient(sentry.ClientOptions{})
return sentry.NewHub(client, sentry.NewScope())
})
logrus.AddHook(hook)
Bug Fixes
- Add support for closing worker goroutines started by the
HTTPTranport
to prevent goroutine leaks. (#894)
client, _ := sentry.NewClient()
defer client.Close()
Worker can be also closed by calling Close()
method on the HTTPTransport
instance. Close
should be called after Flush
and before terminating the program otherwise some events may be lost.
transport := sentry.NewHTTPTransport()
defer transport.Close()
Misc
- Bump gin-gonic/gin to v1.9.1. (#946)