DEV Community

Cover image for Flame Shield: Protect Your Firebase Budget
dllewellyn
dllewellyn

Posted on

Flame Shield: Protect Your Firebase Budget

Stop Unexpected Firebase Costs with Flame Shield

Unexpected Firebase costs can quickly spiral out of control, especially as usage scales. Without strict budget monitoring, developers often find themselves dealing with costly surprises. This is where Flame Shield comes in.

Flame Shield is a powerful yet simple tool designed to help you manage your Firebase project costs. By setting strict monthly spending limits and enabling an automatic "kill switch," you can prevent unexpected expenses and maintain better budget control.

This guide will walk you through setting up Flame Shield and setting up a "kill switch" - a hard limit after which your billing account will be disconnected

Because Flames Shield relies on google billing updates, there is a delay between your billing trigger and the notification - so it can go over the billing limit

Get Started with Flame Shield

Head over to https://flamesshield.com to begin protecting your Firebase budget today!

How to Set Up Flame Shield

1. Add Your Firebase Project

  1. Open the Flame Shield app. Flames Shield app
  2. Tap the + button to add a new project.
  3. Enter your Firebase Project ID and tap Add Project.

2. Re-authenticate Your Account

  1. After adding your project, tap Re-authenticate. This ensures that Flame Shield can set up necessary alerts and protect your account.

Under the hood, we are requesting enhanced permissions temporarily to set up the necessary access to your billing acount

  1. Review the requested permissions and tap Re-authenticate again.

  2. Select your Google account and grant access.

Re-authenticate your account

3. Set Up Billing Protection

  1. On the Dashboard, tap Setup Billing Protection.

  2. Enter your desired monthly spending limit and tap Activate Billing Protection. You can update this limit at any time.

Image description

Testing the Kill Switch

It's generally a good idea to test your kill-switch at a less stressful time than 3am to make sure you know what the process is to re-connect.

Flame Shield’s kill switch automatically suspends your project if your spending exceeds the set limit. Here’s how to test this feature:

  1. On the Dashboard, locate the Service Running status and tap Test Kill Switch.

  2. Confirm that you want to proceed with the test.

  3. Flame Shield will simulate an overspending scenario, and you’ll receive a Billing Account Detached alert.

  4. To re-enable your project, tap Re-enable Billing Account.

Image description

Monitoring Current Spend

Flame Shield allows you to track your project’s expenses directly from the Dashboard. The Current Spend section provides an overview of your usage and ensures you stay within budget.

Image description

How It Works

  • Spend data updates roughly every hour as alerts come in from Google.
  • Notifications are sent out when:
    • Billing limits are reached.
    • The kill switch is no longer active (which can happen for various reasons). It’s essential to ensure that it remains active at all times.
    • The kill switch is triggered, indicating that spending has exceeded the set limit.

By keeping an eye on the Current Spend section and ensuring the kill switch remains active, you can proactively manage your Firebase budget and avoid unexpected charges.

Some other good things

  • You can configure alerting - this will notify you when your billing limit is at 50%, when your 'ping' is down and when your kill-switch has kicked in
  • Ping - there are all sorts of ways that the service could stop working. You might delete the pub/sub, change the billing account or otherwise change the permissions. We ping the system every hour to make sure that kill-switch is always operational when you need it (and let you know what action to take is not)

Image description

By following these steps, you can efficiently manage your Firebase project costs and prevent unexpected overspending. Get started today at https://flamesshield.com!

Top comments (0)