go-sentry-api
go-sentry-api copied to clipboard
Update module github.com/getsentry/sentry-go to v0.38.0
This PR contains the following updates:
| Package | Change | Age | Confidence |
|---|---|---|---|
| github.com/getsentry/sentry-go | v0.29.0 -> v0.38.0 |
Release Notes
getsentry/sentry-go (github.com/getsentry/sentry-go)
v0.38.0: 0.38.0
Breaking Changes
Features
-
Introduce a new async envelope transport and telemetry buffer to prioritize and batch events (#1094, #1093, #1107).
- Advantages:
- Prioritized, per-category buffers (errors, transactions, logs, check-ins) reduce starvation and improve resilience under load
- Batching for high-volume logs (up to 100 items or 5s) cuts network overhead
- Bounded memory with eviction policies
- Improved flush behavior with context-aware flushing
- Advantages:
-
Add
ClientOptions.DisableTelemetryBufferto opt out and fall back to the legacy transport layer (HTTPTransport/HTTPSyncTransport).err := sentry.Init(sentry.ClientOptions{ Dsn: "__DSN__", DisableTelemetryBuffer: true, // fallback to legacy transport })
Notes
- If a custom
Transportis provided, the SDK automatically disables the telemetry buffer and uses the legacy transport for compatibility.
v0.37.0: 0.37.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.37.0.
Breaking Changes
- Behavioral change for the
TraceIgnoreStatusCodesoption. The option now defaults to ignoring 404 status codes (#1122).
Features
- Add
sentry.originattribute to structured logs to identify log origin forslogandlogrusintegrations (auto.log.slog,auto.log.logrus) (#1121).
Bug Fixes
- Fix
slogevent handler to use the initial context, ensuring events use the correct hub/span when the emission context lacks one (#1133). - Improve exception chain processing by checking pointer values when tracking visited errors, avoiding instability for certain wrapped errors (#1132).
Misc
- Bump
golang.org/x/netto v0.38.0 (#1126).
v0.36.2: 0.36.2
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.36.2.
Bug Fixes
- Fix context propagation for logs to ensure logger instances correctly inherit span and hub information from their creation context (#1118)
- Logs now properly propagate trace context from the logger's original context, even when emitted in a different context
- The logger will first check the emission context, then fall back to its creation context, and finally to the current hub
v0.36.1: 0.36.1
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.36.1.
Bug Fixes
- Prevent panic when converting error chains containing non-comparable error types by using a safe fallback for visited detection in exception conversion (#1113)
v0.36.0: 0.36.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.36.0.
Breaking Changes
-
Behavioral change for the
MaxBreadcrumbsclient option. Removed the hard limit of 100 breadcrumbs, allowing users to set a larger limit and also changed the default limit from 30 to 100 (#1106)) -
The changes to error handling (#1075) will affect issue grouping. It is expected that any wrapped and complex errors will be grouped under a new issue group.
Features
-
Add support for improved issue grouping with enhanced error chain handling (#1075)
The SDK now provides better handling of complex error scenarios, particularly when dealing with multiple related errors or error chains. This feature automatically detects and properly structures errors created with Go's
errors.Join()function and other multi-error patterns.// Multiple errors are now properly grouped and displayed in Sentry err1 := errors.New("err1") err2 := errors.New("err2") combinedErr := errors.Join(err1, err2) // When captured, these will be shown as related exceptions in Sentry sentry.CaptureException(combinedErr) -
Add
TraceIgnoreStatusCodesoption to allow filtering of HTTP transactions based on status codes (#1089)- Configure which HTTP status codes should not be traced by providing single codes or ranges
- Example:
TraceIgnoreStatusCodes: [][]int{{404}, {500, 599}}ignores 404 and server errors 500-599
Bug Fixes
- Fix logs being incorrectly filtered by
BeforeSendcallback (#1109)- Logs now bypass the
processEventmethod and are sent directly to the transport - This ensures logs are only filtered by
BeforeSendLog, not by the error/messageBeforeSendcallback
- Logs now bypass the
Misc
- Add support for Go 1.25 and drop support for Go 1.22 (#1103)
v0.35.3: 0.35.3
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.35.3.
Bug Fixes
- Add missing rate limit categories (#1082)
v0.35.2: 0.35.2
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.35.2.
Bug Fixes
- Fix OpenTelemetry spans being created as transactions instead of child spans (#1073)
Misc
- Add
MockTransportto test clients for improved testing (#1071)
v0.35.1: 0.35.1
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.35.1.
Bug Fixes
- Fix race conditions when accessing the scope during logging operations (#1050)
- Fix nil pointer dereference with malformed URLs when tracing is enabled in
fasthttpandfiberintegrations (#1055)
Misc
- Bump
github.com/gofiber/fiber/v2from 2.52.5 to 2.52.9 in/fiber(#1067)
v0.35.0: 0.35.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.35.0.
Breaking Changes
- Changes to the logging API (#1046)
The logging API now supports a fluent interface for structured logging with attributes:
// usage before
logger := sentry.NewLogger(ctx)
// attributes weren't being set permanently
logger.SetAttributes(
attribute.String("version", "1.0.0"),
)
logger.Infof(ctx, "Message with parameters %d and %d", 1, 2)
// new behavior
ctx := context.Background()
logger := sentry.NewLogger(ctx)
// Set permanent attributes on the logger
logger.SetAttributes(
attribute.String("version", "1.0.0"),
)
// Chain attributes on individual log entries
logger.Info().
String("key.string", "value").
Int("key.int", 42).
Bool("key.bool", true).
Emitf("Message with parameters %d and %d", 1, 2)
Bug Fixes
- Correctly serialize
FailureIssueThresholdandRecoveryThresholdonto check-in payloads (#1060)
v0.34.1: 0.34.1
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.34.1.
Bug Fixes
- Allow flush to be used multiple times without issues, particularly for the batch logger (#1051)
- Fix race condition in
Scope.GetSpan()method by adding proper mutex locking (#1044) - Guard transport on
Close()to prevent panic when called multiple times (#1044)
v0.34.0: 0.34.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.34.0.
Breaking Changes
- Logrus structured logging support replaces the
sentrylogrus.Hooksignature from a*Hookto an interface.
var hook *sentrylogrus.Hook
hook = sentrylogrus.New(
// ... your setup
)
// should change the definition to
var hook sentrylogrus.Hook
hook = sentrylogrus.New(
// ... your setup
)
Features
ctx := context.Background()
handler := sentryslog.Option{
EventLevel: []slog.Level{slog.LevelError, sentryslog.LevelFatal}, // Only Error and Fatal as events
LogLevel: []slog.Level{slog.LevelWarn, slog.LevelInfo}, // Only Warn and Info as logs
}.NewSentryHandler(ctx)
logger := slog.New(handler)
logger.Info("hello"))
logHook, _ := sentrylogrus.NewLogHook(
[]logrus.Level{logrus.InfoLevel, logrus.WarnLevel},
sentry.ClientOptions{
Dsn: "your-dsn",
EnableLogs: true, // Required for log entries
})
defer logHook.Flush(5 * time.Secod)
logrus.RegisterExitHandler(func() {
logHook.Flush(5 * time.Second)
})
logger := logrus.New()
logger.AddHook(logHook)
logger.Infof("hello")
- Add support for flushing events with context using
FlushWithContext(). (#935)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
if !sentry.FlushWithContext(ctx) {
// Handle timeout or cancellation
}
- Add support for custom fingerprints in slog integration. (#1039)
Deprecations
- Slog structured logging support replaces
Leveloption withEventLevelandLogLeveloptions, for specifying fine-grained levels for capturing events and logs.
handler := sentryslog.Option{
EventLevel: []slog.Level{slog.LevelWarn, slog.LevelError, sentryslog.LevelFatal},
LogLevel: []slog.Level{slog.LevelDebug, slog.LevelInfo, slog.LevelWarn, slog.LevelError, sentryslog.LevelFatal},
}.NewSentryHandler(ctx)
- Logrus structured logging support replaces
NewandNewFromClientfunctions toNewEventHook,NewEventHookFromClient, to match the newly addedNewLogHookfunctions, and specify the hook type being created each time.
logHook, err := sentrylogrus.NewLogHook(
[]logrus.Level{logrus.InfoLevel},
sentry.ClientOptions{})
eventHook, err := sentrylogrus.NewEventHook([]logrus.Level{
logrus.ErrorLevel,
logrus.FatalLevel,
logrus.PanicLevel,
}, sentry.ClientOptions{})
Bug Fixes
- Fix issue where
ContinueTrace()would panic whensentry-traceheader does not exist. (#1026) - Fix incorrect log level signature in structured logging. (#1034)
- Remove
sentry.originattribute from Sentry logger to prevent confusion in spans. (#1038) - Don't gate user information behind
SendDefaultPIIflag for logs. (#1032)
Misc
- Add more sensitive HTTP headers to the default list of headers that are scrubbed by default. (#1008)
v0.33.0: 0.33.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.33.0.
Breaking Changes
- Rename the internal
LoggertoDebugLogger. This feature was only used when you setDebug: Truein yoursentry.Init()call. If you haven't used the Logger directly, no changes are necessary. (#1012)
Features
-
Add support for Structured Logging. (#1010)
logger := sentry.NewLogger(ctx) logger.Info(ctx, "Hello, Logs!")You can learn more about Sentry Logs on our docs and the examples.
-
Add new attributes APIs, which are currently only exposed on logs. (#1007)
Bug Fixes
- Do not push a new scope on
StartSpan. (#1013) - Fix an issue where the propagated smapling decision wasn't used. (#995)
- [Otel] Prefer
httpRouteoverhttpTargetfor span descriptions. (#1002)
Misc
- Update
github.com/stretchr/testifyto v1.8.4. (#988)
v0.32.0: 0.32.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.32.0.
Breaking Changes
- Bump the minimum Go version to 1.22. The supported versions are 1.22, 1.23 and 1.24. (#967)
- Setting any values on
span.Extrahas no effect anymore. UseSetData(name string, value interface{})instead. (#864)
Features
- Add a
MockTransportandMockScope. (#972)
Bug Fixes
- Fix writing
*http.Requestin the Logrus JSONFormatter. (#955)
Misc
- Transaction
dataattributes are now seralized as trace context data attributes, allowing you to query these attributes in the Trace Explorer.
v0.31.1: 0.31.1
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)
v0.31.0: 0.31.0
Breaking Changes
-
Remove support for metrics. Read more about the end of the Metrics beta here. (#914)
-
Remove support for profiling. (#915)
-
Remove
Segmentfield from theUserstruct. 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-goto latest version, you'll need togo getthe integration you want to use. For example, if you want to use theechointegration, you'll need to rungo get github.com/getsentry/sentry-go/echo(#919).
Features
-
Add the ability to override
hubincontextfor integrations that use custom context. (#931) -
Add
HubProviderHook forsentrylogrus, 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
HTTPTranportto 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
- Bump gin-gonic/gin to v1.9.1. (#946)
v0.30.0: 0.30.0
The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.30.0.
Features
- Add
sentryzerologintegration (#857) - Add
sentryslogintegration (#865) - Always set Mechanism Type to generic (#896)
Bug Fixes
- Prevent panic in
fasthttpandfiberintegration 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.
v0.29.1: 0.29.1
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
sentrynegroniintegration to use the latest (v3.1.1) version of Negroni (#885)
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- [ ] If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
ℹ Artifact update notice
File name: go.mod
In order to perform the update(s) described in the table above, Renovate ran the go get command, which resulted in the following additional change(s):
- The
godirective was updated for compatibility reasons
Details:
| Package | Change |
|---|---|
go |
1.13 -> 1.23.0 |