-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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 swap to stats to Summary API and Prometheus endpoints (/stats/summary
and /metrics/resource
)
#118865
Add swap to stats to Summary API and Prometheus endpoints (/stats/summary
and /metrics/resource
)
#118865
Conversation
Hi @iholder101. Thanks for your PR. I'm waiting for a kubernetes 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. 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/test-infra repository. |
Should we add it to
|
Please correct me if I'm wrong, but IIUC You can see that in server.go, these metrics are populated by Am I missing something here? |
If so, this would be valid. /ok-to-test |
a00c580
to
4671e33
Compare
/triage accepted |
Signed-off-by: Itamar Holder <iholder@redhat.com>
Signed-off-by: Itamar Holder <iholder@redhat.com>
Signed-off-by: Itamar Holder <iholder@redhat.com>
Signed-off-by: Itamar Holder <iholder@redhat.com>
8a32f45
to
4cb5547
Compare
/lgtm |
LGTM label has been added. Git tree hash: fc5fc1bd2080a44cb900a0bef5a248111991e3fe
|
What type of PR is this?
/kind feature
/sig node
/area kubelet
What this PR does / why we need it:
The Summary API, which is reachable through the
stats/summary
endpoint, allows to to consume mertics and statistics gathered by Kubelet at the node, volume, pod and container level.This PR adds current swap usage to the summary API as part of the requirements to graduate swap to Beta1.
In addition, it adds "node_swap_usage_bytes",
pod_swap_usage_bytes
andcontainer_swap_usage_bytes
metrics that would be reachable from/metrics/resource
which is also used as a Prometheus endpoint.Which issue(s) this PR fixes:
Fixes #119424
Fixes #119425
Special notes for your reviewer:
AFAICT, cadvisor is being used to fetch the metric data. If it is not available through cadvisor, it's possible to fallback into gathering CRI data. Unfortunately, it doesn't seem currently possible to do so (here) since memory usage is not part of the CRI-API. In follow-up work, I think it should be added as well, as I don't see a reason to why CRIs wouldn't be able to provide this information.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
Sample output
In order to test this, I've created a pod named
test-pod
on an environment with NodeSwap feature gate on and UnlimitedSwap.The
/metrics/resource
endpoint looks as follows:The
/stats/summary
endpoint looks as follows (some parts were omitted and replaced by...
for simplicity):