Monitor topics within Pub/Sub Stay organized with collections Save and categorize content based on your preferences.
You can use the Google Cloud console to access the monitoring dashboardfor a single topic or all the topics available in your project.
Key Point: Learn how to access the monitoring dashboard for Pub/Subtopics, understand some key metrics, and learn how to create a custom monitoringexperience.Before you begin
Ensure that you've prepared the following:
A Cloud Billing account
A Pub/Sub project with billing enabled
At least one topic in your Pub/Sub project
Familiarity withCloud MonitoringandMetrics Explorer
View the monitoring dashboard for all topics
To view the monitoring dashboard for all the topicsin a project, perform the following steps:
In the Google Cloud console, go to the Pub/SubTopics page.
Click theMetrics tab.
The monitoring dashboard is displayed for all topics in the project.
The monitoring dashboard has two sections:Overview andQuota.
View the monitoring dashboard for a single topic
To view the monitoring dashboard for a single topicin a project, perform the following steps:
In the Google Cloud console, go to the Pub/SubTopics page.
In theTopics page, click any topic.
The topic details page is displayed.
Within the topic details page, click theMetrics tab.
The monitoring dashboard is displayed for the single topic.
The monitoring dashboard has three sections:Overview,Subscriptions,andRetention. You can see theRetention section only if youenable message retention for the topic. For more information about messageretention, seeProperties of a topic.
Customize the monitoring dashboard
You can create a custom dashboard or add individual charts to anexisting custom dashboard.
To create a custom dashboard, perform the following steps:
Follow the steps to go to the monitoring page forall topics or forasingle topic.
Choose one of the following options:
To create a new dashboard containing all the charts, or to add all thecharts to an existing custom dashboard, clickSave as custom dashboard.
To add a single chart to a new or custom dashboard, in an individual chart,expand theMore Actions option and clickAdd to custom dashboard.
You can view all your dashboards in theMonitoring console.
Modify a chart
To modify a chart, perform the following steps:
Follow the steps to go to the monitoring page forall topics or forasingle topic.
In an individual chart, expand theMore Actions option and clickView in Metrics Explorer.
The chart opens inMetrics Explorer.
You can usePrometheus Query Language (PromQL) queries to make changes to yourchart and test the output.
ClickSave chart to save the changes.
Create an alerting policy
Creating an alerting policy for a chart lets you set up an alert monitoringmetric in the chart, configure the circumstances under which you want to bealerted, and configure how you want to be notified.
For more information about how to create alerts, seeCreate metric-based alert policies.
Some charts might not offer aCreate alerting policy option.In this case, perform the following steps:
Save the chart to a custom dashboard.
In the custom dashboard, for the individual chart, expandtheMore Actions option.
ClickConvert to alert chart.
Key charts to monitor topics
Although there are a number of charts available to monitor a single topic,the following charts in theOverview section are a good starting point:
ThePublish requests chart lets you check if there are sudden spikesin the topic for receiving publish requests.
TheAverage number of messages per batch chart lets you checkif the batching size is adequate for your requirements. A smaller batch sizeleads to reduced publish latency.
The following charts in theQuota section for all topics help you monitor quotasfor all the topics in your project:
- TheAdministrator operations chart lets you monitor administrativeoperations regarding topics. Each administrator operation charges oneunit against this quota.
For more information, seePub/Sub quotas and limits.
Metrics to monitor import topics
You can use the following metrics to monitor import topics:
Ingestion byte count:This metric displays thetotal volume of data (in bytes) ingested from an import source into animport topic. It provides a breakdown of byte counts for each importsource and partition (shard).
Ingestion message count:This metric displaysthe total number of import messages for each import source and partition.
Ingestion data source state:This metricdisplays the state of the external source from which the import topic isingesting data. The error codes and their workarounds are listed in thetroubleshooting section of the import topics.For more information, see the following:
Ingestion failure count:This metric displays the number of failures encountered during ingestion.For Cloud Storage import topics, this metric includes the bucketname and the failure reason. For Amazon MSK, Azure Event Hubs, and ConfluentCloud import topics, this metric includes the Kafka topic or event hub name,the partition, and the failure reason.
To check these metrics, follow the steps described inView the monitoring dashboard for a single topic.
What's next
To monitor subscriptions,seeMonitor subscriptions in Pub/Sub.
To learn more about using PromQL to buildmonitoring charts, seeUsing the Query Editor.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-19 UTC.