Em 15 de setembro de 2026, todos os ambientes do Cloud Composer 1 e da versão 2.0.x do Cloud Composer 2 vão atingir o fim da vida útil planejado e não poderão mais ser usados. Recomendamos planejar a migração para o Cloud Composer 3.
Nesta página, você aprenderá a atribuir identificadores aos ambientes do Cloud Composer e a dividir os custos de faturamento com base nesses identificadores.
Sobre identificadores de ambiente
Os identificadores de ambiente são pares de chave-valor que podem ser atribuídos
aos seus ambientes. Por exemplo, se owner:engineering-team for um identificador personalizado,
owner será a chave e engineering-team será o valor.
Cada ambiente pode ter vários identificadores, mas as chaves para um
único ambiente precisam ser exclusivas. É possível atribuir uma mesma chave e valor a vários
ambientes.
Identificadores de ambiente em relatórios de faturamento
Os identificadores de ambiente atribuídos aos ambientes são visíveis nos relatórios
de faturamento. Assim, é possível detalhar os custos com base nas chaves e nos valores dos
identificadores.
Os identificadores não se aplicam retroativamente. Por exemplo, se você atribuir um identificador em
15 de maio, os custos de faturamento de 14 de maio não conterão o identificador atribuído.
Atribuir identificadores a novos ambientes
É possível atribuir identificadores ao criar um ambiente. Para mais informações,
consulte Como criar ambientes.
Atribuir identificadores a ambientes atuais
Console
Acesse a página Ambientes no console Google Cloud :
Para remover todos os identificadores, inclua labels no parâmetro de consulta
updateMask e não forneça o valor de substituição.
Atualizar identificadores individuais
Para atualizar um identificador ou adicionar um novo aos identificadores atuais, inclua
labels.LABEL_KEY no parâmetro de consulta updateMask e forneça um
substituto no corpo da solicitação.
Depois que os identificadores do ambiente forem propagados para os relatórios de faturamento, será possível dividir os custos de faturamento com base nesses identificadores:
[[["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-26 UTC."],[[["\u003cp\u003eThis document explains how to use environment labels in Cloud Composer to organize and track billing costs by assigning key-value pairs to environments.\u003c/p\u003e\n"],["\u003cp\u003eLabels can be assigned to new or existing Cloud Composer environments through the Google Cloud console, \u003ccode\u003egcloud\u003c/code\u003e command-line tool, API, or Terraform, allowing for customization and organization.\u003c/p\u003e\n"],["\u003cp\u003eEnvironment labels applied to Cloud Composer environments become visible in billing reports, though it may take up to one day for them to appear, but they will be associated with costs from the moment of label assignment.\u003c/p\u003e\n"],["\u003cp\u003eLabels are not retroactive, meaning if a label is assigned on May 15, billing data from May 14 will not include this label.\u003c/p\u003e\n"],["\u003cp\u003eYou can add, remove, update labels in bulk or individually, allowing you to refine how you organize your environments.\u003c/p\u003e\n"]]],[],null,["# Manage environment labels and break down environment costs\n\n**Cloud Composer 3** \\| [Cloud Composer 2](/composer/docs/composer-2/manage-environment-labels \"View this page for Cloud Composer 2\") \\| [Cloud Composer 1](/composer/docs/composer-1/manage-environment-labels \"View this page for Cloud Composer 1\")\n\n\u003cbr /\u003e\n\n| **Note:** This page is **not yet revised for Cloud Composer 3** and displays content for Cloud Composer 2.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nThis page explains how to assign labels to your Cloud Composer environments and then break down billing costs based on these labels.\n\nAbout environment labels\n------------------------\n\nEnvironment labels are key-value pairs that you can assign to your\nenvironments. For example, if `owner:engineering-team` is a custom label, then\n`owner` is the key, and `engineering-team` is the value.\n\nEach environment can have multiple labels, but the label keys for a single\nenvironment must be unique. You can assign a same key and value to several\nenvironments.\n\nEnvironment labels in billing reports\n-------------------------------------\n\nEnvironment labels that you assign to your environments are visible in billing\nreports, so you can break down costs based on both keys and values from the\nlabels.\n| **Important:** It might take **up to 1 day** for environment labels to propagate to billing reports. However, the billing costs are labeled starting from the moment when you assigned the label to your environment.\n\nLabels don't apply retroactively. For example, if you assign a label on\nMay 15, billing costs for May 14 do not contain the assigned label.\n\nAssign labels to new environments\n---------------------------------\n\nYou can assign labels when you create an environment. For more information,\nsee [Creating environments](/composer/docs/composer-1/create-environments#other).\n\nAssign labels to existing environments\n--------------------------------------\n\n### Console\n\n1. Go to the **Environments** page in the Google Cloud console:\n\n [Go to Environments](https://console.cloud.google.com/composer/environments)\n2. Select your environment.\n\n3. Go to the **Labels** tab.\n\n4. Click **Edit** , then click **Add label**.\n\n5. Add a key-value pair for the label, then click **Save**.\n\n6. Wait until the environment updates.\n\n### gcloud\n\nWhen you update an environment using\nthe [`gcloud composer`](/sdk/gcloud/reference/composer/environments/update) command, the following arguments\nspecify labels for the environment:\n\n- `--clear-labels` removes all labels.\n\n- `--update-labels` updates specified labels; creates new labels if they\n don't already exist.\n\n- `--remove-labels` removes specified labels; specified label that do not\n exist are ignored.\n\nIf you use several of these arguments, they are applied in the following\norder: `--clear-labels`, `--update-labels`, `--remove-labels`.\n\n**Update or create labels** \n\n gcloud composer environments update \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --update-labels \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-nv\"\u003eLABEL_KEY\u003c/span\u003e\u003c/var\u003e=\u003cvar translate=\"no\"\u003eLABEL_VALUE\u003c/var\u003e\n\n**Remove specified labels** \n\n gcloud composer environments update \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --remove-labels \u003cvar translate=\"no\"\u003eLABEL_KEY\u003c/var\u003e\n\n**Remove all labels** \n\n gcloud composer environments update \u003cvar translate=\"no\"\u003eENVIRONMENT_NAME\u003c/var\u003e \\\n --location \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e \\\n --clear-labels\n\nReplace:\n\n- `ENVIRONMENT_NAME` with the name of the environment.\n- `LOCATION` with the region where the environment is located.\n- `LABEL_KEY` with the environment label key that you want to create, update, or remove.\n- `LABEL_VALUE` with the environment label value.\n\n**Example**\n\nThe following example updates the `owner` label, creates the new `env`\nlabel, and removes the `misc` label: \n\n gcloud composer environments update example-environment \\\n --location us-central1 \\\n --update-labels owner=engineering-team,env=production \\\n --remove-labels misc\n\n### API\n\nWhen you update an environment, in the [Environment](/composer/docs/reference/rest/v1/projects.locations.environments#Environment)\nresource, specify new labels of your environment.\n\n**Replace all labels**\n\nTo replace all labels, include `labels` in the `updateMask` query parameter\nand provide a replacement in the request body. \n\n // PATCH https://composer.googleapis.com/v1/\n // ?{name=projects/*/locations/*/environments/*}\n // &updateMask.fieldPaths=labels\n\n {\n \"labels\":{\n \"\u003cvar translate=\"no\"\u003eLABEL_KEY\u003c/var\u003e\": \"\u003cvar translate=\"no\"\u003eLABEL_VALUE\u003c/var\u003e\"\n }\n }\n\nReplace:\n\n- `LABEL_KEY` with a key of the environment label.\n- `LABEL_VALUE` with a new value for the environment label.\n\nExample: \n\n // PATCH https://composer.googleapis.com/v1/\n // ?{name=projects/*/locations/*/environments/*}\n // &updateMask.fieldPaths=labels\n\n {\n \"labels\": {\n \"owner\": \"engineering-team\",\n \"env\": \"production\"\n }\n }\n\n**Remove all labels**\n\nTo remove all labels, include `labels` in the `updateMask` query parameter\nand do not provide the replacement value.\n\n**Update individual labels**\n\nTo update a label or add a new label to existing labels, include\n`labels.LABEL_KEY` in the `updateMask` query parameter and provide a\nreplacement in the request body. \n\n // PATCH https://composer.googleapis.com/v1/\n // ?{name=projects/*/locations/*/environments/*}\n // &updateMask=labels.\u003cvar translate=\"no\"\u003eLABEL_KEY\u003c/var\u003e\n\n {\n \"labels\":{\n \"\u003cvar translate=\"no\"\u003eLABEL_KEY\u003c/var\u003e\": \"\u003cvar translate=\"no\"\u003eLABEL_VALUE\u003c/var\u003e\"\n }\n }\n\nReplace:\n\n- `LABEL_KEY` with a key of the environment label.\n- `LABEL_VALUE` with a new value for the environment label.\n\nExample: \n\n // PATCH https://composer.googleapis.com/v1/\n // ?name=projects/example-project/locations/\n // us-central1/environments/example-environment\n // &updateMask=labels.owner,labels.env\n\n {\n \"labels\": {\n \"owner\": \"engineering-team\",\n \"env\": \"production\"\n }\n }\n\n**Remove individual labels**\n\nTo remove labels, include `labels.LABEL_KEY` in the `updateMask` query\nparameter and do not provide the replacement value.\n\n### Terraform\n\nTo create an environment with default parameters is a specified location,\nedit the `labels` block in your Terraform configuration and run\n`terraform apply`. \n\n resource \"google_composer_environment\" \"example\" {\n name = \"example-environment\"\n region = \"us-central1\"\n\n labels = {\n \u003cvar translate=\"no\"\u003eLABEL_KEY\u003c/var\u003e = \"\u003cvar translate=\"no\"\u003eLABEL_VALUE\u003c/var\u003e\"\n }\n\n }\n\nReplace:\n\n- `LABEL_KEY` with the environment label key that you want to create or update. To remove labels, delete their fields.\n- `LABEL_VALUE` with the environment label value.\n\nExample: \n\n resource \"google_composer_environment\" \"example\" {\n name = \"example-environment\"\n region = \"us-central1\"\n\n labels = {\n owner = \"engineering-team\"\n env = \"production\"\n }\n }\n\nView labels in reports\n----------------------\n\nAfter the labels for your environment propagate to billing reports, you can break down billing costs based on these labels:\n\n1. [View Cloud Billing reports](/billing/docs/how-to/reports#getting_started) for your\n Cloud Billing account.\n\n2. On the **Reports** page:\n\n 1. Click **Show filters**.\n 2. In the **Filters** dialog, expand the **Labels** section.\n 3. [Filter the displayed data](/billing/docs/how-to/reports#filters) based on keys and values of your environment labels.\n\nWhat's next\n-----------\n\n- [Cloud Composer pricing](/composer/pricing)"]]