This document describes how you can change what data is displayed on a custom dashboard—without having to modify each widget—by adding temporary groupings and temporary filters. After you add a dashboard-wide grouping or filter, the dashboard toolbar displays a menu item for that grouping or filter.
When troubleshooting, you can modify the data a dashboard displays by adding temporary groupings or filters. For example, if you are investigating an incident and want the dashboard to only display data for a specific virtual machine (VM), then add a temporary filter.
Temporary groupings and filters are automatically deleted when you reload the page; however, you can also delete them manually.
You can also make permanent filters. For example, if you pin a filter, then it behaves just like a temporary filter except that it is always available. You can also create variables, which let you apply a filter to select widgets. For more information, see Create and manage variables and pinned filters.
How dashboard filters work
A dashboard filter specifies a label and a value. The time series that the dashboard displays determine the labels available for filtering. How a widget supports a dashboard-wide filter depends on the type of data the widget displays, and the configuration of the widget:
For widgets that display time-series data, such as a line charts, the following rules apply:
If the time series displayed by the widget doesn't support the label in a filter, then the dashboard-wide filter doesn't change the displayed data.
For example, if you add a filter on the label
instance_id
, but a chart on the dashboard doesn't display data with aninstance_id
label, then the filter doesn't change the displayed data.If the widget specifies a value for a label, then the dashboard-wide filter doesn't change the displayed data.
For example, if you add a filter on the label
instance_id
, but a chart on the dashboard includes a filter based on theinstance_id
label, then the dashboard-wide filter doesn't change the displayed data.Otherwise, the chart filters the data it displays to only those time series that satisfy the dashboard-wide filter.
For logs panel widgets, dashboard-wide filters that are based on a resource label update the query. For example, if you add the dashboard-wide filter cluster_name: mycluster, then the query is updated to include resource.labels."cluster_name"="mycluster".
You can add multiple dashboard-wide filters. These filters are joined with a logical AND.
Before you begin
To get the permissions that you need to add or modify temporary filters by using the Google Cloud console,
ask your administrator to grant you the
Monitoring Viewer (roles/monitoring.viewer
) 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.
Create or modify temporary groupings
When you add dashboard-wide groupings, the widgets on the dashboard display one time series for each set of time series that have the same values for the grouping labels. By default, the average of each set is shown. However, when the widget defines a grouping function, then that function is used.
For example, assume your dashboard contains a chart that displays the CPU utilization of your VM instances. To determine whether you need to deploy more VMs to a particular zone, you could edit the dashboard and that chart to change its grouping options. An alternative is to temporarily group the dashboard by zone, and then view the CPU utilization chart.
To create or modify the temporary groupings, 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.
- Expand the arrow_drop_down Group By menu and then select the labels for grouping.
- Click OK.
When you navigate away from the dashboard, any groupings that you created are discarded.
Create a temporary filter
When you are investigating an incident, you might want to look at data in
specific ways. For example, you might want to view only time series
for a specific virtual machine or for resources in a specific region. When
you create a temporary filter, all dashboard widgets are modified to show
data that matches that filter.
For example, to configure all charts to show only time series for a specific
VM instance, create a filter based on the label instance_id
. Similarly, to
configure the dashboard to only show time series for a specific zone, create a
filter based on the label zone
.
To create a temporary filter, 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's filter_list filter bar, click Add filter, and then select a label from the menu.
The menu lists the labels for every time series shown on the dashboard.
After you select a label, a filter is added to the dashboard toolbar. The filter's name has the same name as your selection, and its value is set to
*
, which matches all values. For example, if you selectzone
, then the toolbar displayszone: *
.To select a specific value to match, click the filter, for example, click
zone: *
, and then select a value from the menu. To reduce the number of menu options, enter part of the value into the filter_list Filter area.
When you navigate away from the dashboard, any filters that you created are discarded.
Modify a temporary filter
To modify the value of a temporary filter, on that filter, click arrow_drop_down Menu, and then make a selection.
After you make a selection, charts and tables are refreshed.
Delete a temporary filter
Temporary filters are deleted automatically when you navigate away from the dashboard. To manually remove a temporary filter, on that filter, click cancel Delete.
What's next
- Explore charted data
- Access resource-specific dashboards
- Create and manage variables and pinned filters