From e162740654582724d86fb79cfe4f7d61258ee555 Mon Sep 17 00:00:00 2001 From: TwinProduction Date: Sat, 16 Nov 2019 15:47:28 -0500 Subject: [PATCH] Publish metrics when monitoring --- watchdog/watchdog.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/watchdog/watchdog.go b/watchdog/watchdog.go index 301ee517..7790c5d2 100644 --- a/watchdog/watchdog.go +++ b/watchdog/watchdog.go @@ -3,6 +3,7 @@ package watchdog import ( "github.com/TwinProduction/gatus/config" "github.com/TwinProduction/gatus/core" + "github.com/TwinProduction/gatus/metric" "log" "sync" "time" @@ -20,9 +21,11 @@ func GetServiceResults() *map[string][]*core.Result { func Monitor() { for _, service := range config.Get().Services { go func(service *core.Service) { + for { log.Printf("[watchdog][Monitor] Monitoring serviceName=%s", service.Name) result := service.EvaluateConditions() + metric.PublishMetricsForService(service, result) rwLock.Lock() serviceResults[service.Name] = append(serviceResults[service.Name], result) if len(serviceResults[service.Name]) > 10 {