go-sentry-api icon indicating copy to clipboard operation
go-sentry-api copied to clipboard

Update module github.com/getsentry/sentry-go to v0.38.0

Open renovate[bot] opened this issue 1 year ago • 1 comments

This PR contains the following updates:

Package Change Age Confidence
github.com/getsentry/sentry-go v0.29.0 -> v0.38.0 age confidence

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
  • Add ClientOptions.DisableTelemetryBuffer to 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 Transport is provided, the SDK automatically disables the telemetry buffer and uses the legacy transport for compatibility.

v0.37.0: 0.37.0

Compare Source

The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.37.0.

Breaking Changes
  • Behavioral change for the TraceIgnoreStatusCodes option. The option now defaults to ignoring 404 status codes (#​1122).
Features
  • Add sentry.origin attribute to structured logs to identify log origin for slog and logrus integrations (auto.log.slog, auto.log.logrus) (#​1121).
Bug Fixes
  • Fix slog event 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/net to v0.38.0 (#​1126).

v0.36.2: 0.36.2

Compare Source

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

Compare Source

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

Compare Source

The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.36.0.

Breaking Changes
  • Behavioral change for the MaxBreadcrumbs client 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 TraceIgnoreStatusCodes option 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 BeforeSend callback (#​1109)
    • Logs now bypass the processEvent method and are sent directly to the transport
    • This ensures logs are only filtered by BeforeSendLog, not by the error/message BeforeSend callback
Misc
  • Add support for Go 1.25 and drop support for Go 1.22 (#​1103)

v0.35.3: 0.35.3

Compare Source

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

Compare Source

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 MockTransport to test clients for improved testing (#​1071)

v0.35.1: 0.35.1

Compare Source

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 fasthttp and fiber integrations (#​1055)
Misc
  • Bump github.com/gofiber/fiber/v2 from 2.52.5 to 2.52.9 in /fiber (#​1067)

v0.35.0: 0.35.0

Compare Source

The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.35.0.

Breaking Changes

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 FailureIssueThreshold and RecoveryThreshold onto check-in payloads (#​1060)

v0.34.1: 0.34.1

Compare Source

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

Compare Source

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.Hook signature from a *Hook to 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 Level option with EventLevel and LogLevel options, 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 New and NewFromClient functions to NewEventHook, NewEventHookFromClient, to match the newly added NewLogHook functions, 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 when sentry-trace header does not exist. (#​1026)
  • Fix incorrect log level signature in structured logging. (#​1034)
  • Remove sentry.origin attribute from Sentry logger to prevent confusion in spans. (#​1038)
  • Don't gate user information behind SendDefaultPII flag 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

Compare Source

The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.33.0.

Breaking Changes
  • Rename the internal Logger to DebugLogger. This feature was only used when you set Debug: True in your sentry.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 httpRoute over httpTarget for span descriptions. (#​1002)
Misc
  • Update github.com/stretchr/testify to v1.8.4. (#​988)

v0.32.0: 0.32.0

Compare Source

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.Extra has no effect anymore. Use SetData(name string, value interface{}) instead. (#​864)
Features
  • Add a MockTransport and MockScope. (#​972)
Bug Fixes
  • Fix writing *http.Request in the Logrus JSONFormatter. (#​955)
Misc
  • Transaction data attributes are now seralized as trace context data attributes, allowing you to query these attributes in the Trace Explorer.

v0.31.1: 0.31.1

Compare Source

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

Compare Source

Breaking Changes
  • Remove support for metrics. Read more about the end of the Metrics beta here. (#​914)

  • Remove support for profiling. (#​915)

  • Remove Segment field from the User struct. 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-go to latest version, you'll need to go get the integration you want to use. For example, if you want to use the echo integration, you'll need to run go get github.com/getsentry/sentry-go/echo (#​919).

Features
  • Add the ability to override hub in context for integrations that use custom context. (#​931)

  • Add HubProvider Hook for sentrylogrus, 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 HTTPTranport to 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

v0.30.0: 0.30.0

Compare Source

The Sentry SDK team is happy to announce the immediate availability of Sentry Go SDK v0.30.0.

Features
  • Add sentryzerolog integration (#​857)
  • Add sentryslog integration (#​865)
  • Always set Mechanism Type to generic (#​896)
Bug Fixes
  • Prevent panic in fasthttp and fiber integration 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

Compare Source

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 sentrynegroni integration 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.

renovate[bot] avatar Oct 14 '24 20:10 renovate[bot]

ℹ 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 go directive was updated for compatibility reasons

Details:

Package Change
go 1.13 -> 1.23.0

renovate[bot] avatar Dec 03 '24 17:12 renovate[bot]