The root sentry-go
packaged uses a different context value vs sentry-go/gin
#536
Labels
sentry-go
packaged uses a different context value vs sentry-go/gin
#536
Summary
The
GetHubFromContext
in thegithub.com/getsentry/sentry-go
package isn't compatible with theGetHubFromContext
fromgithub.com/getsentry/sentry-go/gin
since they both use a different value when putting theHub
into their respective contexts.Steps To Reproduce
The value used to set the
hub
in context in gin is"sentry"
, here. The value used to setHub
in the isHubContextKey
here.This is probably the case since
gin.Context
doesn't play well with thecontext.Context
interface and has it's own way of setting values. TheHubContextKey
is exported from thegithub.com/getsentry/sentry-go
package so it should be possible to switch it over to keep everything consistent.The problem would be if you would have to set both for some time in case a user has hard-coded the key in their code instead of using the function. In that case, it could be a breaking change even if the value isn't exported out of the
sentry-go/gin
package.Expected Behavior
Expected that using the sentry package would be compatible across. This leads to the application having to know what the higher context is doing instead of letting the
context.Context
interface get passed through. I was very confused when my gin servers weren't reporting any events.SDK
sentry-go
version:v0.17.0
19
Sentry
The text was updated successfully, but these errors were encountered: