-
Notifications
You must be signed in to change notification settings - Fork 60
opencost plugin: fix correct endpoint for OpenCost API #481
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: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Kristina Devochko <krdev1715@met.no>
|
@yolossn would it be possible to get a review of this PR and roll out a new version of the opencost plugin soon? Currently it doesn't work unfortunately 😞 |
|
Hi @guidemetothemoon, thanks for bringing this up. The change does make sense. Can you share a screenshot/video with the developer tools (network tab) open of the working fix? I don't have the setup ready to test now, Ill test it in a while |
|
@yolossn would screenshot from the latests AppImage be enough? I see that local development guide for setting up Headlamp in development mode to test in-cluster is not compatible with my setup out of the box, because I use podman and kind instead of docker and minikube, so it will take some time to make it working... |
|
@yolossn using version 2.4.1 and it's stuck in loading with 404 errors on this endpoint which kind of correlates with deprecation mentioned in opencost/opencost#2845 (comment)
|
|
@yolossn even with opencost version 2.5.3 it doesn't work for me, still hangs in both desktop and in-cluster version of headlamp and I see 404 requests in network logs. If I update the endpoint as done in this PR and run headlamp desktop it works as expected. How does your opencost plugin configuration look like when you're testing? |
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.
Pull request overview
This PR fixes the OpenCost plugin to use the correct API endpoint following OpenCost's API changes. After the transition from Kubecost to OpenCost, the /model/allocation/compute path segments were removed from the allocation endpoint.
Changes:
- Updated the allocation API endpoint from
/proxy/model/allocation/computeto/proxy/allocation
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Tested with default install of opencost and prometheus in my local cluster and get the same behaviour where Cost is loaded only when I change the endpoint to @yolossn since this is confirmed by the official response from the OpenCost project (and you can confirm yourself by updating the endpoint in your local plugin) it would be great to merge this fix, because we can't use this functionality in headlamp right now and it's very much requested by our users. Unless you have specific objections to this fix.
DESKTOP APP TESTING: Original endpoint:
Working endpoint:
IN-CLUSTER TESTING: Original endpoint:
Working endpoint:
|












After kubecost became opencost there have been changes to its API, where model and compute were removed from the allocation endpoint. Ref. opencost/opencost#2845 (comment)
Currently opencost plugin doesn't populate any data with the original endpoint.
This PR fixes the endpoint according to the opencost API and testing confirms that the plugin works as expected after this change and data is populated correctly.