Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

PubSub billing info for a given topic.

Hi,

How can we get billing details for pubsub grouped by topics(pubsub google resources) .
This question was asked in 2018. 
https://groups.google.com/g/cloud-pubsub-discuss/c/8-mVLtCte1c/m/h3scdxfyBQAJ
It was answered that "Billing: At the moment, GCP project is the only dimension available in billing reports for Pub/Sub. We are working to make billing labels available in the coming months.  ".

So if we have that now please help us with it.

Solved Solved
1 5 1,418
1 ACCEPTED SOLUTION

In 2018, the billing reports for Pub/Sub were only available at the GCP project level. Since then GCP introduce billing labels, which would provide a more granular level of billing detail.

Labels are key-value pairs that help you organize your Google Cloud resources. You can attach a label to each resource, then filter the resources based on their labels. Information about labels is forwarded to the billing system, so you can break down your billed charges by label​. In the context of Pub/Sub, labels are often used to organize fees for a given billing account. You can use labels to associate different Pub/Sub resources (such as topics and subscriptions) with a common cost center​.

To use labels for filtering your billing data, you can follow these steps:

  1. Open the Google Cloud Console, go to the menu, and then click Billing.
  2. Click on the filter bar at the top of the page, and in the first field, select the label key that you want to filter by.
  3. In the second field, select the operator for your filter, and enter the label values in the third field.
  4. Click Apply.

For more details see https://cloud.google.com/pubsub/docs/labels

 

 

View solution in original post

5 REPLIES 5

In 2018, the billing reports for Pub/Sub were only available at the GCP project level. Since then GCP introduce billing labels, which would provide a more granular level of billing detail.

Labels are key-value pairs that help you organize your Google Cloud resources. You can attach a label to each resource, then filter the resources based on their labels. Information about labels is forwarded to the billing system, so you can break down your billed charges by label​. In the context of Pub/Sub, labels are often used to organize fees for a given billing account. You can use labels to associate different Pub/Sub resources (such as topics and subscriptions) with a common cost center​.

To use labels for filtering your billing data, you can follow these steps:

  1. Open the Google Cloud Console, go to the menu, and then click Billing.
  2. Click on the filter bar at the top of the page, and in the first field, select the label key that you want to filter by.
  3. In the second field, select the operator for your filter, and enter the label values in the third field.
  4. Click Apply.

For more details see https://cloud.google.com/pubsub/docs/labels

 

 

Thanks @ms4446 .

@ms4446 Thanks for the detail around the subject.
I have a topic and 100s of subscribers of the topic, one subscriber for each customer on our platform. So with labels (attached to subscription), can I have the billing details for each subscription by going to billing page and filtering wit PubSub as resource ?

To get the billing details for each Pub/Sub subscription, you can leverage the functionality of labels. For more details refer to: 

https://cloud.google.com/pubsub/docs/labels

The cost of Pub/Sub has three main components: 
Throughput costs for message publishing and deliveryStorage costs for snapshots, messages retained by topics, and acknowledged messages retained by subscriptions, and Egress costs associated with throughput that crosses a Google Cloud zone or region boundary For details please refer to:  https://cloud.google.com/pubsub/pricing

In your case, you could apply a unique label to each customer's subscription. These labels are key-value pairs, with certain requirements:

  • Each resource can have multiple labels, up to a maximum of 64.
  • Each label must be a key-value pair.
  • 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.
  • Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes.
  • The key portion of a label must be unique within a single resource. However, you can use the same key with multiple resources​.

This way, by filtering by labels, you should be able to see the billing details for each subscription. Note that while you can use labels to organize fees by billing account, no additional fees are charged for the use of Pub/Sub labels​.

Thank you so much for clarifying this @ms4446 .

Regards,

Anil