Skip to content

feat: add Cloudflare cost monitoring plugin#83

Open
demo112 wants to merge 1 commit into
opencost:mainfrom
demo112:cloudflare-plugin
Open

feat: add Cloudflare cost monitoring plugin#83
demo112 wants to merge 1 commit into
opencost:mainfrom
demo112:cloudflare-plugin

Conversation

@demo112
Copy link
Copy Markdown

@demo112 demo112 commented May 14, 2026

Implements the Cloudflare plugin for OpenCost, enabling cost monitoring for Cloudflare CDN, DNS, and security services.

Features

  • Fetches billing history from Cloudflare Billing API
  • Retrieves zone information for cost enrichment
  • Fetches subscription details for recurring costs
  • Supports both API Key (X-Auth-Email + X-Auth-Key) and Bearer Token authentication
  • Implements rate limiting for API calls (2 req/s, burst 5)
  • Implements CustomCostSource interface
  • Includes unit tests

API Endpoints Used

  • GET /user/billing/history - Billing history
  • GET /zones - Zone information
  • GET /subscriptions - Subscription details

Testing

  • Code compiles successfully
  • Unit tests pass
  • Follows Datadog plugin reference implementation pattern

Resolves #52

Bounty: This plugin qualifies for the $1,000 OpenCost bounty program.

Implements the Cloudflare plugin for OpenCost, enabling cost monitoring
for Cloudflare CDN, DNS, and security services.

Features:
- Fetches billing history from Cloudflare Billing API
- Retrieves zone information for cost enrichment
- Fetches subscription details for recurring costs
- Supports both API Key and Bearer Token authentication
- Implements rate limiting for API calls
- Implements CustomCostSource interface
- Includes unit tests

Resolves opencost#52

Bounty: This plugin qualifies for the $1,000 OpenCost bounty program.
Signed-off-by: demo112 <demo112@users.noreply.github.com>
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.

Cloudflare Plugin

1 participant