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

Jsonnet: Fix ruler-querier CPU threshold #3520

Merged
merged 2 commits into from
Nov 25, 2022
Merged

Conversation

aknuds1
Copy link
Contributor

@aknuds1 aknuds1 commented Nov 24, 2022

What this PR does

In auto-scaling Jsonnet logic, fix ruler-querier CPU threshold so it's a string encoded integer millicores value.

Which issue(s) this PR fixes or relates to

After my recent auto-scaling fix, I realized that the ruler-querier component may supply KEDA with a decimal CPU threshold, while it requires an integer.

Checklist

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

@aknuds1 aknuds1 added bug Something isn't working jsonnet labels Nov 24, 2022
@aknuds1
Copy link
Contributor Author

aknuds1 commented Nov 24, 2022

@jhesketh can you please verify whether my thinking is correct here?

@aknuds1 aknuds1 marked this pull request as ready for review November 24, 2022 14:44
@aknuds1 aknuds1 requested a review from a team as a code owner November 24, 2022 14:44
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

We already do the * 1000 in the distributor CPU, so LGTM.

CHANGELOG.md Show resolved Hide resolved
Copy link
Contributor

@jhesketh jhesketh left a comment

Choose a reason for hiding this comment

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

Yep, this is the approach I took to make partial CPU requests work with distributors.

ruler_querier_container+::
// Test a <1 non-integer CPU request, to verify that this gets converted into an integer for
// the KEDA threshold
k.util.resourcesRequests(0.2, '1Gi'),
Copy link
Contributor

Choose a reason for hiding this comment

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

eg, does this still work if we supply "1" or "0.2" etc.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks @jhesketh - I've changed the CPU request into '0.2' along with a comment that we're testing using a string, to make sure it works.

In auto-scaling Jsonnet logic, fix ruler-querier CPU threshold so it's
a string encoded integer millicores value.

Signed-off-by: Arve Knudsen <[email protected]>
Signed-off-by: Arve Knudsen <[email protected]>
@aknuds1 aknuds1 enabled auto-merge (squash) November 25, 2022 09:52
@aknuds1 aknuds1 merged commit f93cb3d into main Nov 25, 2022
@aknuds1 aknuds1 deleted the bugfix/autoscaling-milli-cpu branch November 25, 2022 10:04
masonmei pushed a commit to udmire/mimir that referenced this pull request Dec 16, 2022
* Jsonnet: Fix ruler-querier CPU threshold

In auto-scaling Jsonnet logic, fix ruler-querier CPU threshold so it's
a string encoded integer millicores value.

Signed-off-by: Arve Knudsen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jsonnet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants