Skip to content

Conversation

@guidemetothemoon
Copy link

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.

Signed-off-by: Kristina Devochko <krdev1715@met.no>
@guidemetothemoon
Copy link
Author

@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 😞
If I can help with any additional changes that are needed to get the new version of opencost plugin out the door, please let me know! 🙌

@yolossn
Copy link
Contributor

yolossn commented Jan 16, 2026

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

@guidemetothemoon
Copy link
Author

guidemetothemoon commented Jan 19, 2026

@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...
Here's a working setup in the latest Headlamp AppImage:
headlamp-opencost-appimage

@yolossn
Copy link
Contributor

yolossn commented Jan 19, 2026

Hey, I just installed opencost in my dev cluster (using helm) and checked by installing the plugin from plugin store. The plugin is working for me. Which version of opencost are you using?

image image image

@guidemetothemoon
Copy link
Author

@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)
I will test now with opencost version 2.5.3 and see if the same error is there.

headlamp-opencost-error

@guidemetothemoon
Copy link
Author

@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?
And are you able to see how the opencost API endpoint look like during your test?

Copy link

Copilot AI left a 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/compute to /proxy/allocation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@guidemetothemoon
Copy link
Author

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 /proxy/allocation.
Same behaviour for desktop and in-cluster instance of Headlamp.

@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.

opencost-local

DESKTOP APP TESTING:

Original endpoint:

headlamp-plugin-nonworking Screenshot from 2026-01-21 09-40-02

Working endpoint:

headlamp-plugin-working Screenshot from 2026-01-21 09-44-52

IN-CLUSTER TESTING:

Original endpoint:

Screenshot from 2026-01-21 12-31-45

Working endpoint:

Screenshot from 2026-01-21 12-56-48

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants