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

fix: counter samples being downsampled when series is new #4236

Merged
merged 3 commits into from
Oct 25, 2024

Conversation

javiermolinar
Copy link
Contributor

@javiermolinar javiermolinar commented Oct 25, 2024

What this PR does:
It fixes an issue with adaptive metrics: when a series is new the init sample ends in the same aggregation bucket as the span one, and the later one is downsampled. The fix consists of backdating the initial one to the end of the previous minute:

previously:
(t-1ms, 0)
(t, 1)

current:
(t-1m, 0)
(t, 1)

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

@javiermolinar javiermolinar changed the title fix: counter downsampling fix: counter samples being downsampled Oct 25, 2024
@javiermolinar javiermolinar changed the title fix: counter samples being downsampled fix: counter samples being downsampled when series is new Oct 25, 2024
Copy link
Member

@yvrhdn yvrhdn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just left a comment about a public constant that can be private instead.

modules/generator/registry/registry.go Outdated Show resolved Hide resolved
@javiermolinar javiermolinar enabled auto-merge (squash) October 25, 2024 15:43
@javiermolinar javiermolinar merged commit 094657a into grafana:main Oct 25, 2024
16 checks passed
knylander-grafana pushed a commit that referenced this pull request Oct 29, 2024
It fixes an issue with adaptive metrics: when a series is new the init sample ends in the same aggregation bucket as the span one, and the later one is downsampled. The fix consists of backdating the initial one to the end of the previous minute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants