-
Notifications
You must be signed in to change notification settings - Fork 41.1k
Add kubelet_pod_emptydir_volume_{used,size_limit}_bytes Prometheus metrics #121489
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: master
Are you sure you want to change the base?
Conversation
Hi @machine424. 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. |
podNamespace := podStat.PodRef.Namespace | ||
|
||
if podStat.VolumeStats == nil { | ||
// TODO: another 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.
WDYT
/hold |
/cc @dgrisonnet |
4f03012
to
d1f6dce
Compare
/ok-to-test |
d1f6dce
to
7ca63be
Compare
I fixed the For future readers: printing the conflicting collectors at
|
7ca63be
to
455b460
Compare
/retest-required |
9b588b2
to
98b6a0b
Compare
/release-note-edit
|
@kannon92: /release-note-edit must be used with a release note block. In 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. |
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 we want to distinguish between memory backed volumes and normal empty dir?
/release-note-edit
|
btw @machine424 you can always edit your PR in the release-notes section to add a release-note. I had to remember the syntax to do it from the PR.. |
…e limit per pod/volume. Only volumes on the default medium are considered. Signed-off-by: machine424 <ayoubmrini424@gmail.com>
98b6a0b
to
7ecc832
Compare
This could be useful, but I’ll stick to volumes on the default medium for now (I just added that explicitly to the metrics help text). Given that some maintainers already reviewed/started reviewing, I prefer not to make any major changes. Also, given how we’re very cautious about cardinality, I wouldn’t add another dimension now (especially since |
Any chance to get this into the next kubernetes release? I think those metrics would be very useful. |
I'll bring it up to the next sig meeting |
Coming back from the SIG meeting, the group was in favor of this change and approved the cardinality of these metrics. I am assigning @dashpole for instrumentation and kubelet review. /unassign @logicalhan |
|
||
for _, volumeStat := range podStat.VolumeStats { | ||
if volume, found := podVolumes[volumeStat.Name]; found { | ||
// Only consider volumes on the default medium. |
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 see there is already a VolumeStatsUsedBytesKey for Persistent volumes. Are emptyDir volumes the only volumes that are missing metrics today?
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.
Not the only ones, many other volumes don't have metrics.
I suggested in #121489 (comment) to deprecate the the existing per source metrics and have a generic metrics (with the sources as metrics), that will be easier to discover and to extend, but that effort will need more effort from maintainers.
for _, volumeStat := range podStat.VolumeStats { | ||
if volume, found := podVolumes[volumeStat.Name]; found { | ||
// Only consider volumes on the default medium. | ||
if volume.EmptyDir != nil && volume.EmptyDir.Medium == v1.StorageMediumDefault { |
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.
Would it be useful for medium to be a label? It seems like memory-backed empty-dir usage and limits would also be useful, since we already have computed that.
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.
Unfortunately, this has taken much longer than expected (not blaming anyone, I get that it’s not a top priority for everyone). It's been harder for me to dive back into the PR, and it feels like we’re spinning our wheels. I won't be able to keep working on this without compromising on the quality. If you think this isn't ready yet, I’m okay with closing the PR and letting someone else take over, maybe deprecate the existing metrics and switch to a generic metric, as mentioned in #121489 (comment) is the way to go. |
/assign @dgrisonnet |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
/remove-lifecycle stale |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Exposes
emptyDir
usage and size limit per Pod as Prometheus metricsWhich issue(s) this PR fixes:
Fixes #69507
Special notes for your reviewer:
capacityBytes
as well (I don't think it's really informative)? What about cases whenemptyDir.sizeLimit
is set? DONE => for the capacity, maybe in a follow-up PR if it turns out relevant.Could unit test more cases.pkg/kubelet/kubelet.go
, not sure if it's sufficient, any doc about that is welcome.Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: