Releases: getsentry/sentry-go
0.31.1
0.31.0
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)
0.30.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.30.0.
Features
- Add
sentryzerolog
integration (#857) - Add
sentryslog
integration (#865) - Always set Mechanism Type to generic (#896)
Bug Fixes
- Prevent panic in
fasthttp
andfiber
integration in case a malformed URL has to be parsed (#912)
Misc
Drop support for Go 1.18, 1.19 and 1.20. The currently supported Go versions are the last 3 stable releases: 1.23, 1.22 and 1.21.
0.29.1
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.29.1.
Bug Fixes
- Correlate errors to the current trace (#886)
- Set the trace context when the transaction finishes (#888)
Misc
- Update the
sentrynegroni
integration to use the latest (v3.1.1) version of Negroni (#885)
0.29.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.29.0.
Breaking Changes
- Remove the
sentrymartini
integration (#861) - The
WrapResponseWriter
has been moved from thesentryhttp
package to theinternal/httputils
package. If you've imported it previosuly, you'll need to copy the implementation in your project. (#871)
Features
-
Add new convenience methods to continue a trace and propagate tracing headers for error-only use cases. (#862)
If you are not using one of our integrations, you can manually continue an incoming trace by using
sentry.ContinueTrace()
by providing thesentry-trace
andbaggage
header received from a downstream SDK.hub := sentry.CurrentHub() sentry.ContinueTrace(hub, r.Header.Get(sentry.SentryTraceHeader), r.Header.Get(sentry.SentryBaggageHeader)),
You can use
hub.GetTraceparent()
andhub.GetBaggage()
to fetch the necessary header values for outgoing HTTP requests.hub := sentry.GetHubFromContext(ctx) req, _ := http.NewRequest("GET", "http://localhost:3000", nil) req.Header.Add(sentry.SentryTraceHeader, hub.GetTraceparent()) req.Header.Add(sentry.SentryBaggageHeader, hub.GetBaggage())
Bug Fixes
- Initialize
HTTPTransport.limit
ifnil
(#844) - Fix
sentry.StartTransaction()
returning a transaction with an outdated context on existing transactions (#854) - Treat
Proxy-Authorization
as a sensitive header (#859) - Add support for the
http.Hijacker
interface to thesentrynegroni
package (#871) - Go version >= 1.23: Use value from
http.Request.Pattern
for HTTP transaction names when usingsentryhttp
&sentrynegroni
(#875) - Go version >= 1.21: Fix closure functions name grouping (#877)
Misc
- Collect
span
origins (#849)
0.28.1
0.28.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.28.0.
Features
- Add a
Fiber
performance tracing & error reporting integration (#795) - Add performance tracing to the
Echo
integration (#722) - Add performance tracing to the
FastHTTP
integration (#732) - Add performance tracing to the
Iris
integration (#809) - Add performance tracing to the
Negroni
integration (#808) - Add
FailureIssueThreshold
&RecoveryThreshold
toMonitorConfig
(#775) - Use
errors.Unwrap()
to create exception groups (#792) - Add support for matching on strings for
ClientOptions.IgnoreErrors
&ClientOptions.IgnoreTransactions
(#819) - Add
http.request.method
attribute for performance span data (#786) - Accept
interface{}
for span data values (#784)
Fixes
- Fix missing stack trace for parsing error in
logrusentry
(#689)
0.27.0
0.26.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.26.0.
Breaking Changes
As previously announced, this release removes some methods from the SDK.
sentry.TransactionName()
usesentry.WithTransactionName()
instead.sentry.OpName()
usesentry.WithOpName()
instead.sentry.TransctionSource()
usesentry.WithTransactionSource()
instead.sentry.SpanSampled()
usesentry.WithSpanSampled()
instead.
Features
-
Add
WithDescription
span option (#751)span := sentry.StartSpan(ctx, "http.client", WithDescription("GET /api/users"))
-
Add support for package name parsing in Go 1.20 and higher (#730)
Bug Fixes
0.25.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.25.0.
Breaking Changes
As previously announced, this release removes two global constants from the SDK.
sentry.Version
was removed. Usesentry.SDKVersion
instead (#727)sentry.SDKIdentifier
was removed. UseClient.GetSDKIdentifier()
instead (#727)
Features
- Add
ClientOptions.IgnoreTransactions
, which allows you to ignore specific transactions based on their name (#717) - Add
ClientOptions.Tags
, which allows you to set global tags that are applied to all events. You can also define tags by settingSENTRY_TAGS_
environment variables (#718)
Bug fixes
- Fix an issue in the profiler that would cause an infinite loop if the duration of a transaction is longer than 30 seconds (#724)
Misc
dsn.RequestHeaders()
is not to be removed, though it is still considered deprecated and should only be used when using a custom transport that sends events to the/store
endpoint (#720)