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

  1. Make sure your Firebase project is on thepay-as-you-go Blaze pricing plan.

  2. Set up export toCloud Logging ofCrashlytics data and (optionally) Firebase sessions data.

  3. Set up notification channels.

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:

    1. Run a query inLogs Explorer.

    2. Click theAdd alert button that appears.

    3. Follow the on-screen instructions to add a log-based alert.

  • Set up a SQL-based alert:

    1. Run a query inLogs Analytics.

    2. Click theAdd alert button that appears.

    3. 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 namedfirebase/crashlytics_eventswith a label oferrorType,and it's defined as:

      logName="projects/PROJECT_ID/logs/firebasecrashlytics.googleapis.com%2Fevents"

    • Another metric namedfirebase/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

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.