Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.25.9

require (
github.com/airbrake/gobrake/v5 v5.6.2
github.com/getsentry/sentry-go v0.43.0
github.com/getsentry/sentry-go v0.46.2
github.com/go-coldbrew/log v0.3.0
github.com/go-coldbrew/options v0.3.0
github.com/google/uuid v1.6.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,8 @@ github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/fzipp/gocyclo v0.6.0 h1:lsblElZG7d3ALtGMx9fmxeTKZaLLpU8mET09yN4BBLo=
github.com/fzipp/gocyclo v0.6.0/go.mod h1:rXPyn8fnlpa0R2csP/31uerbiVBugk5whMdlyaLkLoA=
github.com/getsentry/sentry-go v0.43.0 h1:XbXLpFicpo8HmBDaInk7dum18G9KSLcjZiyUKS+hLW4=
github.com/getsentry/sentry-go v0.43.0/go.mod h1:XDotiNZbgf5U8bPDUAfvcFmOnMQQceESxyKaObSssW0=
github.com/getsentry/sentry-go v0.46.2 h1:1jhYwrKGa3sIpo/y5iDNXS5wDoT7I1KNzMHrnK6ojns=
github.com/getsentry/sentry-go v0.46.2/go.mod h1:evVbw2qotNUdYG8KxXbAdjOQWWvWIwKxpjdZZIvcIPw=
github.com/ghostiam/protogetter v0.3.20 h1:oW7OPFit2FxZOpmMRPP9FffU4uUpfeE/rEdE1f+MzD0=
github.com/ghostiam/protogetter v0.3.20/go.mod h1:FjIu5Yfs6FT391m+Fjp3fbAYJ6rkL/J6ySpZBfnODuI=
github.com/gliderlabs/ssh v0.3.8 h1:a4YXD1V7xMF9g5nTkdfnja3Sxy1PVDCj1Zg4Wb8vY6c=
Expand Down
8 changes: 7 additions & 1 deletion notifier/notifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,6 @@ func buildSentryEvent(err errors.ErrorExt, level string, extra map[string]interf
Level: sentryLevel,
Environment: sentryEnvironment,
Release: sentryRelease,
Extra: extra,
Exception: []sentry.Exception{
{
Type: reflect.TypeOf(err).String(),
Expand All @@ -305,6 +304,13 @@ func buildSentryEvent(err errors.ErrorExt, level string, extra map[string]interf
},
}

if len(extra) > 0 {
if event.Contexts == nil {
event.Contexts = make(map[string]sentry.Context)
}
event.Contexts["extra"] = extra
}

if len(tagData) > 0 {
tags := make(map[string]string)
for _, t := range tagData {
Expand Down
8 changes: 4 additions & 4 deletions notifier/notifier_sentry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ func TestSentryExtra(t *testing.T) {
if event == nil {
t.Fatal("expected captured event")
}
if len(event.Extra) == 0 {
t.Error("expected non-empty Extra on event")
if len(event.Contexts["extra"]) == 0 {
t.Error("expected non-empty extra context on event")
}
}

Expand Down Expand Up @@ -226,8 +226,8 @@ func TestBuildSentryEvent(t *testing.T) {
if event.Message != "build event test" {
t.Errorf("expected message 'build event test', got %v", event.Message)
}
if event.Extra["key"] != "value" {
t.Errorf("expected extra key=value, got %v", event.Extra["key"])
if event.Contexts["extra"]["key"] != "value" {
t.Errorf("expected extra key=value, got %v", event.Contexts["extra"]["key"])
}
if event.Tags["tag1"] != "val1" {
t.Errorf("expected tag tag1=val1, got %v", event.Tags["tag1"])
Expand Down
Loading