query: Make group a/b minPenalty to be configurable #8061
+22
−4
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.
Change-Id: If991daccf49d03cc116a7e0413e023ea4cb45643
Changes
What happened
When the THANOS QURY connects multiple Prometheus instances, if the pull time of the two Prometheus instances is too close, it may cause the data to fall, such as:
At this time, when you query the metrics through the Thanos Query's dedup param interface, the data of the Counter data type will decline (this situation is not reset to the counter), just like the following:
This situation is incorrect for the counter type, which will cause the Rate func calculate abnormality, just like:
Solution
I noticed that the logic that affects this part is in the iter.go file.
Therefore, can we force the THANOS Query by modifying the penalty time of group A/B to solve this problem that we can skip two particularly similar points (for example, the collection time of these two points is only 1s or less).
After testing, after modifying this penalty time from 0 to 999, the fall of data will not appear. Just like following:
Verification
After modifying, THANOS Query can run normally, but I am not sure if there will be other scenarios that will affect it, or there are other considerations for this penalty value, must to be set to 0?
Can anyone help it or other suggestions?