# Creating Dashboards

> Learn how to create custom dashboards with panels, visualization types, and query configurations in Last9

Source: https://last9.io/docs/creating-dashboards/

![Last9 Dashboard Add Panel](../../../../assets/content/docs/dashboards/dashboard-add-panel.png)

You can create dashboards in Last9 either from scratch or by promoting queries from the Logs and Traces explorers.

## Creating a Dashboard from Scratch

1. Navigate to **Dashboards** in the left sidebar
2. Click **Create Dashboard**
3. Enter a name for your dashboard
4. Click **Add Panel** to add your first visualization
5. Configure the panel query and visualization type (see below)
6. Click **Save** to save the dashboard

## Creating from Service Overview

You can add any performance chart from the [Service Overview](/docs/discover-services/) directly to a dashboard without writing a query. The underlying PromQL is extracted automatically.

![Add to Dashboard from Service Overview](../../../../assets/content/docs/dashboards/dashboards-service-overview-add-to-dashboard.png)

1. Navigate to [Discover > Services](https://app.last9.io/service-catalog) and open a service
2. On the **Overview** tab, hover over any chart panel
3. Click the **⋮** menu in the top-right corner of the panel
4. Select **Add to Dashboard**
5. Choose to add to an existing dashboard or create a new one
6. Provide a panel name and click **Save**

The following chart types are supported:

| Chart                   | Visualization added |
| ----------------------- | ------------------- |
| APDEX Score             | Time Series         |
| Response Time           | Time Series         |
| Availability            | Time Series         |
| Throughput & Error Rate | Time Series         |
| Error Distribution      | Time Series         |

:::note
The PromQL query powering each chart is extracted automatically. You can edit the query after the panel is added to the dashboard.
:::

## Creating from Logs or Traces Explorer

You can promote aggregated queries from the Logs Explorer or Traces Explorer directly into dashboard panels.

1. Build an aggregation query in the [Logs Explorer](https://app.last9.io/logs) or [Traces Explorer](https://app.last9.io/traces)
2. Click the **Add to Dashboard** button
3. Choose to create a new dashboard or add to an existing one
4. Provide a descriptive panel name
5. You will be redirected to the dashboard with your query added as a panel

For detailed instructions on building aggregation queries, see:

- [Creating Log Analytics Dashboards](/docs/creating-log-analytics-dashboards-from-logs-explorer/)
- [Creating Trace Analytics Dashboards](/docs/creating-trace-analytics-dashboards-from-traces-explorer/)

## Panels

Panels are the building blocks of a dashboard. Each panel contains a query and a visualization.

### Adding a Panel

1. Open a dashboard and click **Add Panel**
2. Choose a visualization type from the tabs at the top (Time Series, Bar Chart, Doughnut Chart, Gauge Chart, Stat, Table, Heatmap, or Status History)
3. Select a telemetry type (Metrics, Logs, or Traces)
4. Write your query using the appropriate query mode
5. Configure panel options (legend, units, thresholds)
6. Click **Save** to add the panel to your dashboard

### Visualization Types

| Type               | Description                                               | Best For                                       |
| ------------------ | --------------------------------------------------------- | ---------------------------------------------- |
| **Time Series**    | Line or area charts plotted over time                     | Monitoring trends, comparing metrics over time |
| **Bar Chart**      | Vertical or horizontal bar charts, with optional stacking | Comparing categories, distribution analysis    |
| **Doughnut Chart** | Pie/donut chart showing proportions                       | Percentage breakdowns, resource allocation     |
| **Gauge Chart**    | Dial indicator showing a single value against a range     | Utilization metrics, threshold monitoring      |
| **Stat**           | Single prominent value display                            | Key metrics at a glance, counters              |
| **Table**          | Tabular data with sorting, filtering, and summaries       | Detailed breakdowns, top-N analysis            |
| **Heatmap**        | Color-coded cells showing value density over time         | Latency distributions, spotting outliers       |
| **Status History** | Discrete state blocks per series over time                | Up/down status, pass/fail checks over time     |

### Telemetry Types and Query Modes

Each panel supports different query modes depending on the selected telemetry type:

**Metrics** panels use PromQL:

```promql
rate(http_requests_total{service="api"}[5m])
```

**Logs** panels support two modes -- **Builder** for visual query construction, and **LogQL** for writing queries directly:

```sql
sum by (severity) (count_over_time({service="api"} [1m]))
```

**Traces** panels use the **Query Builder** with filter and aggregate stages to query span data.

### Query Modes

Each query can run in one of two modes:

| Mode        | Description                                     | Use Case                          |
| ----------- | ----------------------------------------------- | --------------------------------- |
| **Range**   | Returns data points over a time range           | Timeseries, bar charts, heatmaps  |
| **Instant** | Returns a single data point at the current time | Stat panels, gauge panels, tables |

:::tip
Use [variables](/docs/using-dashboards/#variables) in your queries to make dashboards dynamic and reusable. For example, `$service` lets users switch between services without editing the query.
:::

:::note
**Stat panels show the value at the last evaluated step, not a summary across the time range.**

When a Stat panel runs in Range mode, the displayed value comes from the **final step** of the query result (usually "now" for relative time ranges). A query like `max_over_time(metric[5m])` always reflects activity in the most recent 5 minutes, no matter whether the dashboard time range is set to 1 hour or 7 days — the time range only affects the chart axis, not the value the Stat shows.

To make a Stat reflect the selected time range, aggregate against `[$__range]`:

```promql
sum(avg_over_time(my_metric[$__range]))
```

Pick the aggregator that matches what the Stat should mean: `avg_over_time` for averages, `max_over_time` for peaks, `sum_over_time` for totals. See [Built-in Variables](/docs/using-dashboards/#built-in-variables) for the full list of range and interval variables.
:::

## Panel Configuration

### Chart Settings

These options are available under **Chart Settings** when editing a panel:

- **Unit**: Set the unit format for panel values (see [Units](#units) below)
- **Legend Type**: **Auto** (uses the query name as the legend label) or **Custom** (lets you define your own legend label)
- **Legend Placement**: **Bottom**, **Left**, or **Right**
- **Display Type**: **Line** or **Area** (Time Series panels only)

### Bar Chart Options

- **Orientation**: **Vertical** or **horizontal** bars
- **Stacked**: Enable stacking to show cumulative values

### Table Settings

| Option                | Description                                                                                                                                                                |
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Transpose**         | Swap rows and columns (max 20 columns when transposed)                                                                                                                     |
| **Density**           | **Compact** or **comfortable** row spacing                                                                                                                                 |
| **Summary Footer**    | Display a summary row at the bottom                                                                                                                                        |
| **Summary Type**      | Aggregation for summary: sum, avg, min, max, first, last, count, p50, p90, p95, p99                                                                                        |
| **Thresholds**        | Color cells based on their values. Set a value, color, and target (**Text** or **Background**). Higher thresholds take precedence. Click **+ Add** for multiple thresholds |
| **Column Visibility** | Show or hide individual table columns                                                                                                                                      |

### Units

Apply unit formatting to panel values. Select from the built-in units or type a custom unit:

| Unit            | Format                               |
| --------------- | ------------------------------------ |
| Bytes (IEC)     | KiB, MiB, GiB, TiB (factors of 1024) |
| Bytes (SI)      | KB, MB, GB, TB (factors of 1000)     |
| Bytes/sec (IEC) | KiB/s, MiB/s, GiB/s                  |
| Bytes/sec (SI)  | KB/s, MB/s, GB/s                     |
| Nanoseconds     | ns precision                         |
| Milliseconds    | ms precision                         |
| Seconds         | s precision                          |

You can also enter any custom unit (e.g., `requests/s`, `%`, `ops`) by typing directly into the unit field.

## Layout

Panels can be repositioned by dragging the panel header and resized using the handles at the panel edges.

### Sections

Add **Section** dividers to organize panels into named groups. Sections act as visual separators with a label, making it easier to navigate dashboards with many panels. You can drag panels between sections and reposition sections themselves by dragging.

---

## Troubleshooting

Please get in touch with us on [Discord](https://discord.com/invite/Q3p2EEucx9) or [Email](mailto:support@last9.io) if you have any questions.
