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: