Mantenha tudo organizado com as coleções
Salve e categorize o conteúdo com base nas suas preferências.
Criar e gerenciar rótulos de instância
O Bigtable oferece a opção de adicionar rótulos às instâncias. Rótulos são pares de chave-valor que você pode usar para agrupar instâncias relacionadas e armazenar metadados sobre uma instância.
Nesta página, explicamos como usar rótulos com as instâncias do
Bigtable. Nela também descrevemos como adicionar, atualizar e remover os rótulos de uma instância.
O que são rótulos?
Um rótulo é um par de chave-valor que pode ser atribuído a instâncias do Google Cloud .
Eles ajudam a organizar esses recursos e gerenciar seus custos em escala, com a granularidade necessária. É possível anexar um rótulo a cada recurso e filtrar os recursos
com base nesses rótulos. As informações sobre rótulos são encaminhadas ao sistema de
faturamento, que permite detalhar as cobranças faturadas por rótulo. Com os relatórios de faturamento integrados,
é possível filtrar e agrupar custos por rótulos de recursos. Também é possível usar rótulos para
consultar as exportações de dados de faturamento.
Requisitos para rótulos
Os rótulos aplicados a um recurso precisam atender aos seguintes requisitos:
Cada recurso pode ter até 64 rótulos.
Cada rótulo precisa ser um par de chave-valor.
As chaves têm comprimento mínimo de 1 e máximo de 63 caracteres. Além disso, elas não podem estar vazias. Os valores podem estar vazios e ter um comprimento máximo de 63 caracteres.
As chaves e os valores contêm apenas letras minúsculas, caracteres numéricos, sublinhados e traços. Todos os caracteres precisam usar a codificação UTF-8, e os caracteres internacionais são permitidos. As chaves precisam começar com uma letra minúscula ou um caractere internacional.
A parte principal de um rótulo de cluster precisa ser exclusiva em um único recurso.
No entanto, é possível usar a mesma chave com vários recursos.
Esses limites se aplicam à chave e ao valor de cada rótulo e aos
recursos individuais do Google Cloud que têm rótulos. Não
há limite para a quantidade de rótulos que podem ser aplicados a todos os recursos
em um projeto.
Usos comuns dos rótulos
Veja alguns casos de uso comum para rótulos:
Rótulos de centro de custo ou de equipe: adiciona rótulos com base na equipe ou no centro de custo para distinguir as instâncias pertencentes a equipes diferentes (por exemplo, team:research e team:analytics). Você pode usar esse tipo de rótulo para contabilidade de custo ou orçamento.
Rótulos de componentes: por exemplo, component:redis, component:frontend, component:ingest e component:dashboard.
Rótulos de ambientes ou de estágios: por exemplo, environment:production e environment:test.
Rótulos de estado: por exemplo, state:active, state:readytodelete e state:archive.
Rótulos de propriedade: usados para identificar as equipes
responsáveis pelas operações, por exemplo: team:shopping-cart.
Não recomendamos a criação de um grande número de rótulos exclusivos,
como os relacionados a carimbos de data/hora ou valores individuais, para todas as chamadas de API.
O problema com essa abordagem é que, quando os valores mudam com frequência ou com
chaves que desordenam o catálogo, isso dificulta a filtragem e a geração de
relatórios sobre os recursos.
Rótulos e tags
Os rótulos podem ser usados como anotações de consulta para recursos, mas não podem ser usados para definir condições em políticas. Com as tags, é possível permitir ou negar políticas condicionalmente com base em um recurso ter ou não uma tag específica, fornecendo controle refinado sobre as políticas. Para mais informações, consulte a Visão geral das tags.
Adicionar ou atualizar os rótulos de uma instância
[[["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-27 UTC."],[[["\u003cp\u003eLabels in Bigtable are key-value pairs that allow you to group related instances and store metadata, enabling you to organize resources and manage costs.\u003c/p\u003e\n"],["\u003cp\u003eEach Bigtable resource can have up to 64 labels, each with keys and values that must adhere to specific length and character requirements, and keys must be unique within each instance.\u003c/p\u003e\n"],["\u003cp\u003eCommon uses for labels include categorizing instances by team, component, environment, state, and ownership, helping with cost accounting and resource management.\u003c/p\u003e\n"],["\u003cp\u003eLabels can be added, updated, and removed via the Google Cloud console, RPC Admin API, or REST Admin API, providing flexible management options.\u003c/p\u003e\n"],["\u003cp\u003eWhile labels serve as queryable annotations, they cannot set policy conditions, in which case tags should be used instead, as they provide more fine-grained control.\u003c/p\u003e\n"]]],[],null,["# Create and manage instance labels\n=================================\n\nBigtable provides the option to add labels to your instances. Labels are\nkey-value pairs that you can use to group related instances and store metadata\nabout an instance.\n\nThis page explains how you can use labels with your Bigtable\ninstances. It also describes how to add, update, and remove the labels for an\ninstance.\n\nWhat are labels?\n----------------\n\nA label is a key-value pair that you can assign to Google Cloud instances.\nThey help you organize these resources and manage your costs at scale, with the\ngranularity you need. You can attach a label to each resource, then filter the\nresources based on their labels. Information about labels is forwarded to the billing system that\nlets you break down your billed charges by label. With built-in [billing reports](/billing/docs/how-to/reports),\nyou can filter and group costs by resource labels. You can also use labels to\nquery [billing data exports](/billing/docs/how-to/bq-examples).\n\nRequirements for labels\n-----------------------\n\nThe labels applied to a resource must meet the following\nrequirements:\n\n- Each resource can have up to 64 labels.\n- Each label must be a key-value pair.\n- Keys have a minimum length of 1 character and a maximum length of 63 characters, and cannot be empty. Values can be empty, and have a maximum length of 63 characters.\n- Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed. Keys must start with a lowercase letter or international character.\n- The key portion of a label must be unique within a single resource. However, you can use the same key with multiple resources.\n\nThese limits apply to the key and value for each label, and to the\nindividual Google Cloud resources that have labels. There\nis no limit on how many labels you can apply across all resources\nwithin a project.\n\nCommon uses of labels\n---------------------\n\nHere are some common use cases for labels:\n\n- **Team or cost center labels** : Add labels based on team or\n cost center to distinguish instances owned by different\n teams (for example, `team:research` and `team:analytics`). You can use this\n type of label for cost accounting or budgeting.\n\n- **Component labels** : For example, `component:redis`,\n `component:frontend`, `component:ingest`, and `component:dashboard`.\n\n- **Environment or stage labels** : For example,\n `environment:production` and `environment:test`.\n\n- **State labels** : For example, `state:active`,\n `state:readytodelete`, and `state:archive`.\n\n- **Ownership labels** : Used to identify the teams that are\n responsible for operations, for example: `team:shopping-cart`.\n\n\n| **Note:** Don't include sensitive information in labels, including personally identifiable information, such as an individual's name or title. Labels are not designed to handle sensitive information.\n\nWe don't recommend creating large numbers of unique labels, such as\nfor timestamps or individual values for every API call.\nThe problem with this approach is that when the values change frequently or with\nkeys that clutter the catalog, this makes it difficult to effectively filter and\nreport on resources.\n\nLabels and tags\n---------------\n\nLabels can be used as queryable annotations for resources, but can't be used\nto set conditions on policies. Tags provide a way to conditionally allow or\ndeny policies based on whether a resource has a specific tag, by providing fine-grained\ncontrol over policies. For more information, see the\n[Tags overview](/resource-manager/docs/tags/tags-overview).\n\nAdd or updating an instance's labels\n------------------------------------\n\nAfter you [create a Bigtable instance](/bigtable/docs/creating-instance), you can\nuse the Google Cloud console to add labels to the instance and update existing\nlabels. You can also use the [RPC Admin API](/bigtable/docs/reference/admin/rpc) or the [REST Admin\nAPI](/bigtable/docs/reference/admin/rest) to add or update labels.\n\nTo add or update labels for a Bigtable instance using the\nGoogle Cloud console:\n\n1.\n Open the list of Bigtable instances in the Google Cloud console.\n\n\n [Open the instance list](https://console.cloud.google.com/bigtable/instances)\n2. Check the box next to each instance whose labels you want to modify.\n\n3. If the **Labels** panel is not visible, click **Show info panel** in the\n upper right corner to open it.\n\n4. Add and update labels as needed.\n\n To add a new label, click **Add label**, then type the key and value for the\n label.\n\n To modify an existing label, update its value. You cannot change the key for\n an existing label.\n5. Click **Save** to save your changes.\n\nRemove a label from an instance\n-------------------------------\n\nTo remove a label from a Bigtable instance using the\nGoogle Cloud console:\n\n1.\n Open the list of Bigtable instances in the Google Cloud console.\n\n\n [Open the instance list](https://console.cloud.google.com/bigtable/instances)\n2. Check the box next to each instance whose labels you want to remove.\n\n3. If the **Labels** panel is not visible, click **Show info panel** in the\n upper right corner to open it.\n\n4. Click the X next to each label that you want to remove.\n\n5. Click **Save** to save your changes.\n\nWhat's next\n-----------\n\n- Learn how to [modify other properties of a Bigtable\n instance](/bigtable/docs/modifying-instance).\n- View per-instance Bigtable usage in the [Cloud Billing\n detailed export to BigQuery](/billing/docs/how-to/export-data-bigquery-tables/detailed-usage)."]]