The official Go SDK for Sentry (sentry.io)
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.26.0.
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.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)
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.25.0.
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)ClientOptions.IgnoreTransactions
, which allows you to ignore specific transactions based on their name (#717)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)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)The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.24.0.
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.debug.ReadBuildInfo
(#704)attributes.Value.AsString
(#684)The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.23.0.
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)
Span.Finish
a no-op when the span is already finished (#660)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.
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)
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.
This change does not apply if you use https://sentry.io
/store
endpoint (#631)
TransctionSource
-> WithTransactionSource
SpanSampled
-> WithSpanSampled
OpName
-> WithOpName
TransactionName
-> WithTransactionName
TransctionSource
, SpanSampled
, OpName
, and TransactionName
are still available but are now deprecated and will be removed in a future release.client.EventFromMessage
and client.EventFromException
methods public (#607)client.SetException
method (#607)
Event
.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.
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
},
Span.SetContext()
method (#599)
hub.Scope().SetContext
when setting or updating context on transactions.DebugMeta
interface to Event
and extend Frame
structure with more fields (#606)
github.com/kataras/iris/v12
to 12.2.0, github.com/labstack/echo/v4
to v4.10.0 (#595)
google.golang.org/protobuf
minimum required version to 1.29.1 (#604)
otel
module when building in GOPATH mode (#615)The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.19.0.
golang.org/x/text
minimum required version to 0.3.8 (#586)