atenet: add router health check hysteresis - #700
Open
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
Open
atenet: add router health check hysteresis#700NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
NekoPunch (orangeCatDeveloper) wants to merge 1 commit into
Conversation
A single transient probe blip flipped /statusz unhealthy for one poll interval, paging monitoring built on it. A component now reports unhealthy only after 3 consecutive probe failures; one success restores it and resets the streak. Message and failure counters still update every probe, so flaps stay visible. Fixes agent-substrate#616.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #616
Summary
updateComponentHealthsetHealthydirectly from each probe result, so a single 500ms blip to Envoy's admin port or the Kubernetes API flipped/statuszunhealthy for one polling interval and paged any monitoring built on it. A component now flips unhealthy only after 3 consecutive probe failures; a single success restores it and resets the streak. A component that has never succeeded stays unhealthy (zero value), andmessage/last_failure/failure_countstill update on every probe, so individual flaps remain observable — only thehealthyboolean gains hysteresis. The health check is observability-only, so no traffic behavior changes.Test plan
Unit: threshold enforcement, streak reset on recovery, never-healthy zero-value boundary; plus an integration-style test driving
rh.check()with a flapping Envoy probe and asserting/statuszholds healthy through 2 transient failures, flips on the 3rd, and recovers on success. Package tests pass with-race.kind cluster: deployed the router with this change and ran the e2e suites — demo, example, identity, networking, networkpolicy, and parking pass. The metrics suite fails identically on a clean-main deployment (pre-existing router-metrics-export issue), confirmed by control experiment.
Tests pass
Appropriate changes to documentation are included in the PR (none needed)