---
title: How to Customize Dashboard Charts
description: Add, configure, and manage Insights dashboard charts, queries, and links.
product: Insights
url: https://docs.digitalocean.com/products/insights/how-to/customize-charts/
last_updated: "2026-11-23"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# How to Customize Dashboard Charts

DigitalOcean Insights provides metrics, logs, traces, dashboards, and alerts to help you monitor, analyze, and troubleshoot supported DigitalOcean resources.

Customize dashboard charts to visualize metrics and logs, configure queries and links, and adjust chart placement using the DigitalOcean Control Panel or the dashboard’s [JSON schema](https://docs.digitalocean.com/products/insights/how-to/manage-custom-dashboards/index.html.md#edit-dashboard-schema).

Available metrics depend on the selected resource type. Metrics are currently available for Droplets, Kubernetes, Managed Databases, Load Balancers, App Platform, Functions, AI/ML products, and networking services.

To organize charts into groups, see [How to Customize Dashboard Groups](https://docs.digitalocean.com/products/insights/how-to/customize-groups/index.html.md). For guidance on chart configuration and dashboard organization, see [Dashboard Best Practices](https://docs.digitalocean.com/products/insights/concepts/dashboard-best-practices/index.html.md).

**Note**:

  You can enable available Insights telemetry when creating a supported DigitalOcean resource. The available options depend on the resource type.

  For Droplets, under the **Monitoring** section, select **Improved Metrics and monitoring (Free)** to install the DigitalOcean metrics agent (`do-agent`). For GPU Droplets created with **AI/ML Ready** images, enable GPU Observability during resource creation. The agent collects supported system and GPU metrics, but logs and traces are not currently supported.

  For supported managed resources, you can enable log and trace collection during resource creation and disable it later if needed. Insights is enabled by default for [Managed Agents](https://docs.digitalocean.com/products/managed-agents/index.html.md).

To customize a dashboard, go to the [**Dashboards**](https://cloud.digitalocean.com/insights/dashboards?utm_source=docs-agent&utm_medium=md) tab in the Control Panel, and then find and select the dashboard you want to customize. If you haven’t created one, [create a dashboard](https://docs.digitalocean.com/products/insights/how-to/manage-custom-dashboards/index.html.md#create-dashboard).

![Dashboards tab showing the dashboard list, search field, and Create dashboard button.](https://docs.digitalocean.com/screenshots/insights/dashboards.85b534a7b3f1a5e554e6518a46303532a41d3f58e63c837e95cfde5273cdbe31.png)

## Add a Chart Using the Control Panel

To add a chart to your dashboard, in the top-right corner, click **+ Add chart** to open the **Add chart** window, or [add a chart to a group](https://docs.digitalocean.com/products/insights/how-to/customize-groups/index.html.md#add-chart-to-group). As you configure the chart, on the top-left panel, the chart preview updates immediately to reflect your configurations.

**Note**:

  Each dashboard supports up to 100 charts. For more information, see [Insights Limits](https://docs.digitalocean.com/products/insights/details/limits/index.html.md).

### Set Time Range

In the top-right corner, click the **Time range** dropdown menu to select a relative range from **Last 5 minutes** to **Last 14 days**, or specify an absolute range using the **From** and **To** fields.

Use the **Timezone** dropdown menu to select the timezone for displaying metric timestamps. The default is your browser’s local timezone.

The chart editor’s time range is separate from the dashboard’s time range. When you view the dashboard, the [dashboard’s time range](https://docs.digitalocean.com/products/insights/how-to/manage-custom-dashboards/index.html.md#view-a-dashboard) applies to all of its charts.

### Choose a Name

To choose a name, on the right, in the **Name** field, enter a name that identifies the metric or resource the chart displays, such as “Production CPU Utilization”.

### Add a Description

To add a description, in the **Description** field, enter additional context about the chart, such as what it measures, which resources it includes, or how to interpret the data. For example, “Shows CPU utilization across production Droplets over the selected time range.”

Optionally, enable **Hide header** to hide the chart’s name and description. This option is disabled by default.

### Select a Chart Type

In the **Chart type** section, select how to visualize the metric:

## Time Series Chart

Time series displays how metric values change over time. Use a time series chart to identify trends, spikes, or other changes during the selected time range.

![Time Series chart configuration with line display, point settings, stacking, and Y-axis options.](https://docs.digitalocean.com/screenshots/insights/create-time-series-chart.d6162de3829c2f9234c01c0b5c2b4bd3078c42df7b1c28b2390fda8c87d56da1.png)

In the **Visual** section, customize how the chart displays data:

- Click the **Display** dropdown menu to select **Line** or **Bar**. The default is **Line**.
- In the **Line Width** field, enter the line thickness. The default is 1.25.
- Click the **Line Style** dropdown menu to select **Solid**, **Dashes**, or **Dots**. The default is **Solid**.
- In the **Area Opacity** field, enter the opacity of the area below each line. The default is 0.2.
- Click the **Show points** dropdown menu to select **Auto** or **Always**. The default is **Auto**.
- In the **Point Radius** field, enter the size of the points displayed on the line. The default is 2.75.
- Click the **Stack Series** dropdown menu to select **None** or **All**. The default is **None**.
- Enable the **Connect Nulls** toggle to connect lines across intervals with no data. This toggle is disabled by default.

In the **Y-Axis** section, enable or disable the **Show** toggle to display or hide the y-axis. This toggle is enabled by default.

When enabled, configure the y-axis using the following settings:

- In the **Label** field, enter a label that describes the values shown on the y-axis.
- Click the **Format** dropdown menu to select how values are displayed. Available formats include time, percentage, decimal, bytes, bits, throughput, currency, temperature, and date and time. The default is **Decimal**.
- Enable the **Short values** toggle to abbreviate large values.
- Click the **Decimal places** dropdown menu to select **Default** or specify between zero and four decimal places. The default is **Default**.
- Click the **Log Scale** dropdown menu to select **None**, **2**, or **10**. The default is **None**.
- In the **Min** field, enter the minimum value displayed on the y-axis. The default is **Auto**.
- In the **Max** field, enter the maximum value displayed on the y-axis. The default is **Auto**.

In the **Threshold** section, configure visual thresholds for the chart:

- Click the **Mode** dropdown menu to select **Absolute** or **Percent**. The default is **Absolute**.
- In the **Steps** sub-section, configure the threshold steps. Each step contains a threshold value and color. Click **+ Add step** to add another threshold. Then, enter the starting threshold value for the step, and then select the color used to represent it. Then, click **+ Add step** to add another step, if needed. To delete a step, click **Remove** next to it.

In the **Legend** section, enable the **Show legend** toggle to display the chart legend. This toggle is disabled by default.

When enabled, configure the legend using the following settings:

- Click the **Position** dropdown menu to select **Bottom** or **Right**. The default is **Bottom**.
- Click the **Mode** dropdown menu to select **List** or **Table**. The default is **List**.
- If you select **Table**, use the **Legend columns** field to select the values displayed in the table, such as the mean or minimum value.

In the **Query Settings** section, customize the appearance of individual queries. For each query, enable the **Use custom settings** toggle to override the chart’s default display settings. This toggle is disabled by default. If you haven’t created a query or need to add more, [configure queries](#configure-query) to select the metrics to display and define how their data is filtered, calculated, aggregated, and grouped.

When enabled, configure the following:

- Click the **Scale** dropdown menu to select **Linear** or **Logarithmic**. The default is **Linear**.
- Click the **Units** dropdown menu to select how query values are displayed. Available units include time, percent, decimal, bytes, bits, throughput, currency, temperature, and date and time. The default is **Decimal**.
- Enable the **Short values** toggle to abbreviate large values. This toggle is enabled by default.
- Click the **Decimal places** dropdown menu to select **Default** or specify between zero and four decimal places. The default is **Default**.
- Click the **Color mode** dropdown menu to select **Fixed** or **Fixed Single**. The default is **Fixed**.
- Next to **Color**, click the color to change the color used for the query.
- Click the **Line Style** dropdown menu to select **Solid**, **Dashes**, or **Dots**. The default is **Solid**.
- In the **Area Opacity** field, enter the opacity of the area below the query line. The default is 0.15.

## Stat Chart

Stat displays a single calculated value. Use a stat chart to highlight a current value or summary, such as average CPU utilization.

![Stat chart configuration with calculation, visual styles, sparkline, and legend options.](https://docs.digitalocean.com/screenshots/insights/create-stat-chart.c9d114165c408fc4fcc7b07203de506c05c61eadbfebe40246c093e6f13d6c98.png)**Note**:

  Stat charts do not support configuring query settings separately for each query.

In the **Data & Formatting** section, configure how the stat value is calculated and displayed:

- Click the **Format** dropdown menu to select how values are displayed. Available units include time, percent, decimal, bytes, bits, throughput, currency, temperature, and date and time. The default is **Decimal**.
- Click the **Decimal places** dropdown menu to select **Default** or specify between zero and four decimal places. The default is **Default**.
- Click the **Calculation** dropdown menu to select how the displayed value is calculated. The default is **Last \\**\*, which displays the most recent numeric value.

In the **Visual style** section, configure how the stat chart appears:

- Click the **Color mode** dropdown menu, and then select **None**, **Text**, or **Background**. The default is **Text**.
- Click the **Font size** dropdown menu, and then select **Auto**, **18px**, **24px**, **32px**, **48px**, or **56px**. The default is **Auto**.
- Enable **Sparkline** to display a small trend line for the metric behind the stat value. This is enabled by default.

In the **Legend** section, click the **Legend mode** dropdown menu to select **Auto**, **On**, or **Off**. The default is **Auto**, which shows the legend for multiple series only. **On** always shows it, while **Off** always hides it.

In the **Threshold** section, configure visual thresholds for the stat value:

- Click the **Mode** dropdown menu to select **Absolute** or **Percent**. The default mode is **Absolute**.
- Next to **Default color**, click the color to select the color used for values below the first configured threshold.
- In the **Steps** sub-section, configure the threshold steps. Each step contains a threshold value and color. Click **+ Add step** to add another threshold. Then, enter the starting threshold value for the step, and then select the color used to represent it. Then, click **+ Add step** to add another step, if needed. To delete a step, click **Remove** next to it.

Afterward, [configure queries](#configure-query) to select the metrics to display and define how their data is filtered, calculated, aggregated, and grouped.

## Gauge Chart

Gauge displays a value relative to a defined range or thresholds. Use a gauge to quickly determine whether a metric is within an expected range.

![Gauge chart configuration with percentage formatting, calculation, maximum value, and color thresholds.](https://docs.digitalocean.com/screenshots/insights/create-gauge-chart.f3b0156b3b94dbb0a0637b23ec25dcb39282deacff2351c6cb0597c997c43960.png)**Note**:

  Gauge charts do not support configuring query settings separately for each query.

In the **Data & Formatting** section, configure how the gauge value is calculated and displayed:

- Click the **Format** dropdown menu to select how values are displayed. Available units include time, percent, decimal, bytes, bits, throughput, currency, temperature, and date and time. The default is **Percent (0-100)**.
- Click the **Decimal places** dropdown menu to select **Default** or specify between zero and four decimal places. The default is **Default**.
- Click the **Calculation** dropdown menu to select how the displayed value is calculated. The default is **Last \\**\*, which displays the most recent numeric value.
- In the **Max Value** field, enter the maximum value represented by the gauge. The default is **Auto**.

In the **Threshold** section, configure visual thresholds for the gauge value:

- Click the **Mode** dropdown menu to select **Absolute** or **Percent**. The default mode is **Absolute**.
- Next to the **Default color**, click the color to select the color used for values below the first configured threshold.
- In the **Steps** sub-section, configure the threshold steps. Each step contains a threshold value and color. Click **+ Add step** to add another threshold. Then, enter the starting threshold value for the step, and then select the color used to represent it. Then, click **+ Add step** to add another step, if needed. To delete a step, click **Remove** next to it.

In the **Legend** section, enable the **Show legend** toggle to display the chart legend. This toggle is disabled by default.

Afterward, [configure queries](#configure-query) to select the metrics to display and define how their data is filtered, calculated, aggregated, and grouped.

## Bar Chart

Bar chart displays metric values as bars. Use a bar chart to compare values across resources or groups.

![Bar chart configuration with calculation, sorting, display mode, and orientation options.](https://docs.digitalocean.com/screenshots/insights/create-bar-chart.e5fbacc007afd3db0446b98032c985681587ab9a99322534d48333000f48e52b.png)**Note**:

  Bar charts do not support configuring query settings separately for each query.

In the **Data & Formatting** section, configure how the bar chart values are calculated and displayed:

- Click the **Format** dropdown menu to select how values are displayed. Available units include time, percent, decimal, bytes, bits, throughput, currency, temperature, and date and time. The default is **Decimal**.
- Click the **Decimal places** dropdown menu to select **Default** or specify between zero and four decimal places. The default is **Default**.
- Click the **Calculation** dropdown menu to select how the bar chart calculates values from metric data. The default is **Last**, which displays the most recent data point for each series.
- Click the **Sort** dropdown menu to select **Ascending** or **Descending**. The default is **Descending**.
- Click the **Mode** dropdown menu to select **Value** or **Percentage**. The default is **Value**.
- Click the **Orientation** dropdown menu to select **Horizontal** or **Vertical**. The default is **Horizontal**.

Afterward, [configure queries](#configure-query) to select the metrics to display and define how their data is filtered, calculated, aggregated, and grouped.

## Pie Chart

Pie chart displays metric values as portions of a whole. Use a pie chart to compare the relative proportions of values across resources or groups.

![Pie chart configuration with calculation, sorting, labels, and legend options.](https://docs.digitalocean.com/screenshots/insights/create-pie-chart.366863a398462930ba3a0e3d7aad27d58c2757fdfc056757719ca30040dae600.png)**Note**:

  Pie charts do not support configuring query settings separately for each query.

In the **Data & Formatting** section, configure how the pie chart values are calculated and displayed:

- Click the **Calculation** dropdown menu to select how the pie chart calculates values from metric data. The default is **Last**, which displays the most recent data point for each series.
- Click the **Format** dropdown menu to select how values are displayed. Available units include time, percent, decimal, bytes, bits, throughput, currency, temperature, and date and time. The default is **Decimal**.
- Enable the **Short values** toggle to abbreviate large values. This toggle is enabled by default.
- Click the **Decimal places** dropdown menu to select **Default** or specify between zero and four decimal places. The default is **Default**.
- Click the **Sort** dropdown menu to select **Ascending** or **Descending**. The default is **Descending**.
- Click the **Mode** dropdown menu to select **Value** or **Percentage**. The default is **Value**.
- Enable the **Show labels** toggle to display labels on the pie chart. This toggle is disabled by default. In the **Legend** section, enable the **Show legend** toggle to display the chart legend. This toggle is enabled by default. When enabled, configure the legend using the following settings:
- Click the **Position** dropdown menu to select **Bottom** or **Right**. The default is **Right**.
- Click the **Mode** dropdown menu to select **List** or **Table**. The default is **List**.
- If you select **Table**, use the **Legend columns** field to select the values displayed in the table, such as the mean or minimum value.

Afterward, [configure queries](#configure-query) to select the metrics to display and define how their data is filtered, calculated, aggregated, and grouped.

## Log Table

Log table displays log data in a table. Use a log table to review individual log entries and their associated fields.

![Log Table configuration with maximum log entries, filters, and selectable columns.](https://docs.digitalocean.com/screenshots/insights/create-log-table.f65406ae7683ef48bc1decbb946c57ec125ff5de7e1e4b0468e52fc3ec7cedaa.png)

In the **Limits** section, to configure how many log entries the table displays, in the **Max log entries** field, enter the maximum number of log entries to display. The default is 500, and Insights does not enforce a maximum value.

In the bottom-left, in the **Table Settings** panel, configure which log entries appear in the table and which columns are displayed.

In the **Filters** section, click **+ Filter** to configure which log entries appear in the table.

In the **Label** field, enter the field or attribute you want to filter by.

Then, click the **Operator** dropdown menu to select **=**, **in**, **>**, **>=**, **<**, or **<=**.

Then, in the **Value** field, enter the value to compare against.

After configuring your filter, click **Apply**.

Click **+ Filter** to add another filter, if needed.

To remove a filter, click the trash icon next to it. To delete all filters, click **Clear all**.

In the **Columns** section, click the checkboxes to show or hide the **Body**, **Timestamp**, and **Severity** columns.

**Note**:

  You cannot reorder the **Timestamp** column.

After configuring your log table, you can optionally [add links](#add-links) to related resources or dashboards.

## Markdown

Markdown displays formatted text on the dashboard. Use the Markdown option to add descriptions, instructions, links, or other contextual information.

![Markdown configuration with a text editor and live chart preview.](https://docs.digitalocean.com/screenshots/insights/create-markdown.b0d4a7d4f718dc283f814a3755c5ba75c35ea4dffea6b411a7321d90ddc4acd1.png)

In the bottom-left, use the **Markdown text** panel to enter content using Markdown syntax. For example:

```markdown
## CPU Utilization

Monitor CPU utilization across production resources to identify usage trends, spikes, and sustained high CPU usage.
```

For more information about Markdown syntax, see the [Markdown Guide](https://www.markdownguide.org/).

After configuring your Markdown, you can optionally [add links](#add-links) to related resources or dashboards.

### Configure a Query

For metric chart types, in the bottom-left, the **Queries** panel contains the chart’s queries. Each metric chart requires at least one query to determine which metric data to retrieve and how to filter, calculate, aggregate, and group it.

You can [configure metric queries using the dashboard’s JSON schema](#configure-query-json).

**Note**:

  Log table and Markdown do not use metric queries.

In the **Mode** section, select one of the following:

- **Visual builder** lets you construct a metric query using Control Panel fields and controls without writing PromQL.
- **PromQL** lets you write queries directly using Prometheus Query Language (PromQL) to filter, aggregate, calculate, and combine time-series metric data.

## Use Visual Builder

In the **Visual builder** tab, you can build a metric query by selecting a metric, applying filters, and configuring aggregation and grouping options.

![Chart query Visual Builder with metric selection, filters, aggregation, grouping, and PromQL preview.](https://docs.digitalocean.com/screenshots/insights/configure-chart-query-visual-builder.1b70ca4ad4b19dab04636ef00fe4a34c4b0fbaf26394885e4c6e325360c565e5.png)

In the **Metric** field, enter or select the metric you want to query. To change the selected metric, click **x** next to it, and then select another metric.

In the **Filters** section, click **+ Filter** to configure which metrics appear in the table.

In the **Label** field, enter the field or attribute you want to filter by.

Then, click the **Operator** dropdown menu to select **=**, **in**, **>**, **>=**, **<**, or **<=**.

Then, in the **Value** field, enter the value to compare against.

After configuring your filter, click **Apply**.

Click **+ Filter** to add another filter, if needed.

To remove a filter, click the trash icon next to it. To delete all filters, click **Clear all**.

In the **Calculate over** section, select the time window used for the calculation: **1m**, **2m**, **5m**, or **10m**. The default is **5m**.

In the **Aggregate as** section, select either **None**, **sum**, **avg**, **min**, or **max**. The default is **sum**.

In the **Group by** section, click **+ Group by**, and then enter or select a label, such as `__resource_type__`.

Click **+ Group by** to add another label, if needed.

To remove a label, click **x** next to it. To remove all groups, click **Clear all**.

In the **Legend** field, enter the text displayed for the query in the chart legend and tooltip. Use `{{label_name}}` to interpolate label values. For example, `{{__resource_type__}}`.

The **PromQL Preview** field displays the PromQL generated from your Visual builder configuration. This field is read-only. For example:

```promql
avg by ("resource.urn") (
  avg_over_time({
    __name__="do.droplets.cpu_utilization"
  }[5m])
)
```

## Use PromQL

Use the **PromQL** tab when you want to write the metric query directly.

![Chart query editor in PromQL mode with a query field and legend configuration.](https://docs.digitalocean.com/screenshots/insights/configure-chart-query-promql.2a7445e2d3bbdeaca8e09a032a5df2c9e8427d5b590a1e8bd94cbf84235404e2.png)

In the **PromQL** field, enter a valid PromQL expression. For information about PromQL syntax and query expressions, see the [Prometheus querying documentation](https://prometheus.io/docs/prometheus/latest/querying/basics/).

In the **Legend** field, enter the text displayed for the query in the chart legend and tooltip. Use `{{label_name}}` to interpolate label values. For example, `{{__resource_type__}}`.

To add another query, at the top of the **Queries** panel, click **+** next to the existing query tabs.

To manage the chart’s queries, in the bottom-left corner, you can add new queries, configure existing queries, or remove queries you no longer need:

- Click **Clone query** to create a copy of the current query. Use this when you want to create a similar query and modify only some of its settings.
- Click **Delete query** to remove the selected query.

### Add Links

At bottom of the right panel, in the **Links** section, add links to related resources, dashboards, or other destinations.

Alternatively, you can [add chart links using the dashboard’s JSON schema](#add-links-json).

![Chart Links settings with URL, name, tooltip, and options to open in a new tab or render variables.](https://docs.digitalocean.com/screenshots/insights/configure-chart-links.54d8eb3ec469c0715722afa9d647444a6b49daacd6a07b701f46f601adae170c.png)

To add a link, click **+ Add link**, and then in the **URL** field, enter the destination URL, such as `https://cloud.digitalocean.com/droplets`.

In the **Name (optional)** field, enter a descriptive name for the link, such as “View Droplets”.

In the **Tooltip (optional)** field, enter the text displayed when users hover over the link, such as “View and manage your Droplets in the Control Panel”.

Then, select the **Open in new tab** checkbox if you want to open the destination in a new browser tab.

Then, select the **Render variables in URL** checkbox if you want to replace variables in the URL with their current dashboard values.

Click **+ Add link** to add another link, if needed.

If needed, click **Remove link** to delete the link.

### Finalize

After creating a chart, click **Add chart**, and then [manage your chart](#manage-chart), if needed.

After organizing the chart within its group, in the top-right, click **Save**. If the dashboard contains chart groups, new charts appear in the first group at the top of the dashboard by default.

## Manage a Chart Using the Control Panel

To manage a chart, find it in the dashboard, and then use the icons on the right to perform the following actions:

- Click the expand icon to view the full chart.
- Click the pencil icon to [edit the chart’s configuration](#add-a-chart).
- Click the copy icon to duplicate the chart.
- Click the trash icon to delete the chart.
- Click the drag icon to reposition the chart within the dashboard.

**Note**:

  You cannot drag charts between groups in the Control Panel. To move a chart, delete it from its current group and [recreate it in the new group](https://docs.digitalocean.com/products/insights/how-to/customize-groups/index.html.md#add-chart-to-group), or [move its layout reference using JSON](#manage-chart-json).

## Add a Chart via JSON Schema

You can add a chart by defining it in `spec.panels` and adding a corresponding layout reference in `spec.layouts`.

To access the schema, [open the dashboard’s JSON settings](https://docs.digitalocean.com/products/insights/how-to/manage-custom-dashboards/index.html.md#edit-dashboard-schema).

In the JSON editor, locate the `spec.panels` object and add a chart definition with a unique identifier. The following examples show the configuration for each available chart type.

### Time Series Chart

The following example displays CPU utilization over time.

```json
{
  "droplet-cpu-trend": {
    "kind": "Panel",
    "spec": {
      "display": {
        "name": "CPU Utilization"
      },
      "plugin": {
        "kind": "TimeSeriesChart",
        "spec": {
          "yAxis": {
            "label": "%",
            "format": {
              "unit": "percent",
              "decimalPlaces": 1
            }
          }
        }
      },
      "queries": [
        {
          "kind": "TimeSeriesQuery",
          "spec": {
            "plugin": {
              "kind": "MetricsTimeSeriesQuery",
              "spec": {
                "kind": "gauge",
                "filters": [],
                "groupBy": [],
                "metricName": "do.droplets.cpu_utilization",
                "aggregateAs": "avg",
                "seriesNameFormat": "CPU Utilization"
              }
            }
          }
        }
      ]
    }
  }
}
```

### Stat Chart

The following example displays the latest CPU utilization as a single value.

```json
{
  "droplet-cpu-stat": {
    "kind": "Panel",
    "spec": {
      "display": {
        "name": "CPU Utilization"
      },
      "plugin": {
        "kind": "StatChart",
        "spec": {
          "format": {
            "unit": "percent",
            "decimalPlaces": 1
          },
          "calculation": "last-number",
          "colorMode": "none",
          "sparkline": {
            "color": "#2a78d6",
            "width": 2
          }
        }
      },
      "queries": [
        {
          "kind": "TimeSeriesQuery",
          "spec": {
            "plugin": {
              "kind": "MetricsTimeSeriesQuery",
              "spec": {
                "kind": "gauge",
                "filters": [],
                "groupBy": [],
                "metricName": "do.droplets.cpu_utilization",
                "aggregateAs": "avg",
                "seriesNameFormat": "CPU Utilization"
              }
            }
          }
        }
      ]
    }
  }
}
```

### Gauge Chart

The following example displays CPU utilization as a gauge with thresholds at 70% and 90%.

```json
{
  "droplet-cpu-gauge": {
    "kind": "Panel",
    "spec": {
      "display": {
        "name": "CPU Utilization"
      },
      "plugin": {
        "kind": "GaugeChart",
        "spec": {
          "calculation": "last-number",
          "format": {
            "unit": "percent"
          },
          "thresholds": {
            "defaultColor": "#22c55e",
            "steps": [
              {
                "value": 0,
                "color": "#22c55e"
              },
              {
                "value": 70,
                "color": "#f59e0b"
              },
              {
                "value": 90,
                "color": "#ef4444"
              }
            ]
          }
        }
      },
      "queries": [
        {
          "kind": "TimeSeriesQuery",
          "spec": {
            "plugin": {
              "kind": "MetricsTimeSeriesQuery",
              "spec": {
                "metricName": "do.droplets.cpu_utilization",
                "kind": "gauge",
                "aggregateAs": "avg",
                "filters": [],
                "groupBy": [],
                "seriesNameFormat": "CPU Utilization"
              }
            }
          }
        }
      ]
    }
  }
}
```

The `calculation` field determines which value the gauge displays. The `format` field specifies how the value is formatted, while `thresholds` defines the colors applied at different values.

### Bar Chart

The following example compares CPU utilization across Droplets.

```json
{
  "droplet-cpu-bar": {
    "kind": "Panel",
    "spec": {
      "display": {
        "name": "CPU Utilization by Droplet"
      },
      "plugin": {
        "kind": "BarChart",
        "spec": {
          "calculation": "last",
          "format": {
            "unit": "percent",
            "decimalPlaces": 1
          },
          "sort": "desc",
          "mode": "value",
          "orientation": "horizontal",
          "groupBy": [],
          "isStacked": false
        }
      },
      "queries": [
        {
          "kind": "TimeSeriesQuery",
          "spec": {
            "plugin": {
              "kind": "MetricsTimeSeriesQuery",
              "spec": {
                "metricName": "do.droplets.cpu_utilization",
                "kind": "gauge",
                "aggregateAs": "avg",
                "filters": [],
                "groupBy": [
                  "resource.urn"
                ],
                "seriesNameFormat": "{{resource.urn}}"
              }
            }
          }
        }
      ]
    }
  }
}
```

The chart configuration supports the following settings:

- `calculation` specifies how the displayed value is calculated.
- `format` specifies the value format and whether large values are abbreviated.
- `sort` specifies the order of the bars.
- `mode` specifies whether bars display values or percentages.
- `orientation` specifies whether the bars are horizontal or vertical.
- `groupBy` configures chart-level grouping.
- `isStacked` specifies whether bar values are stacked.

### Pie Chart

The following example displays CPU utilization across Droplets as portions of a pie chart.

```json
{
  "droplet-cpu-pie": {
    "kind": "Panel",
    "spec": {
      "display": {
        "name": "CPU Utilization by Droplet"
      },
      "plugin": {
        "kind": "PieChart",
        "spec": {
          "calculation": "last",
          "format": {
            "unit": "percent",
            "decimalPlaces": 1
          },
          "mode": "value",
          "sort": "desc",
          "showLabels": false,
          "legend": {
            "position": "right",
            "mode": "list"
          }
        }
      },
      "queries": [
        {
          "kind": "TimeSeriesQuery",
          "spec": {
            "plugin": {
              "kind": "MetricsTimeSeriesQuery",
              "spec": {
                "metricName": "do.droplets.cpu_utilization",
                "kind": "gauge",
                "aggregateAs": "avg",
                "filters": [],
                "groupBy": [
                  "resource.urn"
                ],
                "seriesNameFormat": "{{resource.urn}}"
              }
            }
          }
        }
      ]
    }
  }
}
```

The chart configuration supports the following settings:

- `calculation` specifies how the displayed value is calculated.
- `format` specifies the value format.
- `mode` specifies whether the chart displays values or percentages.
- `sort` specifies the order of the slices.
- `showLabels` controls whether labels appear on the slices.
- `legend.position` specifies the legend’s position.
- `legend.mode` specifies how the legend is displayed.

### Log Table

The following example displays application logs related to high CPU utilization in the production environment.

**Note**:

  This example assumes your application sends structured logs with `environment` and `event_type` attributes. CPU utilization metrics do not automatically generate corresponding log entries.

```json
{
  "cpu-utilization-logs": {
    "kind": "Panel",
    "spec": {
      "display": {
        "name": "High CPU Utilization Logs"
      },
      "plugin": {
        "kind": "LogTable",
        "spec": {
          "activeColumns": [
            {
              "value": "timestamp",
              "label": "Timestamp"
            },
            {
              "value": "severity_text",
              "label": "Severity"
            },
            {
              "value": "body",
              "label": "Body"
            }
          ],
          "filters": [
            {
              "key": "attributes:environment",
              "operator": "$eq",
              "value": "production"
            },
            {
              "key": "attributes:event_type",
              "operator": "$eq",
              "value": "high_cpu_utilization"
            }
          ],
          "maxLogEntries": 500
        }
      }
    }
  }
}
```

The configuration defines the following:

- `activeColumns` specifies which log fields appear as columns.
- `filters` contains the conditions used to filter log entries. Each filter specifies an attribute, operator, and value.
- `maxLogEntries` specifies the maximum number of entries displayed in the table.

**Note**:

  Log tables do not use metric queries. Configure their filtering directly in `spec.plugin.spec.filters`.

### Markdown

The following example adds Markdown containing a heading and description for monitoring CPU utilization across production Droplets.

```json
{
  "cpu-utilization-notes": {
    "kind": "Panel",
    "spec": {
      "display": {
        "name": "CPU Utilization Notes"
      },
      "plugin": {
        "kind": "Markdown",
        "spec": {
          "text": "## CPU Utilization\n\nMonitor CPU utilization across production Droplets to identify usage trends, spikes, and sustained high CPU usage."
        }
      }
    }
  }
}
```

Use `spec.plugin.spec.text` to define the Markdown content. Use `\n` to insert line breaks.

**Note**:

  Markdown does not use metric queries.

Add the selected chart definition to the existing `spec.panels` object without replacing any existing panels. Each panel must have a unique identifier.

Next, locate the group in `spec.layouts` where you want the chart to appear.

Add an entry to its `spec.items` array that references the new panel. For example:

```json
{
  "x": 0,
  "y": 0,
  "width": 6,
  "height": 5,
  "content": {
    "$ref": "#/spec/panels/droplet-cpu-trend"
  }
}
```

The layout entry defines the following:

- `x` and `y` specify the chart’s position in the grid.
- `width` and `height` specify the chart’s dimensions.
- `content.$ref` references the chart definition in `spec.panels`.

Replace `droplet-cpu-trend` with the identifier of the chart you added. The identifier in `content.$ref` must match the corresponding key in `spec.panels`.

Adjust the chart’s position and dimensions to fit the group without overlapping other charts.

After configuring the chart, click **Apply**.

To save your changes, in the top-right corner, click **x** to close the settings page, then in the top-right corner of the dashboard, click **Save**.

### Configure a Query via JSON Schema

You can configure the metric data displayed in a chart by modifying its queries in the dashboard’s JSON schema. Queries define which metrics to retrieve, how to filter and aggregate their values, and how to group the results.

To access the schema, [open the dashboard’s JSON settings](https://docs.digitalocean.com/products/insights/how-to/manage-custom-dashboards/index.html.md#edit-dashboard-schema).

In the JSON editor, locate the chart in `spec.panels`, and then find its `spec.queries` array. Each metric chart requires at least one query. You can add multiple query objects to display or compare different metric series.

You can configure queries using metric query settings or PromQL expressions.

### Metric Query

The following example queries Droplet CPU utilization, excludes a specific Droplet, and groups the results by resource to compare CPU utilization across the remaining Droplets.

```json
{
  "kind": "TimeSeriesQuery",
  "spec": {
    "plugin": {
      "kind": "MetricsTimeSeriesQuery",
      "spec": {
        "metricName": "do.droplets.cpu_utilization",
        "kind": "gauge",
        "aggregateAs": "avg",
        "filters": [
          {
            "key": "resource.urn",
            "namespace": "attributes",
            "operator": "!=",
            "value": "do:droplet:123456789"
          }
        ],
        "groupBy": [
          "resource.urn"
        ],
        "seriesNameFormat": "{{resource.urn}}"
      }
    }
  }
}
```

The query configuration contains the following fields:

- `metricName` specifies the metric to retrieve.
- `kind` identifies the metric type, such as `gauge` or `counter`.
- `aggregateAs` specifies how values are aggregated, such as `sum`, `avg`, `min`, or `max`.
- `filters` contains the conditions used to narrow the metric data. Each filter specifies an attribute, operator, and value.
- `groupBy` specifies the attributes used to group the results.
- `calculateOver` specifies the time window used for calculations.
- `seriesNameFormat` specifies the name displayed for the resulting metric series. You can reference attribute values using expressions such as `{{resource.urn}}`.

### PromQL Query

The following example uses Prometheus Query Language (PromQL) to calculate average CPU utilization for each Droplet over a five-minute interval.

```json
{
  "kind": "TimeSeriesQuery",
  "spec": {
    "plugin": {
      "kind": "PrometheusTimeSeriesQuery",
      "spec": {
        "query": "avg by (\"resource.urn\")(avg_over_time({__name__=\"do.droplets.cpu_utilization\"}[5m]))"
      }
    }
  }
}
```

Use `spec.plugin.spec.query` to enter a valid PromQL expression. For information about supported query syntax, see the [Prometheus querying documentation](https://prometheus.io/docs/prometheus/latest/querying/basics/).

To add another metric query, add another query object to the chart’s `spec.queries` array. To modify an existing query, update its plugin configuration. To remove a query, delete its object from the array.

After configuring your queries, click **Apply**.

To save your changes, in the top-right corner, click **x** to close the settings page, then in the top-right corner of the dashboard, click **Save**.

### Add Links via JSON Schema

You can add links to a chart through the dashboard’s JSON schema. Links let you navigate to related resources, dashboards, or external destinations.

To access the schema, [open the dashboard’s JSON settings](https://docs.digitalocean.com/products/insights/how-to/manage-custom-dashboards/index.html.md#edit-dashboard-schema).

In the JSON editor, locate the chart in `spec.panels`, and then add or modify the `spec.links` array.

For example, the following configuration adds a link to the **Metrics** tab in DigitalOcean Insights, where you can explore Droplet CPU utilization:

```json
{
  "links": [
    {
      "url": "https://cloud.digitalocean.com/insights/metrics",
      "name": "View CPU Utilization Metrics",
      "tooltip": "Explore Droplet CPU utilization in Insights",
      "renderVariables": false,
      "targetBlank": true
    }
  ]
}
```

The configuration defines the following:

- `url` specifies the destination URL.
- `name` specifies the link’s display name.
- `tooltip` specifies the text displayed when hovering over the link.
- `renderVariables` determines whether dashboard variables are replaced with their current values in the URL. Set to `true` to enable variable substitution or `false` to use the URL as written.
- `targetBlank` determines whether the link opens in a new browser tab. Set to `true` to open a new tab or `false` to open the link in the current tab.

To add multiple links, add another object to the `spec.links` array. To remove a link, delete the corresponding object.

After configuring your links, click **Apply**.

To save your changes, in the top-right corner, click **x** to close the settings page, then in the top-right corner of the dashboard, click **Save**.

## Manage a Chart via JSON Schema

You can modify a chart’s display settings, visualization, metric queries, and position by editing its JSON configuration.

To access the schema, [open the dashboard’s JSON settings](https://docs.digitalocean.com/products/insights/how-to/manage-custom-dashboards/index.html.md#edit-dashboard-schema).

In the JSON editor, locate the chart definition in `spec.panels`. Each chart has a unique identifier that is referenced by an entry in `spec.layouts`.

You can update the following fields:

- **Name and description:** Edit `spec.display.name` and `spec.display.description`.
- **Visualization:** Edit `spec.plugin.kind` to change the chart type and update `spec.plugin.spec` with the corresponding visualization settings.
- **Metric queries:** Edit `spec.queries` to change the metrics, filters, grouping, and aggregation settings.
- **Position and dimensions:** Update the chart’s `x`, `y`, `width`, and `height` fields in its layout entry.
- **Group:** Move the chart’s layout entry to another group’s `spec.items` array. Keep the same `content.$ref` value to reuse the existing panel definition.

For example, a chart using the `MetricsTimeSeriesQuery` plugin can specify Droplet CPU utilization and its aggregation settings:

```json
{
  "kind": "gauge",
  "filters": [],
  "groupBy": [],
  "metricName": "do.droplets.cpu_utilization",
  "aggregateAs": "avg",
  "seriesNameFormat": "CPU Utilization"
}
```

To change the metric displayed, update `metricName`. To change how the metric values are aggregated, update `aggregateAs`. The available query settings depend on the query plugin.

To remove a chart, delete its entry from the corresponding group’s `spec.items` array. Then, remove its definition from `spec.panels` if no other layout references it.

After editing the schema, click **Apply**. To save your changes, close the settings page, then in the top-right corner of the dashboard, click **Save**.