Membuat kebijakan pemberitahuan yang memantau grup resource
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Dokumen ini menjelaskan cara menggunakan konsol Google Cloud untuk membuat kebijakan pemberitahuan yang memantau metrik untuk grup resource tertentu.
Grup resource adalah kumpulan resource dinamis, dengan keanggotaan dalam
grup ditentukan oleh beberapa kriteria. Misalnya, Anda dapat
menentukan grup resource untuk instance virtual machine (VM) Compute Engine
yang Anda gunakan untuk produksi. Setelah membuat grup tersebut, Anda dapat
membuat kebijakan pemberitahuan yang hanya memantau grup instance tersebut. Saat
Anda menambahkan VM yang cocok dengan kriteria grup, kebijakan pemberitahuan
akan otomatis memantau VM tersebut.
Konten ini tidak berlaku untuk kebijakan pemberitahuan berbasis log.
Untuk mengetahui informasi tentang kebijakan pemberitahuan berbasis log, yang memberi tahu Anda saat pesan tertentu muncul di log Anda, lihat Memantau log Anda.
Sebelum memulai
Untuk mendapatkan izin yang diperlukan guna membuat dan mengubah kebijakan pemberitahuan menggunakan konsol Google Cloud , minta administrator untuk memberi Anda peran IAM Monitoring Editor (roles/monitoring.editor) di project Anda.
Untuk mengetahui informasi selengkapnya tentang cara memberikan peran, lihat Mengelola akses ke project, folder, dan organisasi.
Pastikan Anda sudah memahami konsep umum kebijakan pemberitahuan.
Untuk mengetahui informasi tentang topik ini, lihat
Ringkasan pemberitahuan.
Konfigurasi saluran notifikasi yang ingin Anda gunakan untuk menerima
pemberitahuan. Untuk tujuan redundansi, sebaiknya Anda juga membuat beberapa jenis saluran notifikasi. Untuk mengetahui informasi tentang langkah-langkah ini, lihat Membuat dan mengelola saluran notifikasi.
Untuk membuat kebijakan pemberitahuan yang memantau grup resource menggunakan Cloud Monitoring API, ekspresi filter harus menentukan group.id. Untuk
contoh file JSON yang menentukan kolom ini,
lihat Kebijakan agregasi grup.
Untuk membuat kebijakan pemberitahuan yang memantau grup resource menggunakan
konsolGoogle Cloud , lakukan langkah berikut:
Di konsol Google Cloud , buka halaman
notificationsAlerting:
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Sulit dipahami","hardToUnderstand","thumb-down"],["Informasi atau kode contoh salah","incorrectInformationOrSampleCode","thumb-down"],["Informasi/contoh yang saya butuhkan tidak ada","missingTheInformationSamplesINeed","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 2025-09-03 UTC."],[],[],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)."]]