Monitor topics within Pub/Sub

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:

View the monitoring dashboard for all topics

To view the monitoring dashboard for all the topicsin a project, perform the following steps:

  1. In the Google Cloud console, go to the Pub/SubTopics page.

    Go to Topics

  2. 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:

  1. In the Google Cloud console, go to the Pub/SubTopics page.

    Go to Topics

  2. In theTopics page, click any topic.

    The topic details page is displayed.

  3. 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:

  1. Follow the steps to go to the monitoring page forall topics or forasingle topic.

  2. 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:

  1. Follow the steps to go to the monitoring page forall topics or forasingle topic.

  2. In an individual chart, expand theMore Actions option and clickView in Metrics Explorer.

    The chart opens inMetrics Explorer.

  3. You can usePrometheus Query Language (PromQL) queries to make changes to yourchart and test the output.

  4. 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:

  1. Save the chart to a custom dashboard.

  2. In the custom dashboard, for the individual chart, expandtheMore Actions option.

  3. 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:

To check these metrics, follow the steps described inView the monitoring dashboard for a single topic.

What's next

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.