Developers & Practitioners

Customizing time ranges for budgets in the console

TL;DR: You can now use the Google Cloud Console to customize the time ranges of your budgets!

Cost Trend Graph
Technically you're saving money because the month is shorter, right?

Good news everyone! If you manage your budgets through the Google Cloud Console, you can now choose custom time ranges for your budgets. Those of you dedicated readers who have been following the billing blogs may have seen the previous posts about using the Budget API as well as using the API to customize the budget period. In this short post, I'll show you how to do the same thing right in the console!

Budgets and time ranges

First things first, here's a guide on how budgets work and why you should be using them to keep an eye on your cloud costs. Up until recently, budgets were measured against costs for a month starting on the first day and ending on the last day. Of course, sometimes you want to measure spending in different ways.

With this update, you can choose what time range a budget should apply to. There are four options here:

  • Monthly: the default for budgets, starting on the first day of each month and ending on the last day of each month (January 1st through January 31st, for example)

  • Quarterly: an even split of the year into four quarters starting on January 1st, April 1st, July 1st, and October 1st

  • Yearly: the whole year, starting with January 1st

  • Custom: choose any start date and optional end date to measure spending for

Monthly, quarterly, and yearly budgets are repeated, and will measure your spending against the specific amount you provide or the dynamic amount of the last period.

For example, let's magically pretend it's April 2nd. If you set up a quarterly budget and choose a target amount of $1000, you'll be able to measure your spending from April 1st through June 31st. If you instead choose "Last quarter's spend" for the amount, you'll measure spending against the last quarter. This is a great way to measure comparable spending and make sure that you're informed as soon as possible about any surprises (or take action by setting up a programmatic budget notification).

Setting up a budget notification
Assuming this is April 2nd, that amount is automatically populated with my spending from Jan 1st - March 31st

Monthly, quarterly, and yearly budgets all work the same way, and you can always set multiple thresholds for a budget such as 50%, 75%, and 100% of the target amount. You can even use forecasted amounts to get notifications as soon as Google Cloud predicts you'll be spending that much, which is kind of like having an overly specific crystal ball!

Custom notification setup

Custom ranges allow for serious flexibility!

Custom time ranges are a bit different and work by choosing a start date and optionally choosing an end date. This is pretty straightforward, but it's important to note that custom time ranges do not repeat.

Not including an end date means your budget will track spending continuously from the start date and you can be notified when you hit certain amounts. One great example of this could be tracking spending against a fixed grant amount, so you can get notified as you're approaching the grant limit. You may even want to use a programmatic notification to shut down resources as you approach the limit!

Of course, including an end date will limit the amount of time your budget is active for, and may be good for busy periods like a holiday season increase in demand.

Plan ahead

Now that you know about time ranges, you can create all kinds of budgets to fit your needs! I definitely recommend having multiple budgets so you can more closely track specific spending, such as tracking BigQuery costs in your data projects or Compute Engine costs in your development and testing environments.

The right budgets to set up will depend on your organization, but taking the time to think about what budget information is valuable can be the difference between getting a timely notification or simply creating a filter to delete budget emails because they're filling up your inbox. Check out the other blog posts if you'd like to learn more, or use this interactive tutorial to help you set one up. Happy budgeting!