diff --git a/internal/watcher/health/monitor/monitor.go b/internal/watcher/health/monitor/monitor.go index 32a2fd0..b27dd43 100644 --- a/internal/watcher/health/monitor/monitor.go +++ b/internal/watcher/health/monitor/monitor.go @@ -164,6 +164,12 @@ func (mon *monitor) String() string { // MarshalJSON implements json.Marshaler of HealthMonitor. func (mon *monitor) MarshalJSON() ([]byte, error) { res := mon.lastResult + if res == nil { + res = &health.HealthCheckResult{ + Healthy: true, + } + } + return (&JSONRepresentation{ Name: mon.service, Config: mon.config,