Installing 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.

Installing a sample dashboard

Cloud Console

To install a dashboard definition, do the following:

  1. In the Cloud Console, select Monitoring, or click the following button:

    Go to Monitoring

  2. In the Monitoring navigation pane, select Dashboards.

    From the Dashboards page, you have two different ways that you can install a dashboard:

    • You can select the dashboards that you want to install from the Sample library tab.

    • You can upload a JSON file from your local system to your project.

      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
      

To use the sample library, click Sample library on the Dashboards page:

  • To view details about a dashboard or to preview the dashboard, click Preview.
  • To view the JSON representation of the dashboard, click Preview and then click JSON.
  • To install a dashboard from the Preview page, click Import sample dashboard.
  • To install multiple dashboards, from the Sample library tab, select the dashboards that you want to install and then click Import.

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

  1. On the Dashboards page, click Create dashboard.

  2. In the dashboard toolbar, click JSON editor to open the JSON editor.

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

    {
      "category": "CUSTOM",
      "displayName": "New Dashboard - Apr 27, 2021 3:03 PM",
      "mosaicLayout": {
        "columns": 12
      },
    }
    
  3. In the editor's toolbar, click File Upload.

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

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

  5. Optional. Customize the dashboard. For example, update the title, add a text box that indicates the dashboard source, or add additional charts.

gcloud tool

To install a dashboard definition by using the gcloud command-line tool, 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 gcloud command-line tool, 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.

Viewing 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 Cloud Console, select Monitoring or click the following button:

    Go to Monitoring

  2. In the Monitoring navigation panel, click Dashboards.

  3. 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. For information on filtering this list, see Viewing custom dashboards.

The following screenshot shows the part of the installed dashboard:

Example of the Compute Engine VM Instance Monitoring dashboard.

Tutorial: versioning your dashboards

If you are interested learning how to to version-control your Cloud Monitoring dashboards by using the Cloud Monitoring API, then see the tutorial Managing Cloud Monitoring dashboards automatically using the Cloud Monitoring API.