0
0
Fork 0
mirror of https://github.com/matrix-org/dendrite synced 2024-12-14 08:43:50 +01:00

Update state reset capture to Sentry

This commit is contained in:
Neil Alexander 2022-09-07 16:23:22 +01:00
parent 0d697f6754
commit 5014b35bd7
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -287,11 +287,14 @@ func (u *latestEventsUpdater) latestState() error {
}).Warnf("State reset detected (removing %d events)", removed)
sentry.WithScope(func(scope *sentry.Scope) {
scope.SetLevel("warning")
scope.SetTag("event_id", u.event.EventID())
scope.SetTag("old_state_nid", fmt.Sprintf("%d", u.oldStateNID))
scope.SetTag("new_state_nid", fmt.Sprintf("%d", u.newStateNID))
scope.SetTag("old_latest", u.oldLatest.EventIDs())
scope.SetTag("new_latest", u.latest.EventIDs())
scope.SetContexts(map[string]interface{}{
"Event ID": u.event.EventID(),
"Old state NID": fmt.Sprintf("%d", u.oldStateNID),
"New state NID": fmt.Sprintf("%d", u.newStateNID),
"Old latest": u.oldLatest.EventIDs(),
"New latest": u.latest.EventIDs(),
"State removed": removed,
})
sentry.CaptureMessage("State reset detected")
})
}