Skip to content
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

Cloudflare Plugin #52

Open
ameijer opened this issue Oct 17, 2024 · 2 comments
Open

Cloudflare Plugin #52

ameijer opened this issue Oct 17, 2024 · 2 comments

Comments

@ameijer
Copy link
Contributor

ameijer commented Oct 17, 2024

Is your feature request related to a problem? Please describe.
Implement a Cloudflare plugin for the OpenCost Plugins ecosystem

Additional context
Cloudflare billing data available here: https://developers.cloudflare.com/api/operations/user-billing-history-(-deprecated)-billing-history-details

Example PR with an implemented Plugin: #41
This issue qualifies for our bounty program, read more details here: https://www.opencost.io/blog/introducing-opencost-plugins

@robinbihun
Copy link

robinbihun commented Nov 15, 2024

I'm not sure this cloudflare Billing Data API is returning data as expected, I was not able to get it to return anything for me. Additionally, as it appears to be deprecated would it be better to use the List Account Subscriptions API? I do not see any obvious APIs for other add-ons available (https://developers.cloudflare.com/support/account-management-billing/billing-add-on-service/).

Lastly, The way the Cloudflare billing appears to work is Monthly based on usage the previous month; they do not break cost/usage down into a "Hour" or "Day" resolution, but they do include the service dates the subscription charge is for. Would the desire here be to get the monthly cost and spread the cost out evenly for the requested resolution or only return the cost on the day it is billed? With the latter I imagine that the opencost dashboard would show "$0" for cloudflare whereas the former would at least show a "baseline [daily|hourly] cost."

@ameijer
Copy link
Contributor Author

ameijer commented Nov 18, 2024

Hi Robin,

First off, I assigned you this ticket so nobody duplicates this work. hope that is OK.

Second of all, I think your idea for interpolated costs is fine - if you can adjust the description or something to append - INTERPOLATED or something to that effect so that people know what you are doing.

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

No branches or pull requests

2 participants