Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Halaman ini memberikan petunjuk mendetail tentang cara membuat kueri dan memvisualisasikan pemberitahuan terbuka menggunakan konsol GDC dan alat curl untuk endpoint Cortex guna mendapatkan informasi tentang masalah dan menyelesaikan masalah.
Setelah membuat aturan pemberitahuan
berdasarkan log dan metrik dari lingkungan air-gapped Google Distributed Cloud (GDC), Anda
dapat mulai memantau pemberitahuan terbuka dari project Anda. Anda dapat memvisualisasikan dan memfilter pemberitahuan yang dipicu oleh peristiwa sistem di konsol GDC atau mengaksesnya langsung dari Cortex menggunakan alat curl untuk pembuatan skrip dan otomatisasi yang fleksibel.
Anda dapat mengakses pemberitahuan terbuka dengan salah satu dari dua metode berikut:
Konsol GDC: Visualisasikan data pemberitahuan di panel terintegrasi yang berisi informasi seperti jumlah pemberitahuan untuk sumber data tertentu, tingkat keparahan, durasi, status, pesan, dan label. Konsol GDC menyediakan antarmuka yang mudah digunakan untuk memfilter dan menganalisis pemberitahuan dari komponen sistem Anda.
Endpoint Cortex Alertmanager: Untuk kasus penggunaan yang lebih canggih, kueri instance Cortex project Anda secara langsung menggunakan alat curl di command line.
Cortex menyimpan pemberitahuan Alertmanager project Anda dan menyediakan endpoint HTTP untuk akses terprogram. Akses ini memungkinkan Anda mengekspor data, mengotomatiskan tugas,
mengonfigurasi cron job, dan membuat integrasi kustom.
Sebelum memulai
Untuk mendapatkan izin yang Anda perlukan untuk membuat kueri dan memvisualisasikan pemberitahuan, minta Admin IAM Project Anda untuk memberi Anda salah satu peran Project Cortex Alertmanager terkait di namespace project Anda. Bergantung pada tingkat akses dan izin yang Anda perlukan, Anda mungkin mendapatkan peran editor atau pelihat untuk resource ini dalam project.
Untuk mengetahui informasi selengkapnya tentang peran ini, lihat
Siapkan izin IAM.
Melihat dan memfilter pemberitahuan yang belum diselesaikan
Pilih salah satu metode berikut untuk membuat kueri dan memfilter pemberitahuan terbuka dari namespace project Anda:
Konsol
Melihat pemberitahuan terbuka dalam project dari konsol GDC:
Di bagian Peringatan yang dibuka, klik Filter untuk hanya menampilkan peringatan yang belum ditutup. Anda juga dapat memfilter notifikasi berdasarkan nama atau nilai properti lainnya.
Klik nama pemberitahuan untuk melihat detail pemberitahuan.
Endpoint Cortex
Bagian ini menjelaskan cara mengakses pemberitahuan menggunakan endpoint Cortex Alertmanager.
Mengidentifikasi endpoint Cortex Anda
URL berikut adalah endpoint instance Cortex project Anda:
Gunakan nama pengguna dan sandi Anda untuk mengautentikasi dan login.
Jika login berhasil, Anda dapat menggunakan header otorisasi dalam permintaan
cURL melalui perintah gdcloud auth print-identity-token. Untuk
mengetahui informasi selengkapnya, lihat
gdcloud auth.
Panggil endpoint Cortex
Selesaikan langkah-langkah berikut untuk menjangkau endpoint Cortex menggunakan alat curl:
[[["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-04 UTC."],[[["\u003cp\u003eThis guide explains how to monitor open alerts in Google Distributed Cloud (GDC) air-gapped environments, which are triggered by system events from logs and metrics.\u003c/p\u003e\n"],["\u003cp\u003eYou can access and visualize alerts either through the user-friendly GDC console, which offers filtering capabilities, or directly via the Cortex Alertmanager endpoint.\u003c/p\u003e\n"],["\u003cp\u003eThe Cortex endpoint, accessible via the \u003ccode\u003ecurl\u003c/code\u003e tool, provides programmatic access to alerts, enabling automation, scripting, and custom integrations for more advanced use cases.\u003c/p\u003e\n"],["\u003cp\u003eTo access the alerts, you will need to first acquire the necessary Project Cortex Alertmanager roles from your Project IAM Admin, either as a viewer or editor.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ecurl\u003c/code\u003e tool requires authentication through the \u003ccode\u003egdcloud\u003c/code\u003e CLI using your username and password, to be able to access the cortex endpoint.\u003c/p\u003e\n"]]],[],null,["# Query and view open alerts\n\nThis page provides detailed instructions on how to query and visualize open\nalerts using both the GDC console and the `curl` tool for the Cortex\nendpoint to gain issue awareness and resolve problems.\n\nAfter [creating alert rules](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/create-alert-rules)\nbased on logs and metrics from Google Distributed Cloud (GDC) air-gapped environments, you\ncan start monitoring open alerts from your project. You can visualize and filter\nalerts that your system events trigger on the GDC console or access\nthem directly from Cortex using the `curl` tool for flexible scripting and\nautomation.\n\nYou can access open alerts in one of the following two methods:\n\n- **GDC console**: Visualize alerting data in integrated panels containing information like the number of alerts for a specific data source, the severity level, duration, status, message, and labels. The GDC console provides a user-friendly interface for filtering and analyzing alerts from your system components.\n- **Cortex Alertmanager endpoint** : For more advanced use cases, query your project's Cortex instance directly using the `curl` tool on a command line. Cortex stores your project's Alertmanager alerts and provides an HTTP endpoint for programmatic access. This access lets you export data, automate tasks, configure cron jobs, and build custom integrations.\n\nBefore you begin\n----------------\n\nTo get the permissions that you need to query and visualize alerts, ask your\nProject IAM Admin to grant you one of the associated Project Cortex Alertmanager\nroles in your project namespace. Depending on the level of access and\npermissions you need, you might obtain editor or viewer roles for this resource\nin a project.\n\nFor more information about these roles, see\n[Prepare IAM permissions](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/obs-iam-permissions).\n\nView and filter open alerts\n---------------------------\n\nSelect one of the following methods to query and filter open alerts from your\nproject namespace: \n\n### Console\n\nView the open alerts in a project from the GDC console:\n\n1. [Sign in to the GDC console](/distributed-cloud/hosted/docs/latest/gdch/platform/pa-user/iam/sign-in).\n2. In the GDC console, select your project.\n3. In the navigation menu, select **Operations** \\\u003e **Alerting**.\n4. Select the **Alerts** tab.\n5. View the list of alerts.\n6. On the **Alerts opened** section, click **Filter** to only display open alerts. You can also filter alerts by other property names or values.\n7. Click an alert name to view the alert details.\n\n### Cortex endpoint\n\nThis section describes how to access alerts using your Cortex Alertmanager\nendpoint.\n\n#### Identify your Cortex endpoint\n\nThe following URL is the endpoint of the Cortex instance of your project: \n\n https://\u003cvar translate=\"no\"\u003eGDC_URL\u003c/var\u003e/\u003cvar translate=\"no\"\u003ePROJECT_NAMESPACE\u003c/var\u003e/cortex/alertmanager/\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eGDC_URL\u003c/var\u003e: the URL of your organization in GDC.\n- \u003cvar translate=\"no\"\u003ePROJECT_NAMESPACE\u003c/var\u003e: your project namespace.\n\n For example, the Cortex endpoint for the `platform-obs` project in the\n `org-1` organization is `https://org-1/platform-obs/cortex/alertmanager/`.\n | **Note:** You can directly open the URL in a web browser to query alerts. The instructions in the following sections use the `curl` command to call the endpoint, but the same applies to a web browser.\n\n#### Authenticate the `curl` request\n\n1. [Download and install the gdcloud CLI](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-overview).\n2. [Set](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-reference/gdcloud-config-set) the\n gdcloud `core/organization_console_url` property:\n\n gdcloud config set core/organization_console_url\n https://\u003cvar translate=\"no\"\u003eGDC_URL\u003c/var\u003e\n\n3. [Sign in with the configured identity provider](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-auth#sign-in-with-idp):\n\n gdcloud auth login\n\n4. Use your username and password to authenticate and sign in.\n\n When the login is successful, you can use the authorization header in your\n cURL request through the `gdcloud auth print-identity-token` command. For\n more information, see\n [gdcloud auth](/distributed-cloud/hosted/docs/latest/gdch/resources/gdcloud-reference/gdcloud-auth).\n\n#### Call the Cortex endpoint\n\nComplete the following steps to reach the Cortex endpoint using the `curl`\ntool:\n\n1. [Authenticate the `curl` request](#auth-curl-request).\n2. Use `curl` to call the [Cortex endpoint](#id-cortex-endpoint) and\n extend the URL using the standard Alertmanager API specification\n (\u003chttps://prometheus.io/docs/prometheus/latest/querying/api/#alertmanagers\u003e)\n to query alerts.\n\n The following is an example of a `curl` request: \n\n curl https://\u003cvar translate=\"no\"\u003eGDC_URL\u003c/var\u003e/\u003cvar translate=\"no\"\u003ePROJECT_NAME\u003c/var\u003e/cortex/alertmanager/api/v1/alertmanagers \\\n -H \"Authorization: Bearer $(gdcloud auth print-identity-token \\\n --audiences=https://\u003cvar translate=\"no\"\u003eGDC_URL\u003c/var\u003e)\"\n\n You obtain the output following the command. The API response is in JSON\n format.\n | **Note:** Add the `api/v1/alertmanagers` endpoint to query active and eliminated alerts from the URL."]]