Releases: getsentry/sentry-go
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)
0.24.1
0.24.0
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. Usesentry.SDKVersion
instead.sentry.SDKIdentifier
to be removed in 0.25.0. UseClient.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
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
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
andProfilesSampleRate
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
0.21.0
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
, andTransactionName
are still available but are now deprecated and will be removed in a future release.
- Make
client.EventFromMessage
andclient.EventFromException
methods public (#607) - Add
client.SetException
method (#607)- This allows to set or add errors to an existing
Event
.
- This allows to set or add errors to an existing
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
- Drop testing in (legacy) GOPATH mode (#618)
- Remove outdated documentation from https://pkg.go.dev/github.com/getsentry/sentry-go (#623)
0.20.0
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.
- It is recommended to use it instead of
- Add
DebugMeta
interface toEvent
and extendFrame
structure with more fields (#606)- More about DebugMeta interface here.
Bug Fixes
- [otel] Fix missing OpenTelemetry context on some events (#599, #605)
- Fixes (#596).
- [otel] Better handling for HTTP span attributes (#610)
Misc
- Bump minimum versions:
github.com/kataras/iris/v12
to 12.2.0,github.com/labstack/echo/v4
to v4.10.0 (#595) - Bump
google.golang.org/protobuf
minimum required version to 1.29.1 (#604)- This fixes a potential denial of service issue (CVE-2023-24535).
- Exclude the
otel
module when building in GOPATH mode (#615)
0.19.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.19.0.
Features
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)- This fixes CVE-2022-32149 vulnerability.