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 dashboards, you can use the Google Cloud console, the Cloud Monitoring API, or the Google Cloud CLI.
This document describes how to create and manage your custom dashboards by using the Google Cloud console:
- For information about the API and the Google Cloud CLI, see Create and manage dashboards by API.
- For information about service-specific Google Cloud dashboards, see View Google Cloud dashboards.
About custom dashboards
Custom dashboards support a variety of widget types, so you can choose the best way to display your data. By default, dashboards display all metric data that is available to your Google Cloud project. If you configure a metrics scope, then your dashboard can display metric data for multiple Google Cloud projects.
A custom dashboard can display all of the following:
- Charts and indicators.
- Log entries from multiple Google Cloud projects or log views.
- Charts for alerting policies.
- Incidents.
- Service level objectives (SLOs).
- Text.
You can improve the load time or usability of a dashboard by grouping widgets. For example, you might add sections to a dashboard. Alternatively, you might add widgets to a container which is either expanded or collapsed.
After you create a dashboard, you can add filters, events, or labels:
Dashboard-wide filters apply to all, or some, widgets on the dashboard. These filters can be helpful when you are troubleshooting. For example, you can use these filters to display data only for a specific zone. For more information, see Add or remove filters.
Events, such as the crash of a Google Kubernetes Engine Pod, can help you correlate data from different sources when you're troubleshooting an issue. For more information, see Show events on a dashboard.
Labels can help you locate dashboards based on the type of content they display. For example, you might add the label
prod
to dashboards that display information about production systems. Similarly, you might add the labelstaging
to indicate the dashboard displays information about staging systems.When viewing your dashboards, you can select a label to filter the list to those dashboards that contain the selected label.
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 to projects, folders, and organizations.
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.
Add a custom dashboard to your project
There are different approaches that you can use to add a custom dashboard to your Google Cloud project:
- You can create a dashboard.
- You can copy, or duplicate, a dashboard.
- You can copy a dashboard from project to project.
- You can upload or install dashboards from a shared location.
- You can import a dashboard from Grafana.
For example, suppose you have multiple Google Cloud projects and you want them to define the same custom dashboard. For this situation, you might create the dashboard in one project and then copy the dashboard definition to other projects. Alternatively, you might download the dashboard definition to your local system, and then install that definition in other Google Cloud projects.
Create a new dashboard
To create a custom dashboard, do the following:
-
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
- In the Dashboards page, click Create custom dashboard.
To add widgets to your dashboard, do the following:
- In the dashboard toolbar, click add Add widget.
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 all 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 the Stacked area widget and then select the metric.
Configure the widget.
To apply your changes to the dashboard, in the toolbar, click Apply. To discard your changes, click Cancel.
After the widget is added to your dashboard, you can change the widget's configuration.
To save your modified dashboard, in the toolbar, click Save.
Optional: Add labels to your dashboard:
- In the list of dashboards, locate the dashboard and then click check_box_outline_blank Select.
- In the toolbar, click Labels, and then do one of the following:
To create a label and add it to your dashboard, in the Create a new label textbox, enter the name of the label, and then click Create and apply.
The label is created and added to your dashboard.
- To configure which labels are added to your dashboard, click arrow_drop_down Select labels to apply, select the labels, and then click Ok.
- To save your changes, click Confirm.
Copy a dashboard
When you want to experiment with different metrics or different aggregation options, you can copy a dashboard and then use the new dashboard for experimentation purposes.
To copy a dashboard, do the following:
-
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
- In the Dashboards Overview page, identify the dashboard to copy, and then click content_copy Copy dashboard.
- Optional: Update the dashboard's name.
- Click Copy in the confirmation dialog.
Copy a dashboard into another project
To copy a dashboard 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 to another Google Cloud project, do the following:
-
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
Copy the dashboard's definition into your clipboard:
- In the dashboard toolbar, click settings Settings, then JSON, and then JSON Editor.
- In the editor's toolbar, click content_copy Copy.
Paste the definition into a new dashboard created in a different project:
- Use the Google Cloud console project picker to select the project where you want to save the dashboard definition.
- Click Create custom dashboard.
- In the dashboard toolbar, click settings Settings, click JSON, and then click JSON Editor.
- Paste the content of your clipboard into the editor.
- Click Apply changes.
- To save your modified dashboard, in the toolbar, click Save.
Install a dashboard
You can upload to your Google Cloud project a custom dashboard whose definition is stored in a shared location. 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.
After you upload a dashboard definition, you can modify them to show the data you want to view.
For more information, see Install sample dashboards.
Import a dashboard from Grafana
Cloud Monitoring provides an importer that you can use to import dashboard files in the Grafana JSON format into Cloud Monitoring. For more information, see Import Grafana dashboards into Cloud Monitoring.
Find and 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 dashboard, do the following:
-
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
The My Dashboards page lists all dashboards in your Google Cloud project.
To find a dashboard, do any of the following:
Select a category. For example, to list the dashboards that are created automatically by Google Cloud based on your usage of Google Cloud services, select GCP. To further refine the list, use the Filter bar.
Select a user-defined label. For example, suppose you created a label named
Staging
and then applied that label to your dashboards that display information about your staging resources. To list these dashboards, select the label Staging. To further refine the list, use the Filter bar.Add filters to the Filter bar:
To list dashboards whose name or description contains specific text, enter that text into the Filter bar.
To list dashboards after filtering by the value of dashboard field, do the following:
Select Filter dashboards and then select a field to filter by. You can filter by the following dashboard fields: name, description, type, and user-defined label.
Either enter a value for the filter or make a selection from the menu.
To list dashboards that don't have any charts, select Filter dashboards, select Labels, and then select (Empty).
When you add multiple filters and don't include the OR operator between two filters, an
AND
operator joins the filters.
After you locate the dashboard, select it.
Modify a dashboard
After you create a dashboard, you might determine that it needs modification to be more useful to you. For example, you might want to add or remove widgets, change the layout, or change how a widget displays data. Additionally, you might want to add labels to a dashboard, either to make it easier to find or to indicate the type of content on the dashboard.
Add or remove labels
To add or remove labels, do the following:
-
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
- In the list of dashboards, locate the dashboard and then click check_box_outline_blank Select.
- In the toolbar, click Labels, and then do one of the following:
To create a label and add it to your dashboard, in the Create a new label textbox, enter the name of the label, and then click Create and apply.
The label is created and added to your dashboard.
- To configure which labels are added to your dashboard, click arrow_drop_down Select labels to apply, select the labels, and then click Ok.
- To save your changes, click Confirm.
Add or remove filters
After you create a dashboard, you can add dashboard-wide filters that apply to all, or some, widgets on the dashboard. These filters can be helpful when you are troubleshooting. For example, you can use these filters to display data only for a specific zone.
-
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
Locate and select the dashboard.
To add a dashboard-wide filter that applies only for your current session, use the dashboard's filter_list filter bar. For more information, see Temporary filters.
To add a dashboard-wide filter that is permanent, in the dashboard toolbar, go to settings Settings, and then select Manage Filters. For more information, see Permanent filters.
Modify widgets or change layout
To modify the widgets on a dashboard or the layout of the dashboard, do any of the following:
-
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
- Locate and select the dashboard.
Optional: To add a widget to your dashboard, in the dashboard toolbar, click add Add widget, then select and configure the widget. To apply your changes to the dashboard, in the toolbar, click Apply. To discard your changes, click Cancel.
For more information, see the following pages:
Optional: To modify a widget, do one of the following:
Place your pointer on the widget to activate the toolbar, click edit Edit widget, and then update the widget. 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 arrow_drop_down and select Stacked area chart from the menu. For more information, see Change a widget's type.
Click settings Settings, click JSON, and then click JSON Editor. If you modify the JSON, then you must click Apply changes.
You can also access the JSON for a widget by editing the widget, in the widgets toolbar, and then clicking code View code.
Optional: 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_vert More options, and then select Delete widget.
To apply your changes to the dashboard, in the toolbar, click Apply. To discard your changes, click Cancel.
Optional: To reposition a widget, use your pointer to drag the widget by its header to a new location. To apply your changes to the dashboard, in the toolbar, click Apply. To discard your changes, click Cancel.
You can't reposition widgets when a dashboard is in grid mode.
Optional: To resize a widget, use your pointer to reposition the right-hand corner of the widget. To apply your changes to the dashboard, in the toolbar, click Apply. To discard your changes, click Cancel.
You can't resize widgets when a dashboard is in grid mode.
To save your modified dashboard, in the toolbar, click Save.
Delete a dashboard
Deleting a dashboard that contains a chart for an alerting policy doesn't delete the alerting policies whose data was displayed on those 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 alerting policies.
To delete a custom dashboard, do the following:
-
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
- To begin the delete action, find the dashboard you want to delete and click Delete.
- In the confirmation dialog, click Delete.
- To save your modified dashboard, in the toolbar, click Save.
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:
-
In the Google Cloud console, go to the Dashboards page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
- In the dashboard toolbar, click settings Settings, click JSON, and then click JSON Editor.
To save the dashboard definition to a local system, click File Download:
The created file, which has the same name 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.
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 to share a link to a dashboard, see Share a custom dashboard.
Configure data refresh
When you open a dashboard, it is configured with auto refresh disabled. The toolbar displays a toggle,
, which indicates this state.For your current session, to enable auto refresh, go to the toolbar and select
Enable auto refresh.To disable auto refresh after you've enabled it, go to the toolbar and select
Disabled auto refresh.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 Cloud Done is displayed, your changes have been saved.