-
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
feat(persistentvolume): claimRef info to labels #1244
feat(persistentvolume): claimRef info to labels #1244
Conversation
Welcome @Duologic! |
I'm a bit unsure what to do best if there is no |
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.
Thanks for your PR, couple of comments and you need to also generate the docs, hence the failing tets.
internal/store/persistentvolume.go
Outdated
Metrics: []*metric.Metric{ | ||
{ | ||
LabelKeys: []string{ | ||
"apiversion", |
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.
Can you explain the usecase for the apiserver value?
internal/store/persistentvolume.go
Outdated
{ | ||
LabelKeys: []string{ | ||
"apiversion", | ||
"kind", |
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.
Can this be anything else but PVC?
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 didn't want to make an assumption here, the same reason I kept the apiversion around. I have no hard arguments to keep it around.
Can claimref change over the lifetime of a PV? If not then this would be a better fit for the general info metric I would say. |
Considering a PV can exist without a PVC, a PV could be unclaimed and thus without a claimref, the claimref is added/updated by a process that binds a PV to a PVC. I do think that once the PV has a claimref, it is very unlikely that the name/namespace will change, but technically it could as it is part of the 'binding' process. I'm up for adding it to the info metric, but I don't know what impact that change might have, feel free to tell me where to put it as I lack the confidence to make a decision. 😊 Upon reading a bit in random github issues to see how relevant the apiversion/kind is, they seem unlikely to contain anything else than v1/PVC, I think we can drop those labels because of that. |
Yep my thinking exactly. 👍 |
Taking all this information into consideration, I would say: let's drop the kind/apiversion, and have this be a separate metric and not part of the info metric since there is a chance this may change over the lifetime of the PV. |
That should do it, shall I squash it or do we do that on merge? |
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.
Small nit on naming, then should be good to go.
Let's squash the changes I'd say. |
Adds a new metrics to provide claimRef information to Prometheus. In tracking down lingering PVs, it would be of interest to know where the PV came from. With the claimRef information, it is easier to track down the resource owners and inform that they have unclaimed PVs lingering around. Main motivation is that PVs cost money at cloud providers, if PVs stick around for long, the costs might increase significantly.
eddecae
to
96b0183
Compare
Addressed comments, squashed and rebased on current master. |
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.
/lgtm
Thanks for the contribution!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Duologic, lilic 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:
Adds a new metrics to provide claimRef information to Prometheus. In
tracking down lingering PVs, it would be of interest to know where the
PV came from. With the claimRef information, it is easier to track down
the resource owners and inform that they have unclaimed PVs lingering
around.
Main motivation is that PVs cost money at cloud providers, if PVs stick
around for long, the costs might increase significantly.