-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Preserve reset hint during histogram deduplication
Penalty based deduplication can over-skip samples because when switching between replicas, because it uses a penalty of 2 times the estimated scrape interval. This works okay for float counters because the reset is detected based on the value of the counter. With native histograms, detecting a reset is much more expensive which is why there is a hint stored in the first sample of a chunk, which indicates whether the chunk has been created because of a reset. It can easily happen that the dedup iterator switches replicas, and skips the first sample of a chunk because of the added penalty. In this case we will not read the hint and will assume that no histogram reset happened. This commit fixes the issue by explicitly calling DetectReset if a replica stream has been switched. The result is then stored and set in the histogram returned by AtHistogram and AtFloatHistogram. Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
- Loading branch information
1 parent
fce0fe2
commit f8cf2fe
Showing
3 changed files
with
216 additions
and
116 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.