-
Notifications
You must be signed in to change notification settings - Fork 220
Add flowcontrol queue length in bytes metric #2044
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
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for gateway-api-inference-extension ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi @RyanRosario. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
/assign @LukeAVanDrie |
|
@ahg-g: GitHub didn't allow me to assign the following users: LukeAVanDrie. Note that only kubernetes-sigs members with read permissions, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
LukeAVanDrie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Ryan! I have left a few minor inline comments, but I have no blocking concerns.
This LGTM!
/assign @ahg-g
| metrics.AddFlowControlQueueBytes( | ||
| flowKey.ID, priority, | ||
| req.InferencePoolName(), | ||
| req.ModelName(), req.TargetModelName(), req.ByteSize()) | ||
| defer metrics.SubFlowControlQueueBytes( | ||
| flowKey.ID, priority, | ||
| req.InferencePoolName(), | ||
| req.ModelName(), req.TargetModelName(), req.ByteSize()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Even though req.ByteSize() is technically immutable right now, it is a defensive best practice to capture the size in a local variable before the defer.
This guarantees that the Add and Sub operations are always mathematically symmetric. If a future refactor makes changes how ByteSize() is calculated (making it mutable), we risk the Gauge drifting permanently (e.g., subtracting more than we added or vice versa).
| ) | ||
|
|
||
| // Basic Inc/Dec | ||
| AddFlowControlQueueBytes("user-a", "100", pool, model, target, 32.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: The helper function AddFlowControlQueueBytes accepts a uint64. While Go's untyped constants allow 32.0 to compile, it is cleaner to use integer literals (e.g., 32) to match the function signature.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: LukeAVanDrie, RyanRosario The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Oh, @RyanRosario, since we are adding a new public metric that operators will use, this is a user-facing change. Please update the release note section in your PR description (on this and the other metrics PRs): E.g., |
What type of PR is this?
/kind documentation
/kind feature
What this PR does / why we need it:
It adds new observability metrics for flow control.
Which issue(s) this PR fixes:
Related to #1708
Does this PR introduce a user-facing change?: