Vertex AI Pipelines 会自动将 vertex-ai-pipelines-run-billing-id 标签关联到您的流水线运行作业。此标签的值是您的流水线运行作业的唯一结算 ID。
Vertex AI Pipelines 会将此标签传播到流水线组件在该流水线运行作业期间生成的 Google Cloud 资源。请注意,对于某些组件和资源,您需要升级 Google Cloud 流水线组件 SDK 或更新自己的组件代码才能传播标签。如需详细了解如何为 Google Cloud 资源添加标签,请参阅 Vertex AI Pipelines 中的资源加标签功能。
vertex-ai-pipelines-run-billing-id 标签会在结算报告中关联流水线运行作业生成的 Google Cloud 资源的用量。有了此标签的值,您便可以使用将 Cloud Billing 数据导出到 BigQuery 这一功能来查看流水线运行作业中的资源使用费。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[],[],null,["# Understand pipeline run costs\n\nYou can review the cost of your pipeline runs using [Cloud Billing export to BigQuery](/billing/docs/how-to/export-data-bigquery).\n\nYou can also use the unique pipeline run billing ID of your pipeline run to review the costs of resources created by the pipeline run, as follows:\n\n1. Vertex AI Pipelines automatically attaches the `vertex-ai-pipelines-run-billing-id` label to your pipeline run. The value of this label is your unique pipeline run billing ID.\n\n2. Vertex AI Pipelines propagates this label to Google Cloud resources generated by pipeline components during the pipeline run. Note that for some components and resources, you need to either upgrade the Google Cloud Pipeline Components SDK or update your component code to propagate the labels. For more information about labeling Google Cloud resources, see [Resource labeling by Vertex AI Pipelines](/vertex-ai/docs/pipelines/gcpc-label-propagation).\n\n3. The `vertex-ai-pipelines-run-billing-id` label connects the usage of Google Cloud resources generated by the pipeline run in billing reports. Using the value of this label, you can review the cost of the resource usage in the pipeline run with [Cloud Billing export to BigQuery](/billing/docs/how-to/export-data-bigquery).\n\nThis page shows you how to do the following:\n\n- [List your ten most expensive pipeline runs](#retrieve_ten_most_expensive_pipelines)\n\n- [Use a pipeline run billing ID to locate a pipeline run](#locate_pipeline_run)\n\n- [Query the costs of Google Cloud resources in a pipeline run from Cloud Billing](#view_pipeline_resources_cost)\n\nBefore you begin\n----------------\n\nBefore you use Cloud Billing to understand the cost of a pipeline run, use the following instructions to set up your Google Cloud project and development environment:\n\n- [Set up Cloud Billing data export to BigQuery](/billing/docs/how-to/export-data-bigquery-setup).\n\n- [Install v1.0.31 or higher of the Google Cloud Pipeline Components SDK](/vertex-ai/docs/pipelines/components-quickstart#install_latest_release)\n\nFor more information about the schema of Cloud Billing standard usage cost data, see [Schema of the standard usage cost data](/billing/docs/how-to/export-data-bigquery-tables/standard-usage#usage-cost-export-more-info).\n\nList your ten most expensive pipeline runs\n------------------------------------------\n\nRun the following query to view a list of your ten most expensive pipeline runs over a specified time period:\n\n**Standard SQL** \n\n SELECT\n project.id,\n location.region,\n L.value,\n SUM(cost) AS total_cost\n FROM\n `project.dataset.gcp_billing_export_v1_XXXXXX_XXXXXX_XXXXXX` B,\n UNNEST (B.labels) L\n WHERE\n DATE(_PARTITIONTIME) \u003e= \"\u003cvar translate=\"no\"\u003eSTART_DATE\u003c/var\u003e\"\n AND DATE(_PARTITIONTIME) \u003c \"\u003cvar translate=\"no\"\u003eEND_DATE\u003c/var\u003e\"\n AND L.key = \"vertex-ai-pipelines-run-billing-id\"\n GROUP BY\n project.id,\n location.region,\n L.value\n ORDER BY\n total_cost DESC\n LIMIT\n 10;\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eSTART_DATE\u003c/var\u003e: Start date of the time period.\n\n- \u003cvar translate=\"no\"\u003eEND_DATE\u003c/var\u003e: End date of the time period.\n\nYou should see the following columns in the query results:\n\n- `project_id`\n\n- `region`\n\n- `pipeline_run_billing_id`\n\n- `total_cost`\n\nYou can now use the unique pipeline run billing ID from the `pipeline_run_billing_id` column of the query results to do the following:\n\n- [Locate or retrieve a pipeline run](#locate_pipeline_run)\n\n- [View the costs of Google Cloud resources in a pipeline run](#view_pipeline_resources_cost)\n\n| **Tip:** The query results display the pipeline runs in the descending order of the cost. The first row represents the most expensive pipeline run.\n\nUse the billing ID to locate a pipeline run\n-------------------------------------------\n\nYou can use the unique pipeline run billing ID from the query results in [List your ten most expensive pipeline runs](#retrieve_ten_most_expensive_pipelines) to locate a pipeline run. \n\n### Console\n\nUse the following instructions to retrieve a pipeline run in the Google Cloud console.\n\n1. In the Google Cloud console, in the Vertex AI section, go to the **Pipelines** page.\n\n [Go to Pipelines](https://console.cloud.google.com/vertex-ai/pipelines)\n2. To locate the pipeline run, filter the list using a unique pipeline run billing ID from the query results in [List your ten most expensive pipeline runs](#retrieve_ten_most_expensive_pipelines). To do this:\n\n 1. Click **Filter** and then click **Labels**.\n\n 2. Enter the unique pipeline run billing ID in the following format and press **Enter** : \n\n `labels.vertex-ai-pipelines-run-billing-id=`\u003cvar translate=\"no\"\u003ePIPELINE_RUN_BILLING_ID\u003c/var\u003e \n\n where \u003cvar translate=\"no\"\u003ePIPELINE_RUN_BILLING_ID\u003c/var\u003e is the unique pipeline run billing ID.\n\n### Vertex AI SDK for Python\n\nUse the following code sample to retrieve the pipeline run: \n\n runs = aip.PipelineJob.list(\n project=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003ePROJECT_ID\u003c/span\u003e\u003c/var\u003e,\n location=\u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eLOCATION\u003c/span\u003e\u003c/var\u003e,\n filter=\"labels.vertex-ai-pipelines-run-billing-id=\u003cvar translate=\"no\"\u003ePIPELINE_RUN_BILLING_ID\u003c/var\u003e\")\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e: The Google Cloud project that this pipeline runs in.\n\n- \u003cvar translate=\"no\"\u003eLOCATION\u003c/var\u003e: The region that the pipeline runs in. For more information about the regions that Vertex AI Pipelines is available in, see the [Vertex AI locations guide](/vertex-ai/docs/general/locations#feature-availability).\n\n- \u003cvar translate=\"no\"\u003ePIPELINE_RUN_BILLING_ID\u003c/var\u003e: Unique pipeline run billing ID from the query results in [List your ten most expensive pipeline runs](#retrieve_ten_most_expensive_pipelines).\n\nView the costs of Google Cloud resources in a pipeline run\n----------------------------------------------------------\n\nYou can use the unique pipeline run billing ID from the query results in [List your ten most expensive pipeline runs](#retrieve_ten_most_expensive_pipelines) to view the costs of Google Cloud resources generated by the pipeline run.\n\nRun the following query to view the list of Google Cloud resources generated in a pipeline run, along with the cost of each resource:\n\n**Standard SQL** \n\n SELECT\n service,\n sku,\n cost\n FROM\n `project.dataset.gcp_billing_export_v1_XXXXXX_XXXXXX_XXXXXX` B,\n UNNEST (B.labels) L\n WHERE\n DATE(_PARTITIONTIME) \u003e= \"\u003cvar translate=\"no\"\u003eSTART_DATE\u003c/var\u003e\"\n AND DATE(_PARTITIONTIME) \u003c \"\u003cvar translate=\"no\"\u003eEND_DATE\u003c/var\u003e\"\n AND L.key = \"vertex-ai-pipelines-run-billing-id\"\n AND L.value = \"\u003cvar translate=\"no\"\u003ePIPELINE_RUN_BILLING_ID\u003c/var\u003e\";\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eSTART_DATE\u003c/var\u003e: Start date of the time period.\n\n- \u003cvar translate=\"no\"\u003eEND_DATE\u003c/var\u003e: End date of the time period.\n\n- \u003cvar translate=\"no\"\u003ePIPELINE_RUN_BILLING_ID\u003c/var\u003e: Unique pipeline run billing ID from the query results in [List your ten most expensive pipeline runs](#retrieve_ten_most_expensive_pipelines).\n\nYou should see the following columns in the query results:\n\n- `service.id`\n\n- `service.description`\n\n- `sku.id`\n\n- `sku_description`\n\n- `cost`\n\nThe `cost` column represents the cost of a resource corresponding to the `sku.id` in the pipeline run."]]