Add metric that monitors fallback candidate health #417
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.
Description
It is useful to be able to alert when all of the fallback candidates are unhealthy or if the healthy fallback candidates have fallen below a certain level.
This PR adds a gauge to monitor this whenever the primary candidates are all unhealthy
Note that this also adds consensus polling for fallback candidates when there are healthy primary backends available (earlier, consensus polling was only performed if no primary candidates were healthy). I acknowledge that maybe this behavior might be undesired for some people...
I'm open to creating a CLI flag to disable this behavior, but personally think that the default should be to monitor for fallback candidate health so that the metric is by default populated. Open to suggestions about this from core maintainers.
Tests
Testing in-progress, but wanted to publish the PR with the note about consensus polling for fallbacks behavior
Additional context
Add any other context about the problem you're solving.
Metadata