You can create a chart from the dashboard view or by using Metrics Explorer. Typically, Metrics Explorer is used when investigating specific issues or prototyping. However, you can save charts created in this manner to a dashboard. Charts on a dashboard are persistent and are part of a set of monitoring tools.
This page focuses on building charts from the dashboard view. If you are interested in Metrics Explorer, see Using Metrics Explorer.
Charts can display any metric type, any custom metric, and any logs-based metric provided the data type is numeric. Charts cannot graph string-type data. The following screenshot is an example of a line chart in color mode. For these charts, a unique color is assigned to each time series.
Before you begin
Ensure that you have one of the roles described in Authorization.
The process of designing a chart involves two tasks:
- Specifying the data to appear on the chart.
- Configuring the appearance of the chart.
These task are indicated by the two tabs on a chart-definition page as seen in the following screenshot:
- The Metric tab is where you specify the data that you want to appear on the chart; for an in-depth discussion, see Selecting Metrics.
- The View options tab is where you specify the appearance of the chart itself; this is described in Setting View Options.
In addition, a chart on a dashboard gets a name; this is represented by the
Chart Title value in the previous screenshot.
Adding a chart to a dashboard
To create a new chart on a dashboard, do the following:
In the Cloud Console, select Monitoring or click the following button:
In the Monitoring navigation panel, click Dashboards:
- If the dashboard exists, then double-click the name of the dashboard.
- Otherwise, click Create dashboard.
In the detail view for a dashboard, click Add Chart:
Specify the data to appear on the chart:
Ensure the Metric tab is selected.
Complete the Find resource type and metric box. You can select values from the menus, or you can enter the name.
(Optional) Select a subset of the data by using the Filter field.
(Optional) Modify the default aggregation settings. The aggregation fields define how multiple time series are combined and how each time series is processed.
- To group time series by a label, use the Group By field. Selecting a value for this field automatically selects a value for the Aggregator field.
- To specify how multiple time series are combined, set the Aggregator field.
- To configure the processing algorithm for individual time series, click Advanced Options.
For detailed information about these fields, see Selecting metrics.
(Optional) The default view option for a chart is a line chart displayed in color mode. However, you can change both of these settings:
To change the chart mode, select the View options tab, and the select from the menu. The options available are dynamically set based on the chart's display-style. For more information on your choices, see View options.
To change the display-style for a chart, click Line to expand the pull-down menu. After you make a selection, that selection is listed adjacent to the pull-down menu. For examples of all chart types, see Chart types.
(Optional) You can display multiple metrics on a single chart. If you want to display another metric, click Add Metric and repeat the previous two steps. A chart can display a maximum of 10 metrics.
(Optional) Update the Chart title. By default, the chart title is generated by your metric selections. You can change the title of a chart after it is created by selecting Edit in the chart toolbar.
You can put up to 25 charts on a dashboard.
Editing a chart
To edit the configuration of a chart, in the chart's toolbar, click Other options more_vert and select Edit.
For complete details on the chart toolbar, see Working with Charts.
The chart type defines the chart's display style, such as line, stacked bar, or stacked area. The default chart type is a line chart.
To change the display style of a chart, in the chart toolbar, select Edit, and then select the desired type from the pull-down menu that is displaying the current chart style. The default style is line.
If you choose a chart type that is incompatible with a chosen chart mode, then the chart mode reverts to color mode. For example, if you have a line chart that is being viewed in X-ray mode and then select the chart type as stacked bar, the chart mode automatically switches to color mode. For information on the chart modes, see Setting view options.
This section provides graphical examples of different chart types. The first three screenshots show the same chart using three display styles. There are two types of line charts and one bar chart. The line charts are higher resolution than the bar chart; this is due to the alignment period used. The final chart is an example of a heatmap.
Standard line chart
The following screenshot is an example of a line chart in color mode. For these charts, a unique color is assigned to each time series.
Line charts can be view in color mode, x-ray mode, stats mode, and in outlier mode.
Stacked area chart
The following screenshot is an example of a stacked area chart in color mode. For these charts, a unique color is assigned to each time series and the time series are stacked.
Stacked area charts can be viewed in color mode or outlier mode.
Stacked bar chart
The following screenshot is an example of a stacked bar chart in color mode. For these charts, a unique color is assigned to each time series and the time series are stacked.
Stacked bar charts can be viewed in color mode or outlier mode.
If you are viewing a distribution metric, then you can display the time series as a heatmap. The following image displays the request latencies for the Cloud Spanner API in one Google Cloud project:
Heatmaps can be viewed in color mode or outlier mode.
- For information on selecting metrics and aggregation, see Selecting metrics.
- For information on the display options for a chart,see Setting view options.
- For different ways you can interact with charted data, see Working with Charts.
- To read about configuring legends for your charts, see Configuring Legends.
- For detailed information on creating uptime charts, see Creating an uptime chart.