[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-28。"],[],[],null,["# Create alerting policy that monitors a resource group\n\nThis document describes how to use the Google Cloud console to create an alerting\npolicy that monitors a metric for a specific [resource group](/monitoring/groups).\nA *resource group* is a dynamic collection of resources, where membership in the\ngroup is defined by some criteria. For example, you might\ndefine a resource group for the Compute Engine virtual machine (VM) instances\nthat you use for production. After you create that group, you can then\ncreate an alerting policy that monitors only that group of instances. When\nyou add a VM that matches the group criteria, the alerting policy\nautomatically monitors that VM.\n\n\nThis content does not apply to log-based alerting policies.\nFor information about log-based alerting policies, which notify you when a\nparticular message appears in your logs, see\n[Monitoring your logs](/logging/docs/alerting/monitoring-logs).\n\nBefore you begin\n----------------\n\n1.\n\n To get the permissions that\n you need to create and modify alerting policies by using the Google Cloud console,\n\n ask your administrator to grant you the\n\n\n [Monitoring Editor](/iam/docs/roles-permissions/monitoring#monitoring.editor) (`roles/monitoring.editor`)\n IAM role on your project.\n\n\n For more information about granting roles, see [Manage access to projects, folders, and organizations](/iam/docs/granting-changing-revoking-access).\n\n\n You might also be able to get\n the required permissions through [custom\n roles](/iam/docs/creating-custom-roles) or other [predefined\n roles](/iam/docs/roles-overview#predefined).\n\n For more information about Cloud Monitoring roles,\n see [Control access with Identity and Access Management](/monitoring/access-control).\n2. Ensure that you're familiar with the general concepts of alerting policies.\n For information about these topics, see\n [Alerting overview](/monitoring/alerts).\n\n3. Configure the notification channels that you want to use to receive any\n alerts. For redundancy purposes, we also recommend that you create\n multiple types of notification channels. For information about these steps,\n see [Create and manage notification channels](/monitoring/support/notification-options).\n\n4. Configure the [resource group](/monitoring/groups) that you want to monitor.\n\nCreate alerting policy\n----------------------\n\nTo create an alerting policy that monitors a resource-group by using the\nCloud Monitoring API, the filter expression must specify a `group.id`. For\nan example of a JSON file that specifies this field,\nsee [Group-aggregate policy](/monitoring/alerts/policies-in-json#json-group-aggr).\n\nTo create an alerting policy that monitors a resource-group by using the\nGoogle Cloud console, do the following:\n\n1. In the Google Cloud console, go to the\n *notifications* **Alerting** page:\n\n [Go to **Alerting**](https://console.cloud.google.com/monitoring/alerting)\n\n \u003cbr /\u003e\n\n If you use the search bar to find this page, then select the result whose subheading is\n **Monitoring**.\n2. Select **Create policy**.\n3. Expand the **Select a metric** menu and select the metric type that you want\n to monitor.\n\n4. Restrict the resources to those in a Monitoring group:\n\n 1. Click **Add Filter** and select **Group**.\n 2. Expand *arrow_drop_down* **Value** and select the group name.\n 3. Click **Done**.\n\n You can't modify the group while the group is being used by an\n alerting policy.\n5. Complete the alerting policy. You must configure the condition trigger,\n notifications, documentation, and policy name,\n and then click **Create policy**.\n\nFor more information about the settings in an alerting policy, see\n[Create metric-threshold alerting policies](/monitoring/alerts/using-alerting-ui)."]]