aboutsummaryrefslogtreecommitdiff
path: root/internal/httputil/httpapi.go
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2022-09-05 17:35:43 +0100
committerNeil Alexander <neilalexander@users.noreply.github.com>2022-09-05 17:35:43 +0100
commit5992b4c7ed2779e12c8b9da7bc96b2b6398cf04c (patch)
tree2664b2e3327a98d2d16f83541459c271439f7e85 /internal/httputil/httpapi.go
parentcd22ba22b01fe5197bf8e4630c8414dd413225af (diff)
Set Sentry user where known
Diffstat (limited to 'internal/httputil/httpapi.go')
-rw-r--r--internal/httputil/httpapi.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/internal/httputil/httpapi.go b/internal/httputil/httpapi.go
index ab8319bb..5612d78c 100644
--- a/internal/httputil/httpapi.go
+++ b/internal/httputil/httpapi.go
@@ -60,7 +60,10 @@ func MakeAuthAPI(
// add the user to Sentry, if enabled
hub := sentry.GetHubFromContext(req.Context())
if hub != nil {
- hub.Scope().SetTag("username", device.UserID)
+ hub.Scope().SetUser(sentry.User{
+ Username: device.UserID,
+ IPAddress: req.RemoteAddr,
+ })
hub.Scope().SetTag("user_id", device.UserID)
hub.Scope().SetTag("device_id", device.ID)
}