Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Nesta página, fornecemos instruções detalhadas sobre como consultar e visualizar alertas
abertos usando o console do GDC e a ferramenta curl para o endpoint
do Cortex, a fim de entender os problemas e resolvê-los.
Depois de criar regras de alerta com base em registros e métricas de ambientes isolados do Google Distributed Cloud (GDC), você pode começar a monitorar alertas abertos do seu projeto. É possível visualizar e filtrar alertas que os eventos do sistema acionam no console do GDC ou acessar diretamente do Cortex usando a ferramenta curl para scripts flexíveis e automação.
É possível acessar os alertas abertos de uma das duas maneiras a seguir:
Console do GDC: visualize dados de alertas em painéis integrados
com informações como o número de alertas para uma fonte de dados específica,
o nível de gravidade, a duração, o status, a mensagem e os rótulos. O console do GDC oferece uma interface fácil de usar para filtrar e analisar alertas dos componentes do sistema.
Endpoint do Cortex Alertmanager: para casos de uso mais avançados, consulte diretamente a instância do Cortex do seu projeto usando a ferramenta curl em uma linha de comando.
O Cortex armazena os alertas do Alertmanager do seu projeto e fornece um endpoint HTTP para acesso programático. Com esse acesso, é possível exportar dados, automatizar tarefas, configurar cron jobs e criar integrações personalizadas.
Antes de começar
Para ter as permissões necessárias para consultar e visualizar alertas, peça ao administrador do IAM do projeto para conceder a você uma das funções associadas do Alertmanager do Project Cortex no namespace do projeto. Dependendo do nível de acesso e das permissões necessárias, você pode receber papéis de editor ou leitor para esse recurso em um projeto.
No menu de navegação, selecione Operações>Alertas.
Selecione a guia Alertas.
Confira a lista de alertas.
Na seção Alertas abertos, clique em Filtrar para mostrar apenas os alertas abertos. Também é possível filtrar alertas por outros nomes ou valores de propriedades.
Clique no nome de um alerta para ver os detalhes.
Endpoint do Cortex
Nesta seção, descrevemos como acessar alertas usando o endpoint do Alertmanager do Cortex.
Identificar seu endpoint do Cortex
O URL a seguir é o endpoint da instância do Cortex do seu projeto:
Use seu nome de usuário e senha para autenticar e fazer login.
Quando o login for concluído, use o cabeçalho de autorização na sua
solicitação cURL com o comando gdcloud auth print-identity-token. Para
mais informações, consulte
gdcloud auth.
Chamar o endpoint do Cortex
Siga estas etapas para acessar o endpoint do Cortex usando a ferramenta curl:
[[["Fácil de entender","easyToUnderstand","thumb-up"],["Meu problema foi resolvido","solvedMyProblem","thumb-up"],["Outro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Informações incorretas ou exemplo de código","incorrectInformationOrSampleCode","thumb-down"],["Não contém as informações/amostras de que eu preciso","missingTheInformationSamplesINeed","thumb-down"],["Problema na tradução","translationIssue","thumb-down"],["Outro","otherDown","thumb-down"]],["Última atualização 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."]]