Implement token reporting in console#3743
Conversation
Will be needed when we ultimately need to bill-back token usage in plural cloud
Soffi AI SummaryThis PR adds token usage reporting to the console's statistics module, motivated by the need to eventually support billing-back token usage in Plural Cloud. The change refactors the Commits
Updated: 2026-06-20 00:06 UTC |
Greptile SummaryThis PR wires token usage reporting into the console's periodic ping to the Plural platform, laying the groundwork for future billing of LLM token consumption in Plural Cloud.
Confidence Score: 4/5Safe to merge — the change is small and well-scoped, touching only how statistics are gathered and reported. The functional change is straightforward: deduplicate a meter fetch and add a tokens field. The only gap worth noting is that pinger.ex's to_gql/1 is not updated to document tokens as an explicit usage attribute — the field passes through correctly today because no renaming is needed, but nothing in the code signals that it is intentionally forwarded to the Plural API. lib/console/plural/pinger.ex — to_gql/1 should be updated to reflect that tokens is now a forwarded usage attribute.
|
| Filename | Overview |
|---|---|
| lib/console/deployments/statistics.ex | Adds token reporting to the statistics info map; also corrects cluster count from Cluster to Cluster.physical(), and deduplicates the Console.Prom.Meter.collect() call so both meters are read in one atomic fetch/reset cycle. |
Reviews (1): Last reviewed commit: "Implement token reporting in console" | Re-trigger Greptile
|
plural deploy this |
Will be needed when we ultimately need to bill-back token usage in plural cloud
Test Plan
Test environment: https://console.your-env.onplural.sh/
Checklist
Plural Flow: console