mirror of
https://github.com/hoernschen/dendrite.git
synced 2024-12-27 23:48:27 +00:00
Update state reset capture to Sentry
This commit is contained in:
parent
0d697f6754
commit
5014b35bd7
1 changed files with 8 additions and 5 deletions
|
@ -287,11 +287,14 @@ func (u *latestEventsUpdater) latestState() error {
|
||||||
}).Warnf("State reset detected (removing %d events)", removed)
|
}).Warnf("State reset detected (removing %d events)", removed)
|
||||||
sentry.WithScope(func(scope *sentry.Scope) {
|
sentry.WithScope(func(scope *sentry.Scope) {
|
||||||
scope.SetLevel("warning")
|
scope.SetLevel("warning")
|
||||||
scope.SetTag("event_id", u.event.EventID())
|
scope.SetContexts(map[string]interface{}{
|
||||||
scope.SetTag("old_state_nid", fmt.Sprintf("%d", u.oldStateNID))
|
"Event ID": u.event.EventID(),
|
||||||
scope.SetTag("new_state_nid", fmt.Sprintf("%d", u.newStateNID))
|
"Old state NID": fmt.Sprintf("%d", u.oldStateNID),
|
||||||
scope.SetTag("old_latest", u.oldLatest.EventIDs())
|
"New state NID": fmt.Sprintf("%d", u.newStateNID),
|
||||||
scope.SetTag("new_latest", u.latest.EventIDs())
|
"Old latest": u.oldLatest.EventIDs(),
|
||||||
|
"New latest": u.latest.EventIDs(),
|
||||||
|
"State removed": removed,
|
||||||
|
})
|
||||||
sentry.CaptureMessage("State reset detected")
|
sentry.CaptureMessage("State reset detected")
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue