Loading
build(deps): update module github.com/getsentry/sentry-go to v0.34.0
This MR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| github.com/getsentry/sentry-go | require | minor | v0.33.0 -> v0.34.0 |
MR created with the help of gitlab-org/frontend/renovate-gitlab-bot
Release Notes
getsentry/sentry-go (github.com/getsentry/sentry-go)
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)
Configuration
- If you want to rebase/retry this MR, check this box
This MR has been generated by Renovate Bot.