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

Cherry-pick sharding-up improvements from prometheus 2.33.0 #29

Closed

Conversation

iainlane
Copy link
Member

This branch cherry-picks http://github.com/prometheus/prometheus/pull/9274 which are some improvements to the behaviour when sharding up with a backlog.

Part of: grafana/agent#1376

Drive the input parameters to `calculateDesiredShards()` very precisely,
to illustrate some questionable behaviour marked with `?!`.

See prometheus#9178,
prometheus#9207,

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
(cherry picked from commit d588b14)
Change the coefficient from 1% to 5%, so instead of targetting to clear
the backlog in 100s we target 20s.

Update unit test to reflect the new behaviour.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
(cherry picked from commit 6d01ce8)
Previously we would reject an increase from 2 to 2.5 as being
within 30%; by rounding up first we see this as an increase from 2 to 3.

Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
(cherry picked from commit 954c0e8)

metrics := newQueueManagerMetrics(nil, "", "")
samplesIn := newEWMARate(ewmaWeight, shardUpdateDuration)
m := NewQueueManager(metrics, nil, nil, nil, dir, samplesIn, cfg, mcfg, nil, nil, c, defaultFlushDeadline, newPool(), newHighestTimestampMetric(), nil, false)

Choose a reason for hiding this comment

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

Looks like this has to be intern.New(nil) until prometheus#10231 merges.

@iainlane
Copy link
Member Author

Quick update, @rfratto indicated that the current focus is to be able to vendor prometheus mainline again, the version which already contains this fix. So I'll pause working on this PR for a bit, & hopefully it can be closed as obsolete.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@iainlane iainlane closed this Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants