MARK MIRCHANDANI: A surprise party might be fun,
but a surprise on your Cloud bill usually isn't.
Thankfully, you can set up budgets and alerts
using Google Cloud Platform to closely monitor your costs
and work with the appropriate teams
so that they can take action if needed.
On this episode of "Beyond Your Bill,"
we'll talk about setting up budgets and how you can get
notified when anything unexpected happens.
[MUSIC PLAYING]
Setting a budget in GCP lets you trigger notifications
when your costs hit or are forecasted
to hit a specified amount.
You can set up a budget for an entire billing account
or multiple budgets for different combinations
of projects and GCP products so that you
can stay informed on the areas that matter most to you.
Let's look at the interface where
you can manage your budgets, set one
up, and see what the options for notifications are.
We'll start by going to the Budgets and Alerts
page in the GCP console.
You can use the top left navigation
to choose Billing, and then select the billing account.
From there, click on Budgets and Alerts.
Only billing account administrators
are able to create or update budgets and alerts
for a billing account.
So make sure that you have the right permissions
for the billing account that you've chosen.
On this page, you can see all the budgets that
belong to this billing account.
Each budget is made up of a few different important pieces.
First, you have the name for the budget, which
is helpful for you to identify what
this budget is meant to track.
Next is the budget type, which can either be specified amount,
where you set a fixed amount to compare your monthly spend to,
or last month's spend, where you target an amount based
on the previous month's spend.
We'll come back to those when you
walk through creating a budget.
After that is the scope of the budget,
which is the combinations of projects and GCP products
that this budget covers.
So you may have a budget for your entire billing account,
one for just your production projects,
one for just your BigQuery spend,
or multiple for any combination of those.
On the other side of the budget are
the actual threshold details for when the budget should send out
an alert notification.
Each budget can have multiple thresholds.
And you can see an overview of the current status
for each budget on this page.
The thresholds are percentages of either the amount
you entered or the last month's spend based
on the type of budget.
You can always come to this page to see your budgets
and click on one to edit it.
Let's go through and create a budget to see all the options.
We'll do that by clicking on the Create Budget button
at the top.
The first screen is the scope of the budget,
which includes the name, projects, and products covered.
If you don't choose any projects or products from the dropdown,
this budget will default to the entire billing account.
Since you can set up as many budgets as you want,
feel free to create multiple budgets
to track different groups of projects and products
based on your needs.
On the next screen, you can choose the type of budget.
If you choose specified amount, you
can choose a target amount for this budget to track towards.
Depending on the cost you're trying
to measure, that could be $100, $100,000, or more.
If you choose last month's spend,
the amount will be pre-populated with the spend from last month
based on the scope you just chose and it'll
be updated every month.
For example, if you choose a product
that you haven't used before or you've only
used within the free tier, this amount may show up as zero.
This can be a good way to get notified
as soon as you start to spend money on something
you didn't expect to spend it on.
In addition, you can choose to include credits
in the budget amount.
Including credits means you'll take the total cost
and then subtract any credits that were applied
for that billing period.
Credits may include things like usage discounts, promotions,
or grants.
On the next step, you'll be able to set up the actions.
You can set up different thresholds
based on the amount from the previous step for when
the alert notification should trigger.
For example, you may want to set an alert for when
you've reached 50%, 90%, and 100% of your budget
for the month.
You can also add additional thresholds in case
you want more granularity.
And each threshold can be based on actual or forecasted costs.
Actual cost thresholds trigger when
the spend from the scope that you selected
exceeds the specified amount.
For example, you could set up a 50% actual cost threshold
on $1,000 budget, and you'll get an alert notification
when your cost exceeds $500.
Forecasted cost thresholds trigger
when your cost is predicted to exceed the threshold
amount by the end of the month.
If you add a forecasted cost threshold
for 110% on a $1,000 budget, it will
trigger an alert notification as soon
as your cost for the total billing period
is expected to hit $1,100 even if you're
only a few days into the month.
There is also an option for connecting budget to pub/sub
for programmatic budget notifications, which
let you add more advanced cost controls to your budgets.
We'll talk about that in a later video.
But you can check out the link below for more information.
Keep in mind that different GCP products or services update
costs at different times.
Most services will update costs within an hour.
But some may take up to a full day to update.
Each service has costs based on different metrics as well.
We recommend setting multiple budgets
so that you can get alerted as soon as possible
and take action.
Once you save your budget, you're good to go.
Though, it may take a few hours before it kicks in.
Here's an email alert that was sent out
for a budget that was set to 100% for a $10 budget.
We can see the display name of the budget, the budget amount
and period, the triggering threshold, and the associated
billing account ID in the email.
It's also easy to get straight to the Budget page in case
you want to see more information or edit your budgets.
Only billing account administrators
and billing account users will get an email notification
for a budget alert.
Remember, budget alerts are sent out based on the rules you set,
but they don't actually stop any usage from happening.
If you want to go beyond emails and automate actions,
you should consider using quotas or programmatic budget
notifications.
Both of which we'll talk about in future videos.
Check out the links below for more information about setting
up budgets and alerts.
[MUSIC PLAYING]