We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8604593 commit 1be95f0Copy full SHA for 1be95f0
logger.go
@@ -14,6 +14,8 @@ import (
14
const (
15
requestIDHeader = "X-Request-Id"
16
sentryEventIDHeader = "X-Sentry-Id"
17
+
18
+ sentryExtraRequestID = "request_id"
19
)
20
21
// NewCore will create handy Core with sensible defaults:
@@ -75,6 +77,10 @@ func RequestLogger(logger *zap.Logger) func(next http.Handler) http.Handler {
75
77
core := localCore
76
78
if client != nil {
79
hub := sentry.NewHub(client, sentry.NewScope())
80
+ hub.ConfigureScope(func(scope *sentry.Scope) {
81
+ scope.SetTag(sentryExtraRequestID, requestID)
82
+ })
83
84
core = NewSentryCoreWrapper(localCore, hub, options...)
85
86
loggerOptions = append(loggerOptions, zap.Hooks(func(entry zapcore.Entry) error {
0 commit comments