mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-08-02 14:12:47 +00:00
Improve Sentry reporting
This commit is contained in:
parent
ecee5f10f4
commit
cd22ba22b0
3 changed files with 17 additions and 0 deletions
|
@ -20,6 +20,7 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/getsentry/sentry-go"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/util"
|
||||
"github.com/opentracing/opentracing-go"
|
||||
|
@ -284,6 +285,15 @@ func (u *latestEventsUpdater) latestState() error {
|
|||
"old_latest": u.oldLatest.EventIDs(),
|
||||
"new_latest": u.latest.EventIDs(),
|
||||
}).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())
|
||||
sentry.CaptureMessage("State reset detected")
|
||||
})
|
||||
}
|
||||
|
||||
// Also work out the state before the event removes and the event
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue