Update sentry reporting (#3305)

This hopefully reduces the garbage we currently produce.
(Using [GlitchTip](https://glitchtip.com/) on my personal instance, this
seems to look better)
This commit is contained in:
Till 2024-01-24 19:24:04 +01:00 committed by GitHub
parent 8e4dc6b4ae
commit d58daf9665
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 16 additions and 7 deletions

View file

@ -647,6 +647,8 @@ func MakeFedAPI(
// add the user to Sentry, if enabled
hub := sentry.GetHubFromContext(req.Context())
if hub != nil {
// clone the hub, so we don't send garbage events with e.g. mismatching rooms/event_ids
hub = hub.Clone()
hub.Scope().SetTag("origin", string(fedReq.Origin()))
hub.Scope().SetTag("uri", fedReq.RequestURI())
}