Commit Graph

8 Commits

Author SHA1 Message Date
Classic298
caf3362be8 fix: add missing group_id filter to analytics token usage query (#22167)
The get_token_usage_by_user query lacked group_id filtering, while the
companion get_message_count_by_user query already supported it. When an
admin filtered analytics by user group, message counts were correctly
scoped to the group but token usage totals included data from all users.

Add the group_id parameter and subquery filter to get_token_usage_by_user,
matching the pattern used by get_message_count_by_user and other analytics
queries, and pass group_id through from the analytics endpoint.
2026-03-08 17:11:12 -05:00
Classic298
9a269ec8ab fix: use path converter for model ID routes in analytics to support slashes (#22382) 2026-03-07 20:02:59 -05:00
Timothy Jaeryang Baek
f376d4f378 chore: format 2026-02-11 16:24:11 -06:00
Timothy Jaeryang Baek
e62649f940 enh: analytics 2026-02-05 00:00:49 -06:00
Timothy Jaeryang Baek
68a1e87b66 enh: analytics model modal 2026-02-04 23:42:46 -06:00
Tim Baek
b2c2f1bd49 refac 2026-02-01 10:24:04 +04:00
Tim Baek
679e56c494 feat: token analytics 2026-02-01 10:19:59 +04:00
Tim Baek
599cd2eeeb feat: analytics backend API with chat_message table
- Add chat_message table for message-level analytics with usage JSON field
- Add migration to backfill from existing chats
- Add /analytics endpoints: summary, models, users, daily
- Support hourly/daily granularity for time-series data
- Fill missing days/hours in date range
2026-02-01 07:04:13 +04:00