The Cloud Pub/Sub API exports usage metrics that can be monitored programmatically or accessed via Stackdriver Monitoring. You can create dashboards, set up alerts, and set up an autoscaler to manage publisher or message processing (subscriber) instances running on Compute Engine.
Note that although Cloud Pub/Sub itself is scaled automatically, you are responsible for managing your Pub/Sub quota.
Go to Stackdriver in Google Cloud Platform Console to view Stackdriver monitoring dashboards or to define Stackdriver alerts. You can also use the Stackdriver monitoring API to query and view metrics for subscriptions and topics.
Metrics and resource types
- To see the usage metrics that Cloud Pub/Sub reports to Stackdriver, view the Metrics List in the Stackdriver documentation.
- To see the details for the
pubsub_subscriptionmonitored resource types, view Monitored Resource Types in the Stackdriver documentation.
Monitor topic or subscription quota utilization
You can use the APIs and services quotas dashboard to monitor the current utilization for a given topic or subscription.
Those metrics are:
Note that these metrics are in bytes, whereas quota is measured in kilobytes.