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
Define metrics for API Priority and Fairness borrowing #113483
Define metrics for API Priority and Fairness borrowing #113483
Conversation
57d5643
to
df10d43
Compare
e41c460
to
ea8333e
Compare
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.
Couple smaller comments.
Also
/assign @dgrisonnet
For SIG-instrumentation approval for newly added metrics.
&compbasemetrics.GaugeOpts{ | ||
Namespace: namespace, | ||
Subsystem: subsystem, | ||
Name: "demand_envelope_seats", |
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.
Do I remember that envelope is simply adv+stddev?
If so - do we really need this metric?
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.
The KEP has this metric listed too, so I followed that.
Yes, currently it is redundant with avg + stddev.
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.
In this case, I suggest removing this metric (we should update the KEP in the background too)
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.
Done in the latest revision.
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 LGTM (modulo one comment), but we should get a look from SIG-instrumentation folks.
I will ping them on slack.
&compbasemetrics.GaugeOpts{ | ||
Namespace: namespace, | ||
Subsystem: subsystem, | ||
Name: "demand_envelope_seats", |
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.
In this case, I suggest removing this metric (we should update the KEP in the background too)
&compbasemetrics.GaugeOpts{ | ||
Namespace: namespace, | ||
Subsystem: subsystem, | ||
Name: "demand_seats_hight_watermark", |
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.
Name: "demand_seats_hight_watermark", | |
Name: "demand_seats_high_watermark", |
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.
Isn't this just a typo of hight
that should be high
?
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.
Good catch, thanks!
// apiserverCurrentConcurrencyLimits.WithLabelValues(priorityLevel).Set(currentCL) | ||
} | ||
|
||
func SetFairFrac(fairFrac float64) { |
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 doesn't seem to be called anywhere, are you also planning to wait for the API to be available to use it?
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.
Exactly. You see it get used in #113485 .
apiserverFairFracs = compbasemetrics.NewGauge( | ||
&compbasemetrics.GaugeOpts{ | ||
Namespace: namespace, | ||
Subsystem: subsystem, | ||
Name: "seat_fair_frac", | ||
Help: "Fair fraction of server's concurrency to allocate to each priority level that can use it", | ||
StabilityLevel: compbasemetrics.ALPHA, | ||
}) |
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 am not sure I understand this metric, shouldn't it be defined per priority level?
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.
The interesting thing about this value is that it is the same for every priority level. It is the share that each gets, except those that are clipped by bounds.
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.
Makes sense, I wasn't sure that was the case so I wanted to make sure
ea8333e
to
ba5ec78
Compare
/triage accepted |
/cc @logicalhan |
/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.
unit test failure looks legit.
@logicalhan : did you mean the integration test failure? I do not see how this change could cause that failure. This change only adds some instrumentation, should not cause any behavior change apart from adding some metrics and logging. |
/retest |
I actually meant https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/113483/pull-kubernetes-unit/1588224012842962944 but it seems to have been fixed since. |
/lgtm Thanks! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MikeSpreitzer, wojtek-t 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 |
Actually, regarding #113483 (comment) , that is a flake. See #113206 about it. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR defines the metrics introduced for borrowing between priority levels in API Priority and Fairness. The KEP changes that introduce these are kubernetes/enhancements#3391 and kubernetes/enhancements#3479 .
This PR also removes one metric that is poorly named (it speaks of "requests" but those have been different from "seats" for a while now) and meant two things that were equal before the borrowing feature but are now different:
apiserver_flowcontrol_request_concurrency_limit
can no longer be both the configured nominal concurrency limit and the dynamically derived current concurrency limit.This PR also connects them to as much of the implementation as currently is merged. The rest waits on the API changes in #112830 .
Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
@kubernetes/sig-api-machinery-misc
/cc @tkashem
/cc @deads2k
/cc @wojtek-t
@lavalamp
@cyang49