Whether you're just starting out developing your app or you have a full-blown production app, you want to make sure you understand your costs and how to avoid surprise bills.
If you haven't already, check out the Firebase pricing plans to understand how billing works for Firebase.
This page guides you through important aspects of understanding and monitoring your usage and spend levels, including:
Test your code
Testing your code before deploying to production is a great idea for many reasons, like catching errors that might cost you significant amounts of money. As you're building the infrastructure for your app, we highly recommend first testing locally using the Firebase Local Emulator Suite.
The Local Emulator Suite allows you to run instances of Cloud Functions, Cloud Firestore, the Realtime Database and more all locally on your desktop machine. This not only makes it easier for you to quickly iterate on new functionality — particularly Cloud Functions — but it also ensures that you don't incur any Firebase costs that might result from testing against services in production.
As you're testing, check for these common causes of exceeding expected usage and spend:
Forgetting to add a limit to a database query with millions of results
Combinations of Cloud Functions that cause excessive fan-out workloads or even infinite loops
View your usage and spending levels
You need to know what normal usage patterns look like for your app and make sure you're staying within thresholds important to you.
View individual product usage
You can view individual product usage in the "Usage" tab for many products in the Firebase console.
You can view specific date ranges in these dashboards.
Product-level dashboards are available for Authentication and all the infrastructure products: Realtime Database, Cloud Firestore, Cloud Storage, Cloud Functions, and Hosting.
View overall project usage
You can view your project's overall usage in the
You can view your monthly usage and how your usage levels are measuring up to the allocated no-cost usage quota.
Click into any product to review a daily summary of usage and how it measures up to the allocated no-cost usage quota.
Remember that each product has different usage quotas and thus different timelines, for example:
Cloud Firestore and Cloud Storage usage are calculated daily.
Cloud Functions usage is calculated monthly.
Set up budgets
You can control your costs and avoid surprises on your bill by creating budgets for Google Cloud Billing. Budgets are general monetary amounts that you plan on spending each month, and they can either be alerts-only budgets or spend cap budgets.
Alerts-only budgets
If spending reaches set thresholds for your budget, then Cloud Billing sends email notifications.
Note the following:
Budget alerts do not pause services. They're intended to help you monitor your costs and to alert you so that you can take action, if needed. For example, you might consider using budget notifications to disable billing on the project.
When you upgrade to the Blaze pricing plan in the Firebase console, you're automatically prompted to set up an alerts-only budget. You can also manually set up alerts-only budgets in the Google Cloud console.
Spend cap budgets
If spending reaches set thresholds for your budget for a specific service, then Cloud Billing sends email notifications.
If spending reaches 100% of your budget for that service, then Cloud Billing pauses that service for the rest of the month.
Note the following:
Spend caps budgets are only available for the following Firebase services: Firebase AI Logic, Firebase App Hosting, Cloud Functions for Firebase, and Firebase Extensions.
You can manually set up spend cap budgets in the Firebase console or Google Cloud console.
Next steps
Set up budget alerts and (if applicable) spend caps.
Consider using budget notifications to programmatically disable Cloud Billing on a project.
Visit Set up advanced billing alerts and logic to learn how to do the following:
Use Cloud Monitoring to create more sophisticated alerts for billing and usage, including custom alerts that send notifications to other mediums, like Slack.
Create additional billing logic based on Google Cloud Pub/Sub.