-
Notifications
You must be signed in to change notification settings - Fork 2k
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 Metrics About StorageClass #777
Conversation
internal/collector/storageclass.go
Outdated
@@ -0,0 +1,124 @@ | |||
/* | |||
Copyright 2017 The Kubernetes Authors All rights reserved. |
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.
Copyright 2017 The Kubernetes Authors All rights reserved. | |
Copyright 2019 The Kubernetes Authors All rights reserved. |
internal/collector/storageclass.go
Outdated
Metrics: []*metric.Metric{ | ||
{ | ||
LabelKeys: []string{"resource_version"}, | ||
LabelValues: []string{string(s.ObjectMeta.ResourceVersion)}, |
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.
As far as I know ResourceVersion
is increased for each change propagated from etcd. Thus this metric would create a new timeseries for each change of the object. How often do you expect this Kubernetes object to change?
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 ResourceVersion
can be changed only when object is updated, but we won't update it usually, so I think it will not change freequently.
You need to add |
Thank you, got it |
Can you address @mxinden's comment and also squash the commit history once this is good to merge? |
internal/collector/storageclass.go
Outdated
Metrics: []*metric.Metric{ | ||
{ | ||
LabelKeys: []string{"resource_version"}, | ||
LabelValues: []string{s.ObjectMeta.ResourceVersion}, |
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'm still a little sceptic about this. If at all, why wouldn't this be the metric's value?
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 refer to other code which use ResourceVersion
as metric, I found all of them use 1
as metric's value.
for example: kube_secret_metadata_resource_version
, kube_configmap_metadata_resource_version
and kube_ingress_metadata_resource_version
.
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.
Wow, you're totally right the other metrics do that, but it's wrong, we should have never merged those. Thanks for noticing! We should add these to the breaking release issue.
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 think we should skip this one or model it in a different way for now. Do you have a concrete alerting use case in mind?
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 remove resource_version
for the time being, and I think it's not necessary to alert about storageclass
, I only want to monitor its info.
Thanks! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: brancz, xieyanker 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 |
What this PR does / why we need it:
Add Some Metrics About StorageClass
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #775