Install sample dashboards

Cloud Monitoring provides a curated set of dashboard definitions on GitHub that are specific to a variety of Google Cloud services, for example Compute Engine, Cloud Storage, BigQuery, and others. 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 by using the Cloud Monitoring API or by using the Google Cloud console.

This page describes how to install a dashboard definition that is stored in the GitHub monitoring-dashboard-samples repository. Each definition is stored as a JSON file. This page also describes how to view the dashboard in the Google Cloud console.

Install a sample dashboard

Google Cloud console

To install a dashboard definition by using the Google Cloud console, do the following:

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

    Go to Dashboards

  2. Do one of the following:

    • To install a dashboard from the sample library, do the following:

      1. Click the Sample library tab.

        Display of the sample library tab selected.

      2. Select the dashboards that you want to install.

      3. (Optional) To view details about a dashboard or to preview its contents, click Preview.

      4. (Optional) To view the JSON representation of a dashboard, click Preview and then JSON.

      5. Click Import.

    • To install a dashboard by uploading a JSON file, do the following:

      1. (Optional) To install a curated dashboard definition, download the GitHub repository:

        git clone https://github.com/GoogleCloudPlatform/monitoring-dashboard-samples.git

      2. Click Create dashboard.

      3. In the dashboard toolbar, click  JSON Editor.

        For a new dashboard, the displayed code is similar to the following:

        {
          "category": "CUSTOM",
          "displayName": "New Dashboard",
          "mosaicLayout": {
            "columns": 12
          },
        }
        
      4. In the editor's toolbar, click File Upload.

      5. Select the file that contains the dashboard definition and then click Open.

        After the file is uploaded, the dashboard's JSON is updated.

        If you see the following message, "Unable to save dashboard: Field mosaicLayout.tiles[0] has an invalid value", then select Grid in the dashboard toolbar.

      6. (Optional) Customize the dashboard. For example, you can update the title, add a text box that indicates the dashboard source, delete unwanted charts, or add charts.

gcloud CLI

To install a dashboard definition by using the Google Cloud CLI, do the following:

  1. Ensure the dashboard definition is accessible to your local system.

    For dashboards stored in the GitHub repository, you can save specific dashboards, or you can download the entire repository:

    git clone https://github.com/GoogleCloudPlatform/monitoring-dashboard-samples.git
    
  2. Identify the dashboards you want to install.

    For example, in the GitHub repository, the directory monitoring-dashboard-samples/dashboards/compute contains a file named gce-vm-instance-monitoring.json.

  3. Issue the gcloud monitoring dashboards create command and provide the JSON representation of the dashboard.

    For example, to install the dashboard gce-vm-instance-monitoring.json, issue the following command:

    gcloud monitoring dashboards create --config-from-file=gce-vm-instance-monitoring.json
    

Cloud Monitoring API

To install a dashboard definition by using the Google Cloud CLI, do the following:

  1. Ensure the dashboard definition is accessible to your local system.

    For dashboards stored in the GitHub repository, you can save specific dashboards, or you can download the entire repository:

    git clone https://github.com/GoogleCloudPlatform/monitoring-dashboard-samples.git
    
  2. Identify the dashboards you want to install.

    For example, in the GitHub repository, the directory monitoring-dashboard-samples/dashboards/compute contains a file named gce-vm-instance-monitoring.json.

  3. Call dashboards.create and provide the JSON representation of the dashboard.

    For more information, see Managing dashboards.

View the installed dashboard

Each file in the repository creates a new custom dashboard. For example, the file gce-vm-instance-monitoring.json creates a dashboard with the title "GCE VM Instance Monitoring".

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

    Go to Dashboards

  2. Click on "GCE VM Instance Monitoring" in the list. If you have a lot of dashboards, you might want to filter for custom dashboards or for the name of the new dashboard.

The following screenshot shows the part of the installed dashboard:

Example of the Compute Engine VM Instance Monitoring dashboard.