Skip to content

feat(tools): Cloudflare Browser Rendering crawl cost usage tracking - #69

Open
bpb02 wants to merge 1 commit into
mainfrom
feat/cloudflare-crawl-usage-tracking
Open

feat(tools): Cloudflare Browser Rendering crawl cost usage tracking#69
bpb02 wants to merge 1 commit into
mainfrom
feat/cloudflare-crawl-usage-tracking

Conversation

@bpb02

@bpb02 bpb02 commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add cost usage tracking to Cloudflare Browser Rendering crawl tools (cloudflare_crawl_start, cloudflare_crawl_get, cloudflare_crawl_cancel).
  • On terminal crawl_get responses, emit cloudflare/browser-rendering/crawl:browser_seconds, :pages_crawled, and :requests for backend Costs(name, unit, rate) lookup.
  • Disable default {tool}:requests usage on all three tools; dedupe billing per job_id within a single agent run (poll + full fetch).
  • Add unit tests with mocked httpx plus an env-gated live integration test.

Usage keys (Costs.name = cloudflare/browser-rendering/crawl)

Unit Example quantity Suggested rate
browser_seconds rounded browserSecondsUsed 0.000025 USD ($0.09/browser-hour)
pages_crawled finished or total 0 (analytics only)
requests 1 per completed job 0 (bill via browser_seconds)

Test plan

  • uv run python -m pytest python/tests/tools/test_cloudflare.py -m 'not integration' -v (7 passed)
  • Live crawl against Cloudflare API — terminal poll emits usage keys
  • Apply Costs INSERT rows in platform DB

Made with Cursor

Record browser_seconds, pages_crawled, and requests on terminal crawl_get
responses for Costs table lookup, with per-job dedupe within a run.

Co-authored-by: Cursor <cursoragent@cursor.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.

1 participant