Configure Cloud Monitoring

This document describes how you can configure Cloud Monitoring for your Google Cloud project. This document is intended for developers and system administrators.

To learn more about the features available in Cloud Monitoring, see Introduction to Cloud Monitoring.

Before you begin

  • If you created your Cloud project, then you have sufficient permissions to use Monitoring.
  • If you've been granted access to a project, ensure that your role has sufficient permissions to use Monitoring. For information about Identity and Access Management (IAM) roles for Monitoring, see Access control.

Metrics scopes

Monitoring lets you view and manage the metrics in the following ways:

  • For a single project
  • For multiple projects within a single organization
  • For multiple projects across multiple organizations
  • For multiple Google Cloud projects and AWS accounts

You determine which metrics you want to view by configuring a metrics scope. The metrics scope lists all projects and accounts that it monitors. A scoping project hosts a metrics scope. The scoping project stores the alerts, uptime checks, dashboards, and monitoring groups that you configure for the metrics scope. You can identify the scoping project for a metrics scope as the project selected by the Cloud Console project picker.

When you create a Google Cloud project, that project becomes a scoping project whose metrics scope is automatically set to self. For example, if you create a project Staging and then access Monitoring, then you can access the metrics stored in the project Staging. You can then configure the metrics scope of the project Staging to include other projects, and you can configure the metrics scopes of other projects to include the metrics from the project Staging.

By configuring your metrics scopes, you can view your project's metrics in isolation and with metrics stored by other projects. For example, assume that you have two projects, Staging and Production, that contain Compute Engine virtual machine (VM) instances. Assume that you have another project, AllEnvironments, that you've configured so that it can view the metrics for the Staging and Production projects. Now, there are two different ways that you can use the Google Cloud Console to view the metrics stored in theStaging project:

  • If you select the AllEnvironments project and then go to the Monitoring page, then you access the metrics scope for AllEnvironments and you can see the metrics for all three projects. The dashed line in the following diagram shows that the metrics for the Staging, Production, and AllEnvironments projects are accessible:

    Multi-view metrics scope includes all three projects selected.

  • If you select the Staging project and then go to the Monitoring page, you access the metrics scope for Staging and you can only see the metrics for that project. The dashed line in the following diagram shows that the metrics for only the Staging project are accessible:

    The metrics scope of `Staging` only includes the `Staging` project.

For more information, see View metrics for multiple projects and Manage metrics scopes with the API.

Visibility of metrics

This section describes how to identify the metrics visible to a metrics scope, and how to identify the collection of metrics scopes that can access the metrics stored in the current project.

To determine the visibility of metrics for your project, do the following:

  1. In the Google Cloud Console, select Monitoring.

    Go to Monitoring

  2. Ensure that you have selected the correct Google Cloud project.

  3. In the Monitoring navigation pane, click Expand on the Metrics scope field.

    The following screenshot shows the page that is displayed when the AllEnvironments project is selected:

    Sample of the page that lists the monitored projects.

    The table labeled Metrics monitored by this project lists the projects whose metrics are accessible to the current metrics scope. Each row in the table lists a project and that project's role:

    • Scoping project: This project stores the uptime checks, alerting policies, groups, and dashboards that you configure. There is a 1:1 relationship between a metrics scope and a scoping project. For this example, the AllEnvironments project is the scoping project.

    • Monitored project: The metrics for the Google Cloud project or AWS account are visible to the current metrics scope. For this example, the Staging and Productionprojects are monitored projects.

    The table labeled The projects listed below can view this project's metrics lists the projects whose metrics scope includes the current project. The previous screenshot shows that no other projects can access the metrics stored by the AllEnvironments project.

Change the Cloud Monitoring configuration

You can modify your project's Monitoring configuration so that you can view and monitor metrics for multiple Google Cloud projects or AWS accounts. The projects or accounts that you add to the current metrics scope are called monitored projects.

Add a project to a metrics scope

For information about how to add a Google Cloud project to a metrics scope, see the following documents:

For information about how to add an AWS account to a metrics scope, see View metrics for an AWS account.

Remove a project from a metrics scope

For information about how to remove Google Cloud projects from a metrics scope, see the following documents:

For information about how to remove AWS accounts from a metrics scope, see Remove AWS accounts from a metrics scope.

Change the current metrics scope

The project selected in the Cloud Console project picker is the scoping project of the current metrics scope. There is a 1:1 relationship between a scoping project and a metrics scope.

To select a different metrics scope, do one of the following:

  • Select a different project in the Cloud Console project picker.

  • In the Monitoring navigation pane, click Expand in the metrics scope field, and then select a project from one of the tables:

    • The table labeled Metrics monitored by this project lists the projects whose metrics are visible with the current metrics scope.
    • The table The projects listed below can view this project's metrics lists the projects whose metrics scope includes the current project.

Disable Monitoring

To disable the collection of Monitoring data in a Google Cloud project or in an AWS connector project, do the following:

  1. In the Cloud Console, select the Cloud project or the AWS connector project, and then go to the APIs & Services page:

    Go to APIs & Services

  2. Select Cloud Monitoring API.

  3. Click Disable API

View your bill

To view your bill for a project, do the following:

  1. In the Google Cloud Console, select Monitoring:

    Go to Monitoring

  2. Ensure that you have selected the correct Google Cloud project.

  3. In the Monitoring navigation pane, select Settings.

  4. In the Settings page, select Summary.

  5. Locate the Overall usage region on the page.

  6. Click View bill in the Monthly projection pane in the Overall usage region.

For each project, the following are shown:

  • The Month to date column shows the billable metrics for the current calendar month.
  • The Previous month column shows the total ingested byte count for the previous calendar month.
  • The Monthly projection column shows an estimate of the total byte count of billable metrics for the current calendar month.

For information about Monitoring costs, see Pricing for Google Cloud's operations suite. For detailed information about free and chargeable metrics, see the Monitoring section of the pricing page.

For information about the Monitoring metric used for billing, see billing/bytes_ingested.

What's next