Skip to main content

Read burst budget usage with a non-admin API key

We want to automate bursting of our private workers during high-load periods. This seems to require reading burst.remainingMinutes (or usedMinutes) from workerUsage regularly so we stay within the burst budget. However, workerUsage is restricted to root Space Admin.

We could use the worker_usage notification policy input but the docs say:

"Neither route is real-time monitoring. Your usage is assessed once a day, against figures that stop at the previous midnight UTC, so a spike can be up to a day and a half old before it reaches you. When you need the current picture, check the usage chart."

A day-old figure doesn't work for scaling decisions and estimating burst minutes ourselves risks drifting from what is actually billed.

Could you add an RBAC action for reading worker usage, for example WORKER_USAGE_READ, that custom roles can include? That way a non-admin API key could query workerUsage.
Alternatively, a separate query that returns only the burst figures and is readable without admin would work for us too.

Workaround
Problem

Log in to comment and vote

No comments yet

Be the first to share your thoughts.