Skip to content

Releases: getsentry/sentry-go

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)

0.24.1

13 Sep 13:29
Compare
Choose a tag to compare

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

Bug fixes

  • Prevent a panic in sentryotel.flushSpanProcessor() ((#711))
  • Prevent a panic when setting the SDK identifier (#715)

0.24.0

05 Sep 10:03
Compare
Choose a tag to compare

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

Deprecations

  • sentry.Version to be removed in 0.25.0. Use sentry.SDKVersion instead.
  • sentry.SDKIdentifier to be removed in 0.25.0. Use Client.GetSDKIdentifier() instead.
  • dsn.RequestHeaders() to be removed after 0.25.0, but no earlier than December 1, 2023. Requests to the /envelope endpoint are authenticated using the DSN in the envelope header.

Features

  • Run a single instance of the profiler instead of multiple ones for each Go routine (#655)
  • Use the route path as the transaction names when using the Gin integration (#675)
  • Set the SDK name accordingly when a framework integration is used (#694)
  • Read release information (VCS revision) from debug.ReadBuildInfo (#704)

Bug fixes

  • [otel] Fix incorrect usage of attributes.Value.AsString (#684)
  • Fix trace function name parsing in profiler on go1.21+ (#695)

Misc

0.23.0

01 Aug 16:30
Compare
Choose a tag to compare

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

Features

  • Initial support for Cron Monitoring (#661)

    This is how the basic usage of the feature looks like:

    // 🟑 Notify Sentry your job is running:
    checkinId := sentry.CaptureCheckIn(
      &sentry.CheckIn{
        MonitorSlug: "<monitor-slug>",
        Status:      sentry.CheckInStatusInProgress,
      },
      nil,
    )
    
    // Execute your scheduled task here...
    
    // 🟒 Notify Sentry your job has completed successfully:
    sentry.CaptureCheckIn(
      &sentry.CheckIn{
        ID:          *checkinId,
        MonitorSlug: "<monitor-slug>",
        Status:      sentry.CheckInStatusOK,
      },
      nil,
    )

    A full example of using Crons Monitoring is available here.

    More documentation on configuring and using Crons can be found here.

  • Add support for Event Attachments (#670)

    It's now possible to add file/binary payloads to Sentry events:

    sentry.ConfigureScope(func(scope *sentry.Scope) {
      scope.AddAttachment(&Attachment{
        Filename:    "report.html",
        ContentType: "text/html",
        Payload:     []byte("<h1>Look, HTML</h1>"),
      })
    })

    The attachment will then be accessible on the Issue Details page.

  • Add sampling decision to trace envelope header (#666)

  • Expose SpanFromContext function (#672)

Bug fixes

  • Make Span.Finish a no-op when the span is already finished (#660)

0.22.0

16 Jun 10:27
Compare
Choose a tag to compare

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

This release contains initial profiling support, as well as a few bug fixes and improvements.

Features

  • Initial (alpha) support for profiling (#626)

    Profiling is disabled by default. To enable it, configure both TracesSampleRate and ProfilesSampleRate when initializing the SDK:

    err := sentry.Init(sentry.ClientOptions{
      Dsn: "__DSN__",
      EnableTracing: true,
      TracesSampleRate: 1.0,
      // The sampling rate for profiling is relative to TracesSampleRate. In this case, we'll capture profiles for 100% of transactions.
      ProfilesSampleRate: 1.0,
    })

    More documentation on profiling and current limitations can be found here.

  • Add transactions/tracing support go the Gin integration (#644)

Bug fixes

  • Always set a valid source on transactions (#637)
  • Clone scope.Context in more places to avoid panics on concurrent reads and writes (#638)
  • Fix frames recognized as not being in-app still showing as in-app (#647)

0.21.0

08 May 14:07
Compare
Choose a tag to compare

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

Note: this release includes one breaking change and some deprecations, which are listed below.

Breaking Changes

This change does not apply if you use https://sentry.io

  • Remove support for the /store endpoint (#631)
    • This change requires a self-hosted version of Sentry 20.6.0 or higher. If you are using a version of self-hosted Sentry (aka on-premise) older than 20.6.0, then you will need to upgrade your instance.

Features

  • Rename four span option functions (#611, #624)
    • TransctionSource -> WithTransactionSource
    • SpanSampled -> WithSpanSampled
    • OpName -> WithOpName
    • TransactionName -> WithTransactionName
    • Old functions TransctionSource, SpanSampled, OpName, and TransactionName are still available but are now deprecated and will be removed in a future release.
  • Make client.EventFromMessage and client.EventFromException methods public (#607)
  • Add client.SetException method (#607)
    • This allows to set or add errors to an existing Event.

Bug Fixes

  • Protect from panics while doing concurrent reads/writes to Span data fields (#609)
  • [otel] Improve detection of Sentry-related spans (#632, #636)
    • Fixes cases when HTTP spans containing requests to Sentry were captured by Sentry (#627)

Misc

0.20.0

31 Mar 09:54
Compare
Choose a tag to compare

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

Note: this release has some breaking changes, which are listed below.

Breaking Changes

  • Remove the following methods: Scope.SetTransaction(), Scope.Transaction() (#605)

    Span.Name should be used instead to access the transaction's name.

    For example, the following TracesSampler function should be now written as follows:

    Before:

    TracesSampler: func(ctx sentry.SamplingContext) float64 {
      hub := sentry.GetHubFromContext(ctx.Span.Context())
      if hub.Scope().Transaction() == "GET /health" {
        return 0
      }
      return 1
    },

    After:

    TracesSampler: func(ctx sentry.SamplingContext) float64 {
      if ctx.Span.Name == "GET /health" {
        return 0
      }
      return 1
    },

Features

  • Add Span.SetContext() method (#599)
    • It is recommended to use it instead of hub.Scope().SetContext when setting or updating context on transactions.
  • Add DebugMeta interface to Event and extend Frame structure with more fields (#606)
    • More about DebugMeta interface here.

Bug Fixes

  • [otel] Fix missing OpenTelemetry context on some events (#599, #605)
  • [otel] Better handling for HTTP span attributes (#610)

Misc

0.19.0

06 Mar 07:46
Compare
Choose a tag to compare

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

Features

  • Add support for exception mechanism metadata (#564)
    • More about exception mechanisms here.

Bug Fixes

  • [otel] Use the correct "trace" context when sending a Sentry error (#580)

Misc

  • Drop support for Go 1.17, add support for Go 1.20 (#563)
    • According to our policy, we're officially supporting the last three minor releases of Go.
  • Switch repository license to MIT (#583)
    • More about Sentry licensing here.
  • Bump golang.org/x/text minimum required version to 0.3.8 (#586)