-
Notifications
You must be signed in to change notification settings - Fork 521
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
Use node label instead of extracting from instance #2423
base: develop
Are you sure you want to change the base?
Conversation
Fixes opencost#2281 Given a common cAdvisor setup the instance label will refer to the node by IP rather than hostname This uses the `node` label instead, relying on a setup where that label is properly configured rather than an unexpected `instance`. Signed-off-by: Alex Nordlund <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This is a companion to opencost/opencost#2423 Without the changes from opencost/2423 this _will_ break queries in kubecost. Signed-off-by: Alex Nordlund <[email protected]>
@deepy thanks for the PR! This seems relatively straightforward, but I'd like the @opencost/opencost-maintainers (especially @AjayTripathy) to weigh in on this. |
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Absolutely, same here :-) And there's some places where I've left it as instance as everything resolved correctly when inspected under a debugger Thanks for having a look at this! |
@opencost/opencost-maintainers anyone want to weigh in? This came from #2281 |
This needs to be thoroughly tested across all providers. IIRC, there is a lot of nuance with this particular label. |
#2444 We're playing with making this configurable. |
One note. Currently recommended way of installing opencost is using |
@deepy I've recently also noticed an environment with cAdvisor returning an IP instead of hostname. This ended up causing issues with OpenCost computing Allocations. @deepy Do you know what versions of the Kubelet or what versions of cAdvisor show this behavior? Many of my environments still show the "Instance" label as having the hostname. Regardless, I agree with this PR's approach and think we should give users an option on how they want to query cAdvisor here. |
This pull request has been marked as stale because it has been open for 90 days with no activity. Please remove the stale label or comment or this pull request will be closed in 5 days. |
@thomasvn what do you want to do with this PR? |
I don't think kubelet or cAdvisor versioning is what factors in here, I'm willing to bet a very small sum on it being configuration. Potentially just as simple as I'll put a little effort into another investigation at some point next week, but for now I think everything is in #2281 (comment) |
Given a common cAdvisor setup the instance label will refer to the node by IP rather than hostname
This uses the
node
label instead, relying on a setup where that label is properly configured rather than an unexpectedinstance
setup.What does this PR change?
node
label instead of relying on users configuring prometheus to add the node to theinstance
hostnameHow will this PR impact users?
relabel_configs
from belowServiceMonitors
you need to make certain you havehonorLabels: true
Does this PR address any GitHub or Zendesk issues?
How was this PR tested?
Does this PR require changes to documentation?
Yes, the following
relabel_configs
needs to be added:Have you labeled this PR and its corresponding Issue as "next release" if it should be part of the next OpenCost release? If not, why not?