How do I set alerts based on events in my Dataflow

2019-08-06 04:44发布

问题:

I'd like to be able to take events like errors in my logs and set threshold-based alerts to notify me when anomalous behavior occurs.

回答1:

First, visit the Cloud Logging page and click the "Create logs-based metric" button on the far right. This will prompt you to enable the Cloud Monitoring API.

After doing this, return to the same page, where this button will allow you to create a metric name and description based on the current filter.

After creating such a metric, go to Dashboards & alerts, and click "Create Policy"

After entering a policy name, you can select Log Metrics as the resource type:

After clicking "Next", you should be able to select and configure an alert based on your "user/" metric: