Skip to content

Aggregate dashboard daily usage by Bedrock model ID, hide zero-usage entries#111

Open
xiehust wants to merge 1 commit into
mainfrom
dev/daily-usage-bedrock-model-id
Open

Aggregate dashboard daily usage by Bedrock model ID, hide zero-usage entries#111
xiehust wants to merge 1 commit into
mainfrom
dev/daily-usage-bedrock-model-id

Conversation

@xiehust

@xiehust xiehust commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • aggregate_daily_usage now resolves recorded model IDs (Anthropic aliases) to actual Bedrock model IDs before bucketing — via the custom DynamoDB mapping cache, then the default config mapping. Aliases pointing at the same Bedrock model (e.g. claude-fable-5, claude-fable-5[1m]) now merge into a single entry in the daily usage stats.
  • build_daily_usage_response hides per-day model entries with zero tokens and zero cost (e.g. errored requests). Empty days remain zero-filled so the chart keeps a continuous time axis.
  • Both changes apply to the dashboard daily-usage panel and the per-key hover charts on the API Keys page, since they share the same aggregation code path.

Testing

  • Updated tests/unit/test_daily_usage_aggregation.py for Bedrock-ID bucket keys
  • Added tests: alias merging into one Bedrock model bucket, zero-usage entry filtering, zero-filled empty days preserved
  • Full unit suite passes (282 passed)
  • Verified live on the dev deployment in us-east-1

…ero-usage entries

- aggregate_daily_usage now resolves recorded model IDs (Anthropic aliases)
  to actual Bedrock model IDs before bucketing, so aliases of the same
  Bedrock model merge into one entry in the daily usage charts
- build_daily_usage_response hides model entries with zero tokens and zero
  cost; empty days stay zero-filled to keep a continuous chart axis
- applies to both the dashboard daily-usage panel and the per-key hover charts
- update aggregation tests; add alias-merge and zero-usage-filter coverage
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