You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
report: v1.12.0 fails to compile against sentry-go v0.46.0 (event.Extra removed) #158
cockroachdb/errors v1.12.0 (and current master, commit 64801262) fails to typecheck when built against getsentry/sentry-go >= v0.46.0.
The root cause is a single line in report/report.go:369:
event.Extra[extraKey] =extraValue
sentry-go v0.46.0 (CHANGELOG, PR #1274) removed the Extra field from sentry.Event as a breaking change. cockroachdb/errors does not declare an upper bound on the sentry-go version, so any transitive upgrade propagates the compile error to every downstream consumer.
// main.gopackage main
import"github.com/cockroachdb/errors"funcmain() {
_=errors.New("x")
}
$ go build ./...
.../cockroachdb/errors@v1.12.0/report/report.go:369:9:
event.Extra undefined (type *sentry.Event has no field or method Extra)
Blast radius
Because report_api.go in the root errors package imports the report sub-package, the typecheck failure blocks the entire module — not just the Sentry-reporting code path. Any project that imports github.com/cockroachdb/errors (directly or transitively) cannot build once sentry-go reaches v0.46.0.
Suggested fix
In report/report.goReportError, replace the event.Extra write with the post-v0.46 equivalent. Options:
Use Contexts (the replacement for per-event unstructured data):
Or, since BuildSentryReport already returns extraDetails as a separate map, drop the in-place merge inside ReportError and let callers attach extras via scope.SetContext (which is how sentry-go intends extras to be propagated in v0.46+).
Either approach should be scoped to report/report.go only — no other file in the module touches Event.Extra.
Activity
huzhao37 commentedon Apr 22, 2026
report: migrate Event.Extra to Event.Contexts (sentry-go v0.46+ compat)
dhartunian commentedon Apr 27, 2026
@denniszag v1.13.0 was just released with your change. Let me know if you run into any problems. Thanks!