Allow scoped access tokens to read organization usage (read-only) #54399
Unanswered
acattelan-gav
asked this question in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
We are on the Pro Plan with the spend cap on, and several projects share the organization quotas. We want to get an alert before a quota is reached (egress, MAU, log ingestion), because the spend cap only notifies the billing email once the quota has already been exceeded.
The organization usage shown on the Usage page comes from an internal endpoint (
/platform/organizations/{slug}/usage). It is not available in the public Management API, and no scoped personal access token permission covers it. Today the only way to automate this check is a classic token, which has full access to every project in the organization. That is too much for a monitoring job.Request:
What we tried as a workaround: summing
node_network_transmit_bytes_total(interfaceens5) from each project's Metrics API, which a scoped token can read. We compared it day by day against the Usage page for 10 days across 5 projects. It does not work as a proxy for billed egress: the sum was 114% higher than billed egress, and the gap varied from +32% to +1120% per project, so no correction factor fits. It also does not cover MAU or logs.All reactions