Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve reset hint during histogram deduplication #7092

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Feb 23, 2024

  1. 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>
    fpetkovski committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    02ebe6a View commit details
    Browse the repository at this point in the history
  2. Add unit test

    Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
    fpetkovski committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    7491896 View commit details
    Browse the repository at this point in the history
  3. Fix lint

    Signed-off-by: Filip Petkovski <filip.petkovsky@gmail.com>
    fpetkovski committed Feb 23, 2024
    Configuration menu
    Copy the full SHA
    440b8e6 View commit details
    Browse the repository at this point in the history