feat: report unbalanced topology sharding in Reconciled condition#8670
Open
Sanchit2662 wants to merge 2 commits into
Open
feat: report unbalanced topology sharding in Reconciled condition#8670Sanchit2662 wants to merge 2 commits into
Sanchit2662 wants to merge 2 commits into
Conversation
Signed-off-by: Sanchit2662 <sanchit2662@gmail.com>
Signed-off-by: Sanchit2662 <sanchit2662@gmail.com>
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.
Description
When topology sharding is enabled, the operator already blocks the severe case where
shardsis smaller than the number of zones (a zone would never get scraped). But the other edge case from the proposal, whereshardsisn't a multiple of the number of zones, was going through silently. In that case shard indices wrap around and some targets end up scraped by more than one shard, so you get duplicated samples with no hint that anything is off.As discussed in the issue, this reports the situation on the
Reconciledcondition instead of failing the reconciliation. The status staysTruewith anUnbalancedTopologyShardingreason and a message explaining it, so it doesn't block rollouts for people who set this up on purpose.Wired for both Prometheus and PrometheusAgent, behind the existing
PrometheusTopologyShardingfeature gate.closes #8664
Type of change
FEATURE(non-breaking change which adds functionality)Verification
Added a unit test (
TestUnbalancedTopologyShardingMessage) covering address mode, exact multiples,shards == zones, non-multiples, nil shards and empty values. Happy to add an e2e asserting the condition on a live object if you'd prefer.Changelog entry