Once your Crashlytics data and (optionally) Firebase sessions data is exported to Cloud Logging, you can filter your logs and create log-based metrics. Both of these are helpful for viewing, using, and analyzing specific data.
If you haven't already, make sure to check out What can you do with your data? for a comprehensive list and examples for working with data stored in Cloud Logging.
Filter your logs with queries
Filtering your logs is helpful for viewing specific data as well as to reduce costs for data storage and further analysis. You filter logs using LQL (Logging Query Language).
To learn about how to filter your logs with queries, visit Sample queries using Logs Explorer and Building log queries. The table below describes the fields available for those queries.
Example filters
For Crashlytics, here are some example initial filters for a query:
Find all fatal crashes for a specific app version:
logName="projects/PROJECT_ID/logs/firebasecrashlytics.googleapis.com%2Fevents" jsonPayload.issue.errorType="FATAL" jsonPayload.version.displayVersion="3.2.0"
Identify crashes occurring on a specific device model (for example, Pixel 6a):
logName="projects/PROJECT_ID/logs/firebasecrashlytics.googleapis.com%2Fevents" jsonPayload.device.model="Pixel 6a"
Search for a specific
OutOfMemoryErroracross all fatal events:logName="projects/PROJECT_ID/logs/firebasecrashlytics.googleapis.com%2Fevents" jsonPayload.issue.errorType="FATAL" jsonPayload.issue.subtitle="java.lang.OutOfMemoryError"
Find events for a specific Crashlytics issue ID:
logName="projects/PROJECT_ID/logs/firebasecrashlytics.googleapis.com%2Fevents" jsonPayload.issue.id="ISSUE_ID"
Log schema
Each log entry has a predefined structure and queryable fields (see LogEntry).
Learn about the log schema for exported data, including Crashlytics data, Firebase sessions data, and device logs.
Create log-based metrics
You can view and build log-based metrics, and then use these metrics in Cloud Monitoring to create charts, custom dashboards, and custom alerts.
Use predefined system metrics that are automatically recorded, such as the number of logging events that occurred within a specific time period.
Create user-defined metrics for your project. You can count the number of log entries that match a given query or keep track of particular values with the matching log entries. You can filter using regular expressions. Make sure to review pricing for user-defined metrics.
Use Cloud Monitoring to record the number of log entries containing particular messages or extract latency information reported in log entries. You can then use these metrics in charts and custom alerts.
Example log-based metrics
Here are two example user-defined log-based metrics that you could create from your exported Crashlytics and Firebase sessions data:
Using Crashlytics data:
Create a metric namedfirebase/crashlytics_eventswith a label oferrorType, and define it as:logName="projects/PROJECT_ID/logs/firebasecrashlytics.googleapis.com%2Fevents"Using Firebase sessions data:
Create a metric namedfirebase/session_eventswith a label ofeventType, and define it as:logName="projects/PROJECT_ID/logs/firebasecrashlytics.googleapis.com%2Fsession_events"
What's next?
Build custom dashboards for longer-term and advanced monitoring.
Set up and send custom alerts to custom notification channels.