Skip to content

Epic: Token Usage Analytics v1 on Cloudflare Workers #1

Description

@newbish

Outcome

Ship an internal operator-facing analytics app that shows daily token usage, cost, latency, model mix, tool mix, and anomaly issues on Cloudflare Workers using D1-backed rollups.

Why this matters

Teams need daily visibility into AI usage without digging through logs, provider exports, or one-off spreadsheets.

Scope

  • TanStack Start app deployed on Cloudflare Workers
  • D1/Drizzle-backed rollup model
  • Dense dashboard for overview, models, and tools
  • Ingestion path for source usage data
  • Query path optimized for daily aggregates
  • Issue/anomaly surfacing for cost and reliability signals

Execution order

  1. Foundation and deployment wiring
  2. Ingestion contract
  3. Daily rollup materialization
  4. Live dashboard queries
  5. Drilldowns and persistent filters
  6. Issue detection and guardrails
  7. Auth and workspace scoping, if needed
  8. Hardening and polish

Definition of done

  • Dashboard runs on Workers
  • D1 schema and migrations are in repo
  • Live data replaces mock overview data
  • Team can trust day-level numbers for cost and usage decisions

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Must land before meaningful team usageanalyticsMetrics, rollups, and usage logicarchitect-review-requiredNeeds architecture review before mergecloudflareWorkers, Wrangler, or platform wiringepicLarge body of work spanning multiple execution issues

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions