This guide introduces Stackdriver Monitoring charts. There are two ways to build charts:
- Building an ad-hoc chart using Metrics Explorer.
- Creating a chart to be added to a dashboard.
Charts created for dashboards are persistent; they become part of a set of monitoring tools. Charts built with Metrics Explorer are transient and used for investigating specific issues. The techniques for building them are the same.
The following screenshot shows a chart that displays a CPU usage metric:
As seen in this screenshot, each time series in the charted metric shows up as a colored line. Each of these is keyed by color to an entry in the legend under the chart that displays the name of each time series.
Before you begin
- To add charts to a dashboard, you must have the Cloud IAM role roles/monitoring.editor. To use Metrics Explorer, you must have the Cloud IAM role roles/monitoring.viewer. See Access Control for more information.
- For an introduction to Stackdriver metrics, see Metrics, Time Series, and Resources.
- To create your own metrics, see custom metrics and logs-based metrics.
Building a new chart with Metrics Explorer
Metrics Explorer lets you build ad-hoc charts for any metric collected by your project. You can use this to explore data you that you may not necessarily need on a dashboard. Charts built with Metrics Explorer cannot be saved to dashboards, but you can create a URL to the chart so it can be shared.
To build a new chart using Metrics Explorer:
On the Stackdriver Monitoring Console, go to the Resources > Metric Explorer page:
Select the desired Stackdriver account from the list at the top of the page:
Creating a new chart for a dashboard
To create a new chart on a dashboard, click the Add Chart button on the far right of the dashboard toolbar:
When you are done designing the chart, click the Save button to add it to the dashboard.
Whether you are creating a chart to be installed on a dashboard or building an ad-hoc chart in Metrics Explorer, the chart-definition interface is nearly identical.
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 (that is, either the Add Chart page or the Metrics Explorer page), as seen in the following screenshot, taken from the Add Chart page:
- The Metric tab is where you specify the metrics that you want to appear on the chart; this is covered in Selecting Metrics.
- The View options tab is where you specify the appearance of the chart itself; this is covered in Setting View Options.
In addition, a chart on a dashboards gets a name; this is represented by the
Untitled value in the screenshot. Charts in Metrics Explorer
do not have names; this field does not appear on the Metrics Explorer page.
See Titling charts for more information about titling
charts on dashboards.
After you have added a chart to a dashboard, you can edit it using the same interface.
Interacting with charts
Charts in Stackdriver Monitoring are dynamic constructs, not static images. There are many ways to interact with the charts, whether they are on a dashboard or built in Metrics Explorer; these are described in Working with Charts.
When adding a chart to a dashboard, you can associate a title with the chart. The user interface offers suggestions for titles, based on the metrics specified for the chart, but you can also provide your own. The following screenshot shows a user-provided title as well as a system-suggested title:
If you want to adopt the suggested title, simply click on the blue text in the
suggestion. If you change your mind, you can always replace it later.
If you had your own title and accidentally clicked on the suggestion, you can
undo it with a