AI-generated Key Takeaways
-
Log-based metrics are created using filters to count matching log entries within a project, like tracking trip creation events.
-
Metrics data starts accumulating only after metric creation and doesn't include pre-existing log entries.
-
You can set up alerts to get notified when a metric violates pre-defined thresholds.
-
For further log analysis and insights, you can integrate with BigQuery.
Log-based metrics count the log entries that match a given filter for the current project. For example, you could create a metric to track the number of trips created over time with the following query:
resource.type="audited_resource"
resource.labels.method="maps.fleetengine.v1.TripService.ReportBillableTrip"
For an overview and instructions on how to create log-based metrics, see Log-based metrics.
Set up alerts
You can create alerts to notify customers when a metric falls out of a defined threshold, and specify notification channels for those alerts. See Configure log-based alerting policies.
What's next
Learn how to analyse logs with BigQuery.