Configure notificações de monitorização para o crescimento do repositório
Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Esta página descreve como criar uma política de alerta que pode enviar-lhe uma notificação quando o crescimento do repositório do Artifact Registry exceder um limite. Estas instruções destinam-se à consola Google Cloud .
Para mais informações sobre as políticas de alerta, consulte o artigo
Vista geral dos alertas.
Antes de começar
Para receber as autorizações de que
precisa para criar e modificar políticas de alerta através da Google Cloud consola,
peça ao seu administrador para lhe conceder a função IAM de
Editor de monitorização (roles/monitoring.editor) no seu projeto.
Para mais informações sobre a atribuição de funções, consulte o artigo Faça a gestão do acesso a projetos, pastas e organizações.
Certifique-se de que conhece os conceitos gerais das políticas de alerta.
Para obter informações acerca destes tópicos, consulte o artigo
Vista geral dos alertas.
Configure os canais de notificação que quer usar para receber
notificações. Para fins de redundância, recomendamos que crie
vários tipos de canais de notificação. Para mais informações, consulte o artigo
Crie e faça a gestão de canais de notificação.
Crie uma política de alerta
Para receber uma notificação quando o tamanho do repositório do Artifact Registry exceder um tamanho específico,
crie uma política de alertas. A política de alertas monitoriza o tamanho do seu repositório e, quando esse tamanho excede o limite especificado, são enviadas notificações para todos os canais de notificação anexados à política de alertas.
Se usar a barra de pesquisa para encontrar esta página, selecione o resultado cujo subtítulo é
Monitorização.
Se não tiver criado os canais de notificação e quiser receber notificações, clique em
Editar canais de notificação e adicione os seus canais de notificação. Regresse à página
Alertas depois de adicionar os seus canais.
Na página Alertas, selecione Criar política.
Para selecionar o recurso, a métrica e os filtros, expanda o menu Selecionar uma métrica e, de seguida, use os valores na tabela Nova condição:
Opcional: para limitar o menu a entradas relevantes, introduza o recurso ou o nome da métrica na barra de filtro.
Selecione um Tipo de recurso. Por exemplo, selecione Instância de VM.
Selecione uma categoria de métricas. Por exemplo, selecione instância.
Selecione uma métrica. Por exemplo, selecione Utilização da CPU.
Selecione Aplicar.
Clique em Seguinte e, de seguida, configure o acionador da política de alertas.
Para preencher estes campos, use os valores na tabela Configurar acionador de alerta.
Clicar em Seguinte.
Opcional: para adicionar notificações à sua política de alertas, clique em
Canais de notificação. Na caixa de diálogo, selecione um ou mais canais de notificação no menu e, de seguida, clique em OK.
Para receber uma notificação quando os incidentes são abertos e fechados, selecione a opção
Notificar no encerramento do incidente. Por predefinição, as notificações são enviadas apenas quando
são abertos incidentes.
Opcional: atualize a Duração do encerramento automático do incidente. Este campo determina quando o Monitoring fecha incidentes na ausência de dados de métricas.
Opcional: clique em Documentação e, de seguida, adicione as informações que quer incluir numa mensagem de notificação.
Clique em Nome do alerta e introduza um nome para a política de alertas.
Clique em Criar política.
Nova condição Campo
Valor
Recurso e métrica
No menu Recursos, selecione Repositório do Artifact Registry.
No menu Categorias de métricas, selecione Repositório.
No menu Métricas, selecione Tamanho do repositório.
Para mostrar todos os tipos de métricas, mesmo os que não têm dados, clique em Ativo. Por predefinição, os menus só mostram tipos de métricas com dados. Para mais informações,
consulte o artigo Métrica não apresentada no menu.
Filtro
Opcional.
Use a etiqueta resource_container para enviar um alerta para um projeto ou uma organização introduzindo o ID do projeto ou o ID da organização.
Use a etiqueta repository_id para receber alertas sobre um repositório específico. Para mais
informações, consulte
Filtre a série cronológica selecionada.
Em intervalos temporais
Agregação de intervalos temporais
none
Janela de rolagem
Usar predefinição.
Função de período contínuo
max
Configure o acionador de alerta Campo
Valor
Tipo de condição
Threshold
Acionador de alertas
Any time series violates
Posição do limite
Above threshold
Valor do limite
Definido para o tamanho do repositório em bytes que aciona o alerta. Por exemplo, para acionar um alerta se o tamanho do repositório for superior a 0,5 GB, defina o valor do limite como 500000000.
Período de novo teste
O valor predefinido é No retest. Com esta definição, uma única medição pode resultar numa notificação. Para mais informações e um exemplo, consulte as
Definições de período de alinhamento e duração.
[[["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-08-21 UTC."],[[["\u003cp\u003eThis page provides instructions on creating an alerting policy in the Google Cloud console to monitor Artifact Registry repository growth and send notifications when a specified size threshold is exceeded.\u003c/p\u003e\n"],["\u003cp\u003eBefore creating an alerting policy, users need the Monitoring Editor IAM role, familiarity with alerting policy concepts, and configured notification channels.\u003c/p\u003e\n"],["\u003cp\u003eThe process involves navigating to the Alerting page in the Google Cloud console, selecting "Create policy," and configuring the resource, metric, filters, and alert trigger.\u003c/p\u003e\n"],["\u003cp\u003eUsers can customize the alerting policy by adding notification channels, defining incident autoclose duration, adding documentation, and setting a specific threshold value to trigger alerts based on repository size.\u003c/p\u003e\n"],["\u003cp\u003eThe necessary configuration for monitoring the repository size is setting the Resource as Artifact Registry Repository, the Metric Category as Repository, the Metric as Repository size and setting the condition type to \u003ccode\u003eThreshold\u003c/code\u003e with the \u003ccode\u003eAbove Threshold\u003c/code\u003e position.\u003c/p\u003e\n"]]],[],null,["# Configure monitoring notifications for repository growth\n\nThis page describes how to create an alerting policy that can notify you when the\nArtifact Registry repository growth exceeds a limit. These\ninstructions are for the Google Cloud console.\n\nFor more information about alerting policies, see\n[Alerting overview](/monitoring/alerts).\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 notifications. For redundancy purposes, we recommend that you create\n multiple types of notification channels. For more information, see\n [Create and manage notification channels](/monitoring/support/notification-options).\n\nCreate an alerting policy\n-------------------------\n\nTo get notified when your Artifact Registry repository size grows beyond a specific size,\ncreate an alerting policy. The alerting policy monitors the size of your repository and when that\nsize exceeds the threshold you specify, notifications are sent to all notification channels\nattached to the alerting policy.\n\n#### Steps to create an [alerting policy](/monitoring/alerts/using-alerting-ui#create-policy).\n\nTo create an alerting policy, 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. If you haven't created your notification channels and if you want to be notified, then click **Edit Notification Channels** and add your notification channels. Return to the **Alerting** page after you add your channels.\n3. From the **Alerting** page, select **Create policy**.\n4. To select the resource, metric, and filters, expand the **Select a metric** menu and then use the values in the **New condition** table:\n 1. Optional: To limit the menu to relevant entries, enter the resource or metric name in the filter bar.\n 2. Select a **Resource type** . For example, select **VM instance**.\n 3. Select a **Metric category** . For example, select **instance**.\n 4. Select a **Metric** . For example, select **CPU Utilization**.\n 5. Select **Apply**.\n5. Click **Next** and then configure the alerting policy trigger. To complete these fields, use the values in the **Configure alert trigger** table.\n6. Click **Next**.\n7. Optional: To add notifications to your alerting policy, click\n **Notification channels** . In the dialog, select one or more notification\n channels from the menu, and then click **OK**.\n\n To be notified when incidents are openend and closed, check\n **Notify on incident closure**. By default, notifications are sent only when\n incidents are openend.\n8. Optional: Update the **Incident autoclose duration**. This field determines when Monitoring closes incidents in the absence of metric data.\n9. Optional: Click **Documentation**, and then add any information that you want included in a notification message.\n10. Click **Alert name** and enter a name for the alerting policy.\n11. Click **Create Policy**.\n\nWhat's next\n-----------\n\n- To learn more about metric-threshold alerting policies, see [Create metric-threshold alerting policies](/monitoring/alerts/using-alerting-ui).\n- To view available Artifact Registry metrics, see [Google Cloud metrics](/monitoring/api/metrics_gcp_a_b#gcp-artifactregistry)"]]