Configurar alertas de uso de cota na página "Cotas"
É possível configurar alertas de cota na página Cotas para receber notificações quando o uso da cota atingir uma porcentagem do valor máximo. No momento, esse recurso é compatível apenas com cotas no nível do projeto.
Para configurar um alerta para uma cota específica, faça o seguinte:
Na página Cotas e limites do sistema, procure a última coluna da tabela.
Clique em more_vertMais ações e selecione
Criar alerta de uso.
Selecione o modelo de uso de cota e os canais de notificação escolhidos.
Clique em Criar políticas.
Opcional: se quiser personalizar a política de alertas padrão, abra
o menu suspenso e siga as instruções.
Usar o Cloud Monitoring.
A API e o console do Cloud Monitoring permitem
monitorar mais detalhadamente o uso de cotas, os valores e os erros. É possível usar essas métricas para
criar painéis e alertas personalizados. É possível monitorar o uso da cota ao longo do tempo
e receber alertas. Por exemplo, quando você está se aproximando do valor máximo da cota.
O Cloud Monitoring é compatível com várias métricas, que podem ser combinadas com filtros e agregações para ter visualizações novas e detalhadas sobre o uso da cota. Por exemplo, é possível combinar uma métrica para o uso da cota de alocação com um
filtro quota_metric em nomes de Cloud TPU.
Para visualizar as métricas de um recurso monitorado usando o
Metrics Explorer, faça o seguinte:
No console do Google Cloud, acesse a página do leaderboardMetrics Explorer:
Se você usar a barra de pesquisa para encontrar essa página, selecione o resultado com o subtítulo Monitoramento.
No elemento Metric, expanda o menu Selecionar uma métrica,
digite quota usage
na barra de filtro e use os submenus para selecionar um tipo de recurso e métrica específicos:
No menu Recursos ativos, selecione Cota de consumidor.
No menu Categorias de métrica ativa, selecione Cota.
No menu Métricas ativas, selecione uma métrica da lista. Para mostrar métricas ativas e inativas, clique em Ativo para limpar o filtro no menu Selecionar uma métrica.
Clique em Aplicar.
Para remover séries temporais da exibição, use o
elemento Filtro.
Para combinar séries temporais, use os menus no
elemento Agregação.
Por exemplo, para exibir a utilização da CPU para suas VMs, com base na zona, defina o primeiro menu como Média e o segundo como zona.
Todas as séries temporais são exibidas quando o primeiro menu do elemento Agregação está definido como Não agregado. As configurações padrão do elemento Agregação
são determinadas pelo tipo de métrica selecionada.
Para cotas e outras métricas que informam uma amostra por dia, faça as seguintes ações:
No painel Exibição, defina o Tipo de widget como Gráfico de barras empilhadas.
Defina o período como pelo menos uma semana.
Depois de encontrar as informações de uso de cota que você queria, use o
Cloud Monitoring para criar painéis personalizados e alertas para ajudar
você a monitorar e manter um aplicativo robusto. Para mais informações, consulte os
documentos a seguir:
Nem todos os serviços aceitam as métricas de cota no Cloud Monitoring. Para ver as métricas de cota aplicáveis a
serviços compatíveis, selecione Cotas do consumidor como o tipo de recurso ao
criar um gráfico ou uma política de alertas. A visualização
não mostrará os serviços que não forem desse tipo.
Os serviços comuns compatíveis com as métricas de cota incluem Compute Engine,
Dataflow, Cloud Spanner, Pub/Sub, Cloud Vision,
Speech-to-Text, Cloud Monitoring e Cloud Logging.
Os serviços comuns que não são compatíveis com as métricas de cota incluem o App Engine e o
Cloud SQL.
[[["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 2024-12-22 UTC."],[[["\u003cp\u003eYou can use Cloud Monitoring to set up alerts for quota usage, such as receiving notifications when usage reaches a specific percentage of the maximum value.\u003c/p\u003e\n"],["\u003cp\u003eThe Cloud Quotas dashboard allows creating usage alerts directly from the \u003cstrong\u003eQuotas & System Limits\u003c/strong\u003e page, where you can also configure the notification channel for these alerts.\u003c/p\u003e\n"],["\u003cp\u003eThe Metrics Explorer in Cloud Monitoring enables the creation of charts to visualize Cloud Quota metrics, such as selecting "Consumer Quota" as the resource and choosing specific quota metrics.\u003c/p\u003e\n"],["\u003cp\u003eCloud Monitoring offers advanced tools to monitor quota usage and create custom dashboards, such as combining metrics with filters and aggregations to gain deeper insights.\u003c/p\u003e\n"],["\u003cp\u003eQuota metric support varies by service; you can verify whether a service supports these metrics by checking if "Consumer Quota" is an available option when creating a chart or alert policy.\u003c/p\u003e\n"]]],[],null,["# Set up quota alerts and monitoring\n\nYou can set up quota usage alerts and monitoring by using\n[Cloud Monitoring](/cloud-monitoring). This document describes how to set up\nalerts, create charts, and find more information about using Cloud Monitoring\nfor Cloud Quotas.\n\nSet up basic quota usage alerts\n-------------------------------\n\nThe Cloud Quotas dashboard is integrated with\n[Cloud Monitoring](/monitoring/docs/monitoring-overview). You\ncan set up quota alerts from the\n**IAM \\& Admin \\\u003e Quotas \\& System Limits** page to get\nnotifications of quota events. For example, you can set up an alert to notify\nyou when your quota usage reaches a percentage of the maximum value. This\nfeature is only supported for project-level quotas.\n\nTo set up an alert for a specific quota or system limit, do the following:\n\n1. Make sure that you have\n [permissions to create alerts](/docs/quotas/permissions#permissions_create_alert)\n\n2. In the Google Cloud console, go to the\n **IAM \\& Admin \\\u003e Quotas \\& System Limits** page:\n\n\n [Go to Quotas \\& System Limits](https://console.cloud.google.com/iam-admin/quotas)\n\n \u003cbr /\u003e\n\n3. In the right-most column of the table, click more_vert **More\n actions** , and then select **Create usage alert** . The **Alert policy\n templates** pane opens.\n\n4. Under **Configure notifications**, select your notification channel. The\n notification channel is how you receive the alert---for example email,\n SMS, or Pub/Sub.\n\n5. Click **Create**.\n\nCreate charts\n-------------\n\nThe Cloud Monitoring metrics explorer lets you create charts to view metrics.\nYou can use it to view metrics related to Cloud Quotas.\n\n\u003cbr /\u003e\n\nTo view the metrics for a monitored resource by using the\nMetrics Explorer, do the following:\n\n1. In the Google Cloud console, go to the\n *leaderboard* **Metrics explorer** page:\n\n [Go to **Metrics explorer**](https://console.cloud.google.com/monitoring/metrics-explorer)\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. In the toolbar of the Google Cloud console, select your Google Cloud project. For [App Hub](/app-hub/docs/overview) configurations, select the App Hub host project or the app-enabled folder's management project.\n3. In the **Metric** element, expand the **Select a metric** menu, enter `quota usage` in the filter bar, and then use the submenus to select a specific resource type and metric:\n 1. In the **Active resources** menu, select **Consumer Quota**.\n 2. In the **Active metric categories** menu, select **Quota**.\n 3. In the **Active metrics** menu, select a metric from the list. To display both active and inactive metrics, click **Active** to clear the filter in the **Select a metric** menu.\n 4. Click **Apply**.\n4. To remove time series from the display, use the\n [**Filter** element](/monitoring/charts/metrics-selector#filter-option).\n\n5. To combine time series, use the menus on the\n [**Aggregation** element](/monitoring/charts/metrics-selector#select_display).\n For example, to display the CPU utilization for your VMs, based on their zone, set the\n first menu to **Mean** and the second menu to **zone**.\n\n All time series are displayed when the first menu of the **Aggregation** element is set\n to **Unaggregated** . The default settings for the **Aggregation** element\n are determined by the metric type you selected.\n6. For quota and other metrics that report one sample per day, do the following:\n 1. In the **Display** pane, set the **Widget type** to **Stacked bar chart**.\n 2. Set the time period to at least one week.\n\n| **Note:** Quota values are updated once per day. Changes to values can take up to 24 hours to be updated in the Google Cloud console.\n\nAfter you've found the quota usage information you want, you can use\nCloud Monitoring to create custom dashboards and alerts. For more\ninformation, see [Do more with Cloud Monitoring](#do-more).\n\nCheck quota metric support\n--------------------------\n\nNot all services support quota metrics in Cloud Monitoring. To see\napplicable quota metrics for supported services, select **Consumer Quota** as\nthe resource type when building a chart or creating an alerting policy. Services\nthat don't support quota metrics aren't displayed.\n\n- Common services that support quota metrics include Compute Engine,\n Dataflow, Spanner, Pub/Sub, Cloud Vision,\n Speech-to-Text, Cloud Monitoring, and Cloud Logging.\n\n- Common services that don't support quota metrics include App Engine and\n Cloud SQL.\n\nGet metric names\n----------------\n\nQuotas and system limits have two types of names: display names and metric\nnames. Display names have spaces and capitalization that make them easier for\nhumans to read. Metric names are more likely to be lowercase and delimited by\nunderscores instead of spaces; the exact format depends on the service.\n\nThe following instructions show how to get quota and system limit metric names\nusing either the Google Cloud console or gcloud CLI. \n\n### Console\n\n1. In the Google Cloud console, go to the\n **IAM \\& Admin \\\u003e Quotas \\& System Limits** page:\n\n\n [Go to Quotas \\& System Limits](https://console.cloud.google.com/iam-admin/quotas)\n\n \u003cbr /\u003e\n\n The table on this page displays quotas and system limits that have usage or\n have adjusted values, and a reference entry for other quotas. The reference\n entry has the word \"default\" in parentheses at the end of the listing in\n the **Name** column. For\n example, `SetIAMPolicy requests per minute per region (default)` is the\n reference entry for the quota\n `SetIamPolicyRequestsPerMinutePerProject`.\n2. If you don't see the **Metric** column, take the following steps.\n\n 1. Click view_column **Column display options**.\n 2. Select **Metric**.\n 3. Click **OK** . The **Metric** column appears in the table.\n\nThe **Metric** column shows the metric names. To filter the results, enter a\nproperty name or value in the field next to\nfilter_list **Filter**.\n\n### gcloud\n\nTo get the metric names for a Google Cloud service by\nusing the gcloud CLI, run the `quotas info list`\ncommand. To skip lines that don't list metric names, pass the output to a\ncommand such as `grep` with `metric:` as the search term, or use the\ngcloud CLI\n[`--format`](/sdk/gcloud/reference#--format) flag: \n\n gcloud beta quotas info list --project=\u003cvar translate=\"no\"\u003ePROJECT_ID_OR_NUMBER\u003c/var\u003e \\\n --service=\u003cvar translate=\"no\"\u003eSERVICE_NAME\u003c/var\u003e --format=\"value(metric)\"\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID_OR_NUMBER\u003c/var\u003e: the project ID or project number.\n- \u003cvar translate=\"no\"\u003eSERVICE_NAME\u003c/var\u003e: the name of the service whose quota metrics you want to see---for example, the service name for Compute Engine is `compute.googleapis.com`. Include the `googleapis.com` portion of the service name.\n\nDo more with Cloud Monitoring\n-----------------------------\n\nThe [Cloud Monitoring](/cloud-monitoring) tools let you monitor quota usage,\nvalues, and errors in depth. You can use these metrics to create custom\ndashboards and alerts. For example, you can view quota usage over time or\nreceive an alert when you're approaching your quota value.\n\nCloud Monitoring supports a wide variety of metrics that you can combine\nwith filters and aggregations for new and insightful views into your quota\nusage. For example, you can combine a metric for allocation quota usage with a\n`quota_metric` filter on Cloud TPU names.\n\nPricing for Cloud Monitoring is described in the\n[Google Cloud Observability pricing](https://cloud.google.com/stackdriver/pricing)\ndocument.\n\nThe [Cloud Monitoring documentation](/monitoring/docs/monitoring-overview)\nis extensive, so here are a few documents to get you started:\n\n- [Building charts](/monitoring/charts): A comprehensive guide to creating charts and tables, and adding them to a custom dashboard.\n- [Introduction to alerting](/monitoring/alerts): An overview covering how alerting works and what your options are for creating an alert policy.\n- [Managing alerting policies](/monitoring/alerts/manage-alerts): A guide to various management tasks for your existing alerting policies---for example, view a policy, edit a policy, delete a policy, or add a policy to a dashboard.\n- [Using quota metrics](/monitoring/alerts/using-quota-metrics): A detailed document dedicated to quotas use cases, with examples covering topics such as how to create alerts for `quota/exceeded` errors.\n- [Google Cloud metrics guide](/monitoring/api/metrics_gcp_p_z#gcp-serviceruntime): A metrics reference document. The `serviceruntime` section lists the quotas metrics used for monitoring."]]