From a3d0ee92ceac2fca54827d2668b25ecd8486cccf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=C5=A0trauch?= Date: Fri, 26 Jan 2024 21:43:45 +0100 Subject: [PATCH] Stats errors in Sentry --- glue/stats.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/glue/stats.go b/glue/stats.go index 72a27ac..fe9b377 100644 --- a/glue/stats.go +++ b/glue/stats.go @@ -3,6 +3,7 @@ package glue import ( "log" + "github.com/getsentry/sentry-go" "github.com/jinzhu/gorm" "github.com/rosti-cz/node-api/apps" docker "github.com/rosti-cz/node-api/containers" @@ -102,6 +103,7 @@ func (s *StatsProcessor) GatherStats() error { for _, app := range appList { err := s.UpdateUsage(app.Name) if err != nil { + sentry.CaptureException(err) log.Println("STATS ERROR:", err.Error()) } } @@ -120,6 +122,7 @@ func (s *StatsProcessor) GatherStates() error { for _, app := range appList { err := s.UpdateState(app.Name) if err != nil { + sentry.CaptureException(err) log.Println("STATE ERROR:", err.Error()) } }