diff --git a/CHANGELOG.md b/CHANGELOG.md index d48dc5f6d86c..a9de67538c30 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,11 @@ Main (unreleased) - Disable node_exporter on Windows systems (@jkroepke) +### Bugfixes + +- Fix issue where component evaluation time was overridden by a "default + health" message. (@rfratto) + ### Other changes - Add metrics when clustering mode is enabled. (@rfratto) diff --git a/component/component_health.go b/component/component_health.go index 8779e84e0cbe..66a3647886bd 100644 --- a/component/component_health.go +++ b/component/component_health.go @@ -45,16 +45,6 @@ var ( _ encoding.TextUnmarshaler = (*HealthType)(nil) ) -// Default Health returns a copy of the default health for use when a component -// does not implement HealthComponent. -func DefaultHealth() Health { - return Health{ - Health: HealthTypeHealthy, - Message: "default health", - UpdateTime: time.Now(), - } -} - const ( // HealthTypeUnknown is the initial health of components, set when they're // first created. diff --git a/pkg/flow/internal/controller/component.go b/pkg/flow/internal/controller/component.go index 6df57ffc5e35..218a07b20445 100644 --- a/pkg/flow/internal/controller/component.go +++ b/pkg/flow/internal/controller/component.go @@ -445,17 +445,14 @@ func (cn *ComponentNode) CurrentHealth() component.Health { var ( runHealth = cn.runHealth evalHealth = cn.evalHealth - - componentHealth component.Health ) if hc, ok := cn.managed.(component.HealthComponent); ok { - componentHealth = hc.CurrentHealth() - } else { - componentHealth = component.DefaultHealth() + componentHealth := hc.CurrentHealth() + return component.LeastHealthy(runHealth, evalHealth, componentHealth) } - return component.LeastHealthy(runHealth, evalHealth, componentHealth) + return component.LeastHealthy(runHealth, evalHealth) } // DebugInfo returns debugging information from the managed component (if any).