Create and manage custom dashboards

This document describes how to create and manage custom dashboards by using the Google Cloud console. Custom dashboards let you display information that is of interest to you, organized in a way that's useful to you. For example, you might create a dashboard to display the logs, performance metrics, and alerting policies for virtual machines (VM) in your production environment. After you create a custom dashboard, you can also copy, modify, and share it. To create custom dashboards, you can use the Google Cloud console, the Cloud Monitoring API, or the Google Cloud CLI.

Custom dashboards support a variety of widget types, so that you can choose the best way to display your metric data. These dashboards also let you display metric data from multiple Google Cloud projects and metrics from multiple Google Cloud services. In addition to metrics, custom dashboards can display log entries from multiple Google Cloud projects and alerting policies, and you can create template variables to filter your dashboard.

This document describes how to create and manage your custom dashboards by using the Google Cloud console:

Before you begin

To get the permissions that you need to create and modify custom dashboards by using the Google Cloud console, ask your administrator to grant you the Monitoring Editor (roles/monitoring.editor) IAM role on your project. For more information about granting roles, see Manage access.

You might also be able to get the required permissions through custom roles or other predefined roles.

For more information about roles, see Control access with Identity and Access Management.

Create a dashboard

  1. In the navigation panel of the Google Cloud console, select Monitoring, and then select  Dashboards:

    Go to Dashboards

  2. In the Dashboards Overview page, click Create dashboard.
  3. To add a widget to your dashboard, in the dashboard toolbar, click  Add widget.
  4. In the Add widget pane, select a widget to add to your dashboard.

    You can select a widget based on the type of data to display or how you want to display the data. In both cases, a configuration pane is opened. For example, you can select the Metric widget and then set the visualization to Stacked area. Or, you can select Stacked area and then select the metric.

  5. Configure the selected widget.

  6. To apply your changes to the dashboard, in the toolbar, click Apply. To discard your changes, click Cancel.

After you add a widget to a dashboard, you can edit that widget. You can also change the visualization type. For example, you can convert a line chart to a stacked area chart. For more information, see Change a widget's type.

View a dashboard

Custom dashboards are displayed in the same list as the service-specific dashboards that Cloud Monitoring creates as you add resources to your Google Cloud project.

To view a custom dashboard, do the following:

  1. In the navigation panel of the Google Cloud console, select Monitoring, and then select  Dashboards:

    Go to Dashboards

  2. Optional: In the Categories pane, select the dashboard category:

    • G​C​P: List Google Cloud dashboards.
    • Integrations: List of third-party dashboards.
    • Custom: List custom dashboards.
  3. Optional: Add filters to the filter bar. When you add multiple filters and don't include the OR operator between two filters, a logical-AND joins the filters.

  4. Select the dashboard name.

For information about how to filter custom dashboards, see Filter a custom dashboard.

Modify a custom dashboard

Modify a dashboard when you want to add or remove widgets, change the layout of the dashboard widgets, change a widget's type, or change the time series shown by a widget.

To modify a custom dashboard, do the following:

  1. In the navigation panel of the Google Cloud console, select Monitoring, and then select  Dashboards:

    Go to Dashboards

  2. Modify the dashboard by doing any of the following:

    • To add a widget to your dashboard, in the dashboard toolbar, click  Add widget, then select and configure the widget. For more information, see the following pages:

    • To modify a widget, place your pointer on the widget to activate the toolbar, click  Edit widget, and then use the Configure widget dialog. To apply your changes to the dashboard, in the toolbar, click Apply. To discard your changes, click Cancel.

      You can change most settings for the widget, including the widget type. For example, to change a line chart to a stacked area chart, click Line chart and select Stacked area chart from the menu. For more information, see Change a widget's type.

    • To modify a widget or the dashboard by editing the JSON representation, in the dashboard toolbar, click Settings, click JSON, and then click JSON Editor. If you make modifications, then ensure that you click Apply changes.

      You can also access the JSON for a widget by editing the widget, in the widgets toolbar, and then clicking  View code.

    • To delete a widget, place your pointer on the widget to activate the toolbar, and then do one of the following:

      • If the toolbar of the widget displays a Delete button, then click that button.
      • Otherwise, click More options, and then select Delete.
    • To reposition a widget, use your pointer to drag the widget by its header to a new location. This option is disabled when a dashboard is in grid mode.

    • To resize a widget, use your pointer to reposition the right-hand corner of the widget. This option is disabled when a dashboard is in grid mode.

Delete a custom dashboard

Deleting a dashboard that contains alert charts doesn't delete the alerting policies whose data was displayed on those alert charts. Therefore, you might receive notifications from those policies after the dashboard is deleted. For information about how to manage your policies, which you do from the Alerting page in the Google Cloud console, see Manage policies.

To delete a custom dashboard, do the following:

  1. In the navigation panel of the Google Cloud console, select Monitoring, and then select  Dashboards:

    Go to Dashboards

  2. To begin the delete action, find the dashboard you want to delete and click Delete.
  3. In the confirmation dialog, click Delete

Duplicate a dashboard

When you want to experiment with different metrics or different aggregation options, you can duplicate a dashboard and then use the duplicate for experimentation purposes.

To duplicate a dashboard, do the following:

  1. In the navigation panel of the Google Cloud console, select Monitoring, and then select  Dashboards:

    Go to Dashboards

  2. In the Dashboards Overview page, identify the dashboard to copy, and then click Copy.
  3. Click Copy in the confirmation dialog.

Share a dashboard

When you are investigating a data anomaly, you might want another individual in your team or your organization to view the same data that you are viewing. For example, you might see an unexpected drop, or spike, in a performance metric and you want to consult with a teammate. In this scenario, you want your teammate to view the dashboard and its data.

For information about how share a link to a dashboard, see Share a custom dashboard.

Copy a dashboard definition to another project

When you have multiple Google Cloud projects and you want them to have the same custom dashboard, you can create the dashboard in one project and then copy the dashboard definition to other projects. You can also download the definition to your local system, and then share that definition with colleagues. The copy has the same layout and properties as the source dashboard; however, the data the copy displays is different.

Copy a dashboard definition to another project

To copy a dashboard definition from one project to another, your IAM role for the destination Google Cloud projects must include the Monitoring editor permission. For more information about roles, see Control access with Identity and Access Management.

To copy a dashboard definition to another Google Cloud project, do the following:

  1. In the navigation panel of the Google Cloud console, select Monitoring, and then select  Dashboards:

    Go to Dashboards

  2. Copy the dashboard definition to your clipboard:

    1. In the dashboard toolbar, click Settings, click JSON, and then click JSON Editor.
    2. In the editor's toolbar, click Copy.
  3. Paste the definition into a new dashboard created in a different project:

    1. Use the Google Cloud console project picker to select the project where you want to save the dashboard definition.
    2. Click Create dashboard.
    3. In the dashboard toolbar, click Settings, click JSON, and then click JSON Editor.
    4. Paste the content of your clipboard into the editor.
    5. Click Apply changes.

Save a dashboard definition to a local system

You might have created a custom dashboard that others in your team or organization want to install in their projects. When you want to share a dashboard definition, save it to your local system, and then move or copy the definition to a shared location. For example, you might copy the definition to a shared drive or to a source code repository like GitHub. Any individual with access to the stored location can install the dashboard into their Google Cloud projects.

To save the definition of a custom dashboard to a JSON-formatted file that is stored on your local system, do the following:

  1. In the navigation panel of the Google Cloud console, select Monitoring, and then select  Dashboards:

    Go to Dashboards

  2. In the dashboard toolbar, click Settings, click JSON, and then click JSON Editor.
  3. To save the dashboard definition to a local system, click File download:

    The created file, which has the same named as the dashboard, contains a JSON representation of the dashboard. This file only stores the definition of the dashboard, it doesn't store time-series data.

Install a dashboard definition

To use or customize a dashboard that someone else created, install that dashboard's definition in your Google Cloud project. Cloud Monitoring, for example, provides a curated set of dashboard definitions on GitHub that are specific to various Google Cloud services. The charts on these dashboards present a selection of metrics relevant to a specific service. You can install these definitions in your Google Cloud project as custom dashboards and then modify them to show the data you want to view.

For more information, see Install sample dashboards.

Configure data refresh

The dashboard toolbar displays a button that indicates whether auto refresh is enabled, , or disabled, . To change the state, click the button.

Enable automatic saving of configuration changes

By default, dashboards don't save your changes. To enable auto-save, click the Autosave toggle until it is the On position. When Cloud done is displayed, your changes have been saved.

What's next