GCP Billing Budgets and Alerts: Setup, Thresholds, and Pub/Sub Automation

A GCP billing budget is a monthly spending target that sends you alerts when your cloud costs reach thresholds you define. Budgets do not stop your services or block new deployments. They are notifications only. If costs exceed your budget, everything keeps running and charges continue to accumulate unless you take action.

This page is for anyone setting up cost monitoring in Google Cloud for the first time. You will learn what budgets do and do not do, how to create one in the Console and with the CLI, how to choose useful thresholds, where alerts are delivered, and how to optionally automate follow-up actions with Pub/Sub.

Simple explanation

Every beginner should create at least one budget before deploying any resources. It takes two minutes in the Console and costs nothing. The alternative is discovering unexpected charges on your credit card statement days or weeks later.

What billing budgets do and do not do

This is the single most misunderstood aspect of GCP cost management. Beginners often assume that setting a budget will prevent overspending. It will not.

The number one misconception

A billing budget does not stop your services when the limit is reached. Your VMs keep running, your queries keep executing, and your bill keeps growing. A budget is a notification tool, not a spending cap.

MechanismWhat it doesDoes it stop usage?
Billing budgetSends email or Pub/Sub notifications when spending crosses a thresholdNo
QuotaLimits resource consumption (API calls, CPUs, storage) at the project or region levelYes, blocks requests when reached
Pub/Sub automationTriggers a Cloud Function when a budget alert fires, which can stop VMs or disable billingOnly if you build and deploy the function yourself
Billing data is not real-time

GCP processes billing data asynchronously. Current-spend alerts can lag by several hours. A runaway BigQuery query or an accidentally oversized VM deployment can incur significant charges before any alert fires. For real-time guardrails on specific services, use quotas or per-query limits like maximumBytesBilled on BigQuery jobs.

Before you create a budget

Make sure the following are in place before you start.

You need a billing account

Budgets are created on a billing account, not on a project directly. If you are using the GCP free trial, you already have a billing account. You can find it in the Console under Billing. The billing fundamentals guide explains how billing accounts and projects relate.

You need the right permissions

Required IAM roles

To create or edit budgets you need roles/billing.admin or roles/billing.costsManager on the billing account. Billing Account Viewer can see budgets but cannot create or modify them. If you are the account owner, you already have the necessary access.

Where budgets are managed

In the Console: Billing → Budgets & Alerts. In the CLI: gcloud billing budgets commands. Budgets live at the billing account level but can be scoped down to specific projects, services, or labels.

What scopes are available

  • Entire billing account: tracks total spend across all linked projects
  • Specific projects: one or more projects within the billing account
  • Specific services: only charges from a named service, like BigQuery or Compute Engine
  • Labels: only resources tagged with a specific label, like team=alpha or env=dev

Starter budget examples

Recommended starting amounts

If you are not sure what amount to set, start with these and adjust as you learn your usage patterns:

  • Personal learning or free trial: $25 to $50 per month
  • Dev or staging environment: $100 to $300 per month
  • Small production workload: $500 to $1,000 per month

You can change the amount at any time. The estimating cloud costs guide walks through how to forecast spend before deployment.

How to set up a billing budget in the Console

The Console is the easiest way to create your first budget. The full process takes about two minutes.

  1. Open the Google Cloud Console and go to Billing → Budgets & Alerts.

  2. Click Create Budget.

  3. Name your budget. Use a descriptive name like “Dev Project Monthly Budget” or “BigQuery Production Budget”. You will see this name in alert emails.

  4. Set the scope. Under “Scope”, choose whether this budget covers the entire billing account, specific projects, specific services, or label-filtered resources. For a first budget, scoping it to your main project is a good starting point.

  5. Set the budget amount. Enter a monthly dollar amount. You can also choose “Last month’s spend” to automatically track against the previous month, but a fixed amount is clearer for beginners.

  6. Add threshold rules. Add at least two thresholds. A practical starting set is 50% current spend, 90% current spend, and 100% forecasted spend. You can add up to five thresholds per budget.

  7. Configure alert recipients. By default, alerts go to billing account admins and users. You can also add Cloud Monitoring notification channels (email, Slack, PagerDuty) or connect a Pub/Sub topic for automation.

  8. Click Finish. The budget is active immediately.

Do not forget non-production environments

Create separate budgets for dev, staging, and production. A forgotten Cloud SQL instance or oversized VM in a dev project can quietly accumulate hundreds of dollars a month without anyone noticing.

How to create a billing budget with gcloud

The CLI is useful when you manage multiple budgets, need to script budget creation across projects, or want to version-control your budget configuration in a deployment pipeline.

# Create a budget for a specific project with a $500 monthly limit
gcloud billing budgets create \
  --billing-account=BILLING_ACCOUNT_ID \
  --display-name="Production Project Budget" \
  --budget-amount=500USD \
  --projects=projects/my-project-id \
  --threshold-rule=percent=50,basis=current-spend \
  --threshold-rule=percent=90,basis=current-spend \
  --threshold-rule=percent=100,basis=forecasted-spend

This creates a $500 budget with alerts at $250 (50% current), $450 (90% current), and whenever the forecasted end-of-month total is projected to exceed $500.

# List all budgets on a billing account
gcloud billing budgets list \
  --billing-account=BILLING_ACCOUNT_ID

# View the full configuration of a specific budget
gcloud billing budgets describe BUDGET_ID \
  --billing-account=BILLING_ACCOUNT_ID

Replace BILLING_ACCOUNT_ID with your actual billing account ID. You can find it in the Console under Billing → Account Management or by running:

# List billing accounts you have access to
gcloud billing accounts list

Choosing useful threshold rules

A single threshold at 100% means you only find out after the budget is fully consumed. By then it is too late to investigate or react. Multiple thresholds give you a series of escalating signals.

A practical three-threshold setup:

  • 50% current spend: early warning. No action required, but it confirms that billing is being tracked. If this fires in the first week of the month, something may be wrong.

  • 90% current spend: investigate now. Review your cost breakdown reports and identify which resources are driving the spend.

  • 100% forecasted spend: fires mid-month if your current run rate projects to exceed the budget by month end. This is your earliest actionable signal because it fires before the budget is actually consumed.

Thresholds above 100%

You can set thresholds above 100%. A threshold at 150% fires when actual spend reaches 1.5 times the budget amount. This is useful as a secondary escalation if the 100% alert was missed or not acted on.

Current spend vs forecasted spend

GCP supports two threshold basis types and they behave differently:

Basis typeWhen it firesBest for
Current spendWhen actual incurred charges reach the threshold percentageConfirmed cost tracking: telling you what has already been spent
Forecasted spendWhen GCP projects that end-of-month spend will exceed the thresholdEarly warning: catching accelerating costs before the budget is consumed
Use both together

Current-spend alerts are backward-looking and can lag by several hours due to billing data processing delays. Forecasted-spend alerts are forward-looking and often fire earlier in the month if costs are rising faster than expected. Set current-spend thresholds for confirmed tracking and a forecasted-spend threshold for early detection.

Where budget alerts go

By default, budget alerts are sent as email notifications to users with the Billing Account Administrator or Billing Account User role. You can extend this in two ways.

Cloud Monitoring notification channels

You can route alerts to any notification channel configured in Cloud Monitoring, including email addresses, Slack channels, PagerDuty, SMS, or webhooks. Create the notification channel first in Cloud Monitoring, then reference it in the budget.

# Update a budget to send alerts to a Cloud Monitoring notification channel
gcloud billing budgets update BUDGET_ID \
  --billing-account=BILLING_ACCOUNT_ID \
  --all-updates-rule-monitoring-notification-channels=\
projects/my-project/notificationChannels/CHANNEL_ID
Slack over email

Routing alerts to a team Slack channel is more reliable than a general email list. Emails get buried. Slack messages in a dedicated cost-alerts channel are visible and create accountability.

Pub/Sub topic

Connecting a budget to a Pub/Sub topic enables programmatic automation. When a threshold is crossed, GCP publishes a JSON message to the topic containing the budget name, threshold percentage, cost amount, and budget amount. A Cloud Function or Cloud Run service subscribed to that topic can take automatic action. This is covered in detail in the next section.

Optional: automate follow-up actions with Pub/Sub

If you want something to happen automatically when a budget threshold is crossed, you need to connect the budget to a Pub/Sub topic and write a function that responds to the published message. This is entirely optional. Most beginners start with email alerts only and add automation later.

Step 1: Create a Pub/Sub topic

# Create a dedicated topic for budget notifications
gcloud pubsub topics create billing-budget-alerts

Step 2: Create a budget with Pub/Sub notification

# Create a dev budget that publishes alerts to the topic
gcloud billing budgets create \
  --billing-account=BILLING_ACCOUNT_ID \
  --display-name="Dev Budget with Auto-Stop" \
  --budget-amount=100USD \
  --projects=projects/dev-project-id \
  --threshold-rule=percent=100,basis=current-spend \
  --pubsub-topic=projects/my-project/topics/billing-budget-alerts

You can also connect an existing budget to a Pub/Sub topic in the Console by editing the budget and adding the topic under the “Actions” step.

Step 3: Deploy a Cloud Function that responds to the alert

A common automation pattern is stopping non-critical VMs when a dev budget is exceeded. The following Cloud Function checks whether spending has reached 100% of the budget and logs the event:

# Cloud Function triggered by Pub/Sub budget alert
import base64
import json
from googleapiclient import discovery

def stop_vms_on_budget_exceeded(event, context):
    """Stop non-critical VMs when budget threshold is reached."""
    pubsub_message = base64.b64decode(event['data']).decode('utf-8')
    budget_data = json.loads(pubsub_message)

    cost_amount = budget_data.get('costAmount', 0)
    budget_amount = budget_data.get('budgetAmount', 1)

    if cost_amount / budget_amount >= 1.0:
        print(f"Budget exceeded: spent {cost_amount} of {budget_amount}")
        # Add your VM stop logic here using the Compute Engine API
        # Example: stop all VMs with label env=dev
Never stop production resources automatically

Target only VMs labeled env=dev or resources in a dedicated non-critical project. Stopping production resources in response to a budget alert causes an outage, which is almost always worse than the cost it prevents.

Other automation patterns include disabling billing on a project to halt all charges, sending a detailed Slack message with a cost breakdown, or creating a Jira ticket for the team that owns the over-budget project.

Per-project, per-service, and per-team budgets

A single billing account can hold up to 5,000 budgets. Use scoped budgets to give each team, environment, or service its own spending visibility.

Per-service budget

# Budget for BigQuery charges only, across all projects
gcloud billing budgets create \
  --billing-account=BILLING_ACCOUNT_ID \
  --display-name="BigQuery Monthly Budget" \
  --budget-amount=200USD \
  --services=services/95FF-2EF5-5EA1

This is useful for high-cost services like BigQuery, Compute Engine, or Cloud SQL where a single team or query pattern can drive most of the bill. See the BigQuery cost optimisation guide for how to reduce BigQuery spending specifically.

Per-team budget using labels

# Budget for all resources labeled team=alpha
gcloud billing budgets create \
  --billing-account=BILLING_ACCOUNT_ID \
  --display-name="Team Alpha Budget" \
  --budget-amount=500USD \
  --credit-types-treatment=EXCLUDE_ALL_CREDITS \
  --label=team=alpha
Labels must be consistent

Label-based budgets only work if resources are consistently labeled. Enforce team, env, and app labels on all resources using organisation policy or Terraform. The identifying expensive resources guide explains how label data flows into billing queries.

A tiered budget structure for organisations

For organisations with multiple teams and projects, a three-tier structure provides complete coverage:

  • Billing account budget: total monthly spend ceiling for organisation-level visibility

  • Per-project budgets: each project has its own budget aligned to the team that owns it

  • Per-service budgets: high-cost services like BigQuery and Cloud SQL get dedicated budgets for service-level accountability

This structure aligns well with the FinOps principles of shared cost accountability and is a core part of any cost optimisation strategy.

Billing budgets vs quotas in GCP

Budgets and quotas are often confused because both involve limits. They serve completely different purposes.

Billing budgetQuota
What it limitsNothing. It monitors spendingResource consumption (API calls, CPUs, storage, etc.)
EnforcementSends notifications onlyBlocks requests when the limit is reached
Where configuredBilling → Budgets & AlertsIAM & Admin → Quotas
ScopeBilling account, project, service, or labelProject and region
Typical useCost awareness and financial planningPreventing runaway resource provisioning
Use both together

A budget tells you when costs are rising. A quota prevents a misconfigured deployment from spinning up 1,000 VMs before anyone notices. Neither one replaces the other.

When to use this

Set a budget before your first resource

This is the single most effective habit for avoiding surprise charges as a beginner. A forgotten VM, an unoptimised BigQuery query, or an open Cloud SQL instance can generate real charges within hours. Two minutes now saves real money later.

  • When multiple teams share a billing account. Per-project and per-label budgets give each team visibility into their own spending without needing separate billing accounts.

  • When running dev or staging environments. Non-production environments often accumulate unnoticed costs from forgotten resources. A budget with a low threshold catches this early.

  • When a specific service drives most of your bill. A dedicated BigQuery or Compute Engine budget helps you track whether Compute Engine optimisations or BigQuery cost controls are actually working.

  • When you need automated cost responses. Connecting a budget to Pub/Sub lets you build automated workflows that react to spending changes without human intervention.

Common mistakes

  1. Assuming the budget will stop services automatically. It will not. Budget alerts are notifications only. If you need automatic cost control, build the Pub/Sub automation described above or use quotas. Do not discover this after a surprise bill.

  2. Setting only a single 100% threshold. A single alert at 100% means you find out only after the budget is fully consumed. Add a 50% early-warning alert and a 90% action alert so you have time to investigate before costs get out of control.

  3. Treating budget alerts as real-time. Current-spend alerts can lag by hours. Do not rely on them to catch a runaway BigQuery query or an accidentally large VM. For real-time control, set maximumBytesBilled on BigQuery jobs or use quota policies.

  4. Sending alerts to a group inbox that nobody monitors. Budget alert emails routed to a general team address often go unread. Route alerts to a dedicated Slack channel or a named individual who is accountable for acting on them.

  5. Not creating budgets for non-production environments. Dev and staging projects frequently accumulate costs from unused resources that no one is watching. A $100 budget on a dev project catches problems that a production-only budget misses entirely.

  6. Stopping production VMs in automated budget responses. If you build Pub/Sub automation, scope it to non-critical resources only. An automated response that takes down production is almost always worse than the cost it was trying to prevent.

Frequently asked questions

Does a GCP billing budget automatically stop services when the budget is exceeded?

No. A billing budget only sends notifications by default. Your services continue running and charges keep accumulating after any threshold is crossed. To stop services automatically you need to connect the budget to a Pub/Sub topic and deploy a Cloud Function that shuts down the relevant resources when it receives the alert message. Budgets are a monitoring tool, not a spending cap.

Can I set a billing budget for just one project or one service?

Yes. When you create a budget you can filter it by project, by a specific GCP service such as BigQuery or Compute Engine, or by a resource label like team=alpha. The budget is defined at the billing account level but its scope can be as narrow as a single service inside a single project. This makes it practical to give each team or environment its own separate budget.

How quickly does GCP send a budget alert after costs cross a threshold?

Current-spend alerts can lag by several hours because GCP billing data is processed asynchronously, not in real time. Forecasted-spend alerts may fire earlier in the month because they project your current run rate forward. For near-real-time cost monitoring, export billing data to BigQuery and query it directly, or set per-query limits like maximumBytesBilled on BigQuery jobs.

What is the difference between a billing budget and a quota in GCP?

A billing budget tracks spending and sends notifications when thresholds are crossed but does not restrict usage. A quota is a hard limit on resource consumption, such as the number of API calls per minute or the number of CPUs in a region. Quotas block usage when reached. Budgets and quotas serve different purposes and are managed in different parts of the Google Cloud Console.

How many billing budgets can I create on one billing account?

You can create up to 5,000 budgets per billing account. This is more than enough for most organisations. A typical setup includes a billing-account-level budget for total spend visibility, per-project budgets for team accountability, and per-service budgets for high-cost services like BigQuery or Compute Engine.

Should I set a billing budget before deploying my first GCP resource?

Yes. Creating a budget before you deploy anything is one of the most important habits for beginners. A forgotten VM, an unoptimised BigQuery query, or an open Cloud SQL instance can generate real charges within hours. Set a budget with a low threshold first, then adjust the amount as you understand your actual usage patterns.

Last verified: 27 March 2026 Cloud services change frequently. Verify details against official documentation before making infrastructure decisions.