I’d like to add a GCP label to an AlloyDB cluster - mostly for purposes of accounting. Is this possible?
I followed a guide which used the REST API to add a label, but these labels do not show up in the detailed billing export in BigQuery.
I’d like to add a GCP label to an AlloyDB cluster - mostly for purposes of accounting. Is this possible?
I followed a guide which used the REST API to add a label, but these labels do not show up in the detailed billing export in BigQuery.
AlloyDB clusters in Google Cloud do not directly support labels for billing or organization. However, you can utilize tags, which are similar to labels, for cost allocation and reporting. Additionally, your BigQuery billing export includes resource-level labels associated with various services, which might be helpful for your accounting needs.
Here’s how you can use tags for AlloyDB clusters:
Google Cloud Console:
key:value.gcloud CLI:
gcloud resource-manager tags create command to create tags.gcloud alpha alloydb clusters update command with the --add-tags flag to add tags to your cluster.REST API:
Ensuring Tags Appear in Billing Export:
labels column in your BigQuery billing export dataset includes the relevant tags.Example Query:
SELECT
resource.name,
labels
FROM
`your_project.your_dataset.gcp_billing_export_v1_your_billing_account_id`
WHERE
service.description = 'AlloyDB for PostgreSQL'
AND labels.key = 'your_tag_key'