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
Add request body size metric for the write path. #111917
Conversation
Please note that we're already in Test Freeze for the Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Thu Aug 18 13:40:40 UTC 2022. |
54bb697
to
7ce56e0
Compare
/retest |
7ce56e0
to
bafc0c4
Compare
There's the size of the request (the size of the body in the request), and the size of the object as we store in etcd. Differences comes from format used for the request can be different from the storage format (YAML vs Protobuf), but also yaml has some alias and anchor mechanisms that can significantly reduce the size of the object compared to its expanded form. Is this what we want to measure? |
One thing we want to measure is the size of the incoming request. And that's because we have a 3 meg limit and we want to know if our incoming payloads are getting close to that threshold. The second thing we want is basically size of the outgoing object, which I actually do realize this does not accurately represent. The reason for approximating the size of the outgoing object is basically to have something as a proxy for outgoing object size so that we can do math and determine the estimate size of a full list request so that we can know if the total volume of objects that we have is potentially close to the timeout of a full list. But actually, I think I need to make the buckets more granular for this. |
3cf9680
to
1b10df1
Compare
/triage accepted |
Change-Id: Ic2bcf39caef791b2e13448a97d2c3203ed1d94b9
1b10df1
to
084b535
Compare
dfa83e8
to
67f5af4
Compare
Change-Id: Ica5d9b5457d4f844c4500b2c05b2f0631c27454c
67f5af4
to
43c95cb
Compare
/lgtm |
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.
/assign @lavalamp
/retest |
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.
calculating the approximate size of a LIST request by the following function
You can't do that with this metric, request body and stored object sizes have very little to do with each other (imagine encoding differences & create / update sequences)
requestBody: strings.NewReader("aaaa"), | ||
limit: 5, | ||
expectedMetrics: ` | ||
# HELP apiserver_request_body_sizes [ALPHA] Apiserver request body sizes broken out by size. |
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.
this looks like a change detector, is there a better way to verify what happened?
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.
I mean, I want to test the exact metric output, so a change detector is actually kinda what I want..
I think this metric doesn't get anywhere near close enough for this purpose. The way to do this is to update a metric on GET / LIST requests (divide by number of items returned) |
Discussed offline, I'll create another metric for this. |
/approve
I think I'm not worried about people thinking this would work because it won't be obvious at all how to account for create/update/patch request differences. The other use seems valid though. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apelisse, lavalamp, logicalhan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
We can use this metric in conjunction with apiserver_storage_objects to
determine if a LIST is likely to be near a timeout threshold.
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
This metric exposes the request body sizes that have been accepted as being under the apiserver max request body threshold. This metric has two primary usecases:
avg(apiserver_request_body_size{resource="a"}) * apiserver_storage_objects{resource="a"}
Which issue(s) this PR fixes:
Fixes #111893
Does this PR introduce a user-facing change?