Releases: getsentry/sentry-go
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.
0.18.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.18.0.
This release contains initial support for OpenTelemetry and various other bug fixes and improvements.
Note: This is the last release supporting Go 1.17.
Features
-
Initial support for OpenTelemetry.
You can now send all your OpenTelemetry spans to Sentry.Install the
otel
modulego get github.com/getsentry/sentry-go \ github.com/getsentry/sentry-go/otel
Configure the Sentry and OpenTelemetry SDKs
import ( "go.opentelemetry.io/otel" sdktrace "go.opentelemetry.io/otel/sdk/trace" "github.com/getsentry/sentry-go" "github.com/getsentry/sentry-go/otel" // ... ) // Initlaize the Sentry SDK sentry.Init(sentry.ClientOptions{ Dsn: "__DSN__", EnableTracing: true, TracesSampleRate: 1.0, }) // Set up the Sentry span processor tp := sdktrace.NewTracerProvider( sdktrace.WithSpanProcessor(sentryotel.NewSentrySpanProcessor()), // ... ) otel.SetTracerProvider(tp) // Set up the Sentry propagator otel.SetTextMapPropagator(sentryotel.NewSentryPropagator())
You can read more about using OpenTelemetry with Sentry in our docs.
Bug Fixes
- Do not freeze the Dynamic Sampling Context when no Sentry values are present in the baggage header (#532)
- Create a frozen Dynamic Sampling Context when calling
span.ToBaggage()
(#566) - Fix baggage parsing and encoding in vendored otel package (#568)
Misc
0.17.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.17.0.
This release contains a new BeforeSendTransaction
hook option and corrects two regressions introduced in 0.16.0
.
Features
- Add
BeforeSendTransaction
hook toClientOptions
(#517)- Here's an example of how BeforeSendTransaction can be used to modify or drop transaction events.
Bug Fixes
- Do not crash in Span.Finish() when the Client is empty (#520)
- Fixes #518
- Attach non-PII/non-sensitive request headers to events when
ClientOptions.SendDefaultPii
is set tofalse
(#524)- Fixes #523
Misc
0.16.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.16.0.
Due to ongoing work towards a stable API for v1.0.0
, we sadly had to include two breaking changes in this release.
Breaking Changes
- Add
EnableTracing
, a boolean option flag to enable performance monitoring (false
by default).-
If you're using
TracesSampleRate
orTracesSampler
, this option is required to enable performance monitoring.sentry.Init(sentry.ClientOptions{ EnableTracing: true, TracesSampleRate: 1.0, })
-
- Unify TracesSampler #498
-
TracesSampler
was changed to a callback that must return afloat64
between0.0
and1.0
.For example, you can apply a sample rate of
1.0
(100%) to all/api
transactions, and a sample rate of0.5
(50%) to all other transactions.
You can read more about this in our SDK docs.sentry.Init(sentry.ClientOptions{ TracesSampler: sentry.TracesSampler(func(ctx sentry.SamplingContext) float64 { hub := sentry.GetHubFromContext(ctx.Span.Context()) name := hub.Scope().Transaction() if strings.HasPrefix(name, "GET /api") { return 1.0 } return 0.5 }), }
-
Features
- Send errors logged with Logrus to Sentry.
- Have a look at our logrus examples on how to use the integration.
- Add support for Dynamic Sampling #491
- You can read more about Dynamic Sampling in our product docs.
- Add detailed logging about the reason transactions are being dropped.
- You can enable SDK logging via
sentry.ClientOptions.Debug: true
.
- You can enable SDK logging via
Bug Fixes
0.15.0
0.14.0
- feat: Add function to continue from trace string (#434)
- feat: Add
max-depth
options (#428) - [breaking] ref: Use a
Context
type mapping to amap[string]interface{}
for all event contexts (#444) - [breaking] ref: Replace deprecated
ioutil
pkg withos
&io
(#454) - ref: Optimize
stacktrace.go
from size and speed (#467) - ci: Test against
go1.19
andgo1.18
, dropgo1.16
andgo1.15
support (#432, #477) - deps: Dependency update to fix CVEs (#462, #464, #477)
NOTE: This version drops support for Go 1.16 and Go 1.15. The currently supported Go versions are the last 3 stable releases: 1.19, 1.18 and 1.17.