Set up advanced alerting to custom notification channels Stay organized with collections Save and categorize content based on your preferences.
Firebase offers two options for configuring alerts and sending them to customnotification channels.
(Recommended)Set up and send custom alerts to custom notification channels
You can useCloud Monitoring to sendfully customized alerts to customnotification channels based onCrashlytics data and (optionally)Firebase sessions data that you've exported toCloud Logging.
Send defaultCrashlytics alerts to custom notification channels
You can useCloud Functions to send thedefaultCrashlytics alertsto custom notification channels.
(Recommended) Set up and send custom alerts to custom notification channels
Firebase offers defaultCrashlytics alerts (see thealerting overview page).However, these default alerts and their notification channels may not besufficient for your needs.
In these cases, you can useCloud Monitoring to sendcustom alerts to custom notification channels based onCrashlytics data(and optionally Firebase sessions data) that you've exported toCloud Logging.
To useCloud Monitoring for custom alerts, you set up analerting policy,which describes the circumstances under which you want to be alerted and how youwant to be notified.
For example, if your crash-free rate goes below a specific threshold,Cloud Monitoring can send a customized alert message to a specific emailaddress or post it to a third-party service, like Discord, Slack, or Jira.You can also fully customize the information sent in the alert, like includinghelpful deep-links into theFirebase console or company-specifictroubleshooting information.
In theGoogle Cloud documentation, learn more aboutCloud Monitoring and alerts,includingpricing.
Prerequisites
Make sure your Firebase project is on thepay-as-you-go Blaze pricing plan.
Set up export toCloud Logging ofCrashlytics data and (optionally) Firebase sessions data.
Set up an alerting policy
The following are high-level instructions; for detailed instructions, see theGoogle Cloud documentation (for example:Create metric-threshold alerting policies orUse PromQL to create alerting policies).
As part of running queries, you can set up either a log-based alert or aSQL-based alert:
Set up a log-based alert:
Run a query inLogs Explorer.
Click theAdd alert button that appears.
Follow the on-screen instructions to add a log-based alert.
Set up a SQL-based alert:
Run a query inLogs Analytics.
Click theAdd alert button that appears.
Follow the on-screen instructions to add a SQL-based alert.
Alternatively, you can set up alerts for yourlog-based metricsby using thepolicy configuration tool in theGoogle Cloud console, where you can choose one of the following options:
Builder:The console UI provides a guided workflow to build the alerting policy.
PromQL:You provide a PromQL query for your alerting policy
Example PromQL query
For example, say that you've created two log-based metrics for yourexportedCrashlytics and Firebase sessions data:
One metric named
firebase/crashlytics_eventswith a label oferrorType,and it's defined as:logName="projects/PROJECT_ID/logs/firebasecrashlytics.googleapis.com%2Fevents"Another metric named
firebase/session_eventswith a label ofeventType,and it's defined as:logName="projects/PROJECT_ID/logs/firebasecrashlytics.googleapis.com%2Fsession_events"
Here's an example PromQL query using these log-based metrics to alert whenyour crash-free drops below 70%:
1-(sumby(project_id)(rate({__name__="logging.googleapis.com/user/firebase/crashlytics_events",errorType="FATAL"}[5m]))/sumby(project_id)(rate({__name__="logging.googleapis.com/user/firebase/session_events",eventType="SESSION_START"}[5m])))<0.7
Send defaultCrashlytics alerts to custom notification channels
Firebase offers defaultCrashlytics alerts (see thelist on the alerting options overview page).However, the information in these default alerts and their notification channelsmay not be sufficient for your needs.
In these cases, you can useCloud Functions for Firebase to send thesedefaultCrashlytics alerts to custom notification channels.For example, you can write a function that captures an alert event for velocityalerts and posts the alert information to a third-party service, like Discord,Slack, or Jira.
With this advanced alerting mechanism, you can also customize the informationsent to the third-party service. For example, in addition to the defaultinformation provided by Firebase, you can also include helpful deep-links intotheFirebase console or company-specific troubleshooting information.
Note: To use advanced alerting capabilities, your Firebase project needs to usetheBlaze pricing plan.To set up advanced alerting capabilities usingCloud Functions for Firebase, follow these steps:
Set up Cloud Functions for Firebase,which includes the following tasks:
- Set up a development environment for Node.js or Python.
- Install and sign into theFirebase CLI.
- InitializeCloud Functions for Firebase using theFirebase CLI.
Write and deploy a function thatcaptures an alert event fromCrashlytics and handles the eventpayload (for example, posts the alert information in a message on Discord).
To learn about all theCrashlytics alert events that you can capture, go tothe reference documentation forCrashlytics alerts.
Learn more abouthandlingCrashlytics alerts usingCloud Functions for Firebase
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-18 UTC.