Create and manage charts

Your dashboards can contain charts that display your metric and span data. Each chart represents a query against that data.

Using Terraform? You can use the Cloud Observability Terraform provider to create and manage your dashboards and charts. You can also use it to export existing dashboards into the Terraform format.

Before you create charts, read how Cloud Observability displays metric data to understand the different metric kinds and how your configuration choices affect how your data is displayed.

Create a chart

You create charts by querying your metric or span data. You can add multiple queries and also add formulas.

You can also add a chart to a dashboard from a notebook.

  1. From an open dashboard, click Chart. Add a chart

  2. In the Chart Builder window, click into the title to name your chart. You can rename it at anytime by clicking into the title. Enter chart name

  3. Build your query using the Unified Query Builder or in the editor using the Unified Query Language (UQL).

  4. Click Save to save your changes. The chart now displays on the dashboard.

We cap the number of time series displayed to 1,000 to avoid unnecessary noise. If your query returned more than that, note that some were omitted. If you want to view all series, you may want to omit using “group by” to reduce the cardinality.

Data retention

Data for metric queries is saved for 13 months, and is not configurable.

By default, the span data returned by a query for a dashboard chart is continuously collected and saved as a Stream. The Stream’s data and and any associated traces are retained for as long as your data retention policy.

Instead, you can choose to only display data from the Microsatellites’ retention window, (by default, the last three days of data).

If data is beyond the retention window, the chart displays hashed lines to show that data is no longer available. Beyond retention window

To control retention of a span query:

By default, span queries are retained and saved as Streams. You can unselect the Create Stream checkbox to keep the data from being retained. Retained span query

Span queries that use a group-by can’t be retained.

If you chose to not retain a span query when you created the chart, you can change it later by clicking Edit. Edit to retain a query

If you choose to retain a query and later want it to use only what is in the retention window, you can delete its underlying Stream.

When a chart uses multiple queries, each query is retained separately.

If you add a chart with a retained Stream query to a dashboard that uses global filters, the query is retained without those filters applied.

Change a chart’s display

You can change the time period that a chart reports for and for metric data, also change the type of chart to use.

Change the time range

By default, the data shown is from the last hour. You can change that to a number of different time periods using the dropdown. Use the < > controls to move backwards and forwards through time. Change the time range

If data is beyond the retention window, the chart displays hashed lines to show that data is no longer available. Beyond retention window

Changing the time window may affect the alignment of the data points and show different results.

Change the chart type

By default, line charts are used to display values. You can change the chart type using the View as dropdown. Learn more about the different visualization types.

Delete a chart

To delete a chart, use the More ( ⋮ ) icon and choose Delete. Delete a chart

Edit a chart

You access and edit a chart from the Dashboard.

  1. From the navigation bar, click Dashboards and open the dashboard your chart is on. Dashboard list view

  2. Hover over the chart, click the More ( ⋮ ) icon and select Edit (or click CTRL+e). Edit icon for a chart The chart opens in the builder where you can edit it.

Create an alert from a chart

You can create an alert from a chart, but because alerts require a specific structure, not all charts can be used to create one. If your query contains a group-by, you will not be able to create an alert (the option is disabled). For queries that don’t meet other requirements, you’ll be able to edit the query on the Alert Configuration page.

Creating an alert from a span query automatically creates a Stream.

Follow these steps to create an alert from a chart:

  1. Click Create an alert. Create an alert

    The Alert Configuration page opens in a new tab using the query from the original chart. A banner describes the edits needed to create a valid alert. Fields in violation are highlighted. Alert violations

  2. Fix the violations.

  3. By default, the title is the same as the original chart. You can change it and you can add a description, if needed.

  4. Continue creating the alert.

Add a chart to a notebook

You can add a chart to a notebook for when, during an investigation, you want to be able to run ad hoc queries, take notes, and save your analysis for use in postmortems or runbooks. Notebooks allow you to view metric and trace data from different places in Cloud Observability together, in one place. Notebook

To add to a notebook, click Add to notebook and search to choose an existing notebook or create a new notebook.

Add chart to notebook

When you add to a notebook, a chart is created using the same query. The annotation is a link back to the original, so you can quickly return to the origin of your investigation.

Add chart to notebook

Learn more about notebooks.

Investigate a deviation in the chart

When you notice a deviation in a chart and don’t want to start a notebook, use Cloud Observability’s correlation feature to investigate the deviation and find possible causes.

You can’t use the correlation feature on big number charts.

To run the correlation feature, click View correlations or click directly in the chart and select View correlations. Cloud Observability opens a side panel where you can begin your investigation.

Visit Investigate deviations for more information.

See also

Create and manage dashboards


Updated Jun 14, 2023