Skip to content

Releases: getsentry/sentry-go

0.31.1

02 Jan 15:59
454d469
Compare
Choose a tag to compare

The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.31.1.

Bug Fixes

  • Correct wrong module name for sentry-go/logrus (#950)

0.31.0

02 Jan 13:13
17ceb6c
Compare
Choose a tag to compare

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 the User 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 to go get the integration you want to use. For example, if you want to use the echo integration, you'll need to run go get github.com/getsentry/sentry-go/echo (#919).

Features

  • Add the ability to override hub in context for integrations that use custom context. (#931)

  • Add HubProvider Hook for sentrylogrus, 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

0.30.0

03 Dec 15:36
c93781f
Compare
Choose a tag to compare

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 and fiber 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

14 Oct 11:23
Compare
Choose a tag to compare

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

10 Sep 08:54
Compare
Choose a tag to compare

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 the sentryhttp package to the internal/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 the sentry-trace and baggage 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() and hub.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 if nil (#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 the sentrynegroni package (#871)
  • Go version >= 1.23: Use value from http.Request.Pattern for HTTP transaction names when using sentryhttp & sentrynegroni (#875)
  • Go version >= 1.21: Fix closure functions name grouping (#877)

Misc

  • Collect span origins (#849)

0.28.1

12 Jun 13:48
Compare
Choose a tag to compare

The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.28.1.

Bug Fixes

  • Implement http.ResponseWriter to hook into various parts of the response process (#837)

0.28.0

27 May 11:16
Compare
Choose a tag to compare

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 to MonitorConfig (#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

07 Feb 15:57
Compare
Choose a tag to compare

The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.27.0.

Breaking Changes

  • Exception.ThreadId is now typed as uint64. It was wrongly typed as string before. (#770)

Misc

  • Export Event.Attachments (#771)

0.26.0

10 Jan 16:26
Compare
Choose a tag to compare

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() use sentry.WithTransactionName() instead.
  • sentry.OpName() use sentry.WithOpName() instead.
  • sentry.TransctionSource() use sentry.WithTransactionSource() instead.
  • sentry.SpanSampled() use sentry.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

  • Apply ClientOptions.SampleRate only to errors & messages (#754)
  • Check if git is available before executing any git commands (#737)

0.25.0

04 Oct 10:43
Compare
Choose a tag to compare

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. Use sentry.SDKVersion instead (#727)
  • sentry.SDKIdentifier was removed. Use Client.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 setting SENTRY_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)