# Metrics and dashboards

Find any metric in the Metrics Explorer, save charts as reusable visualizations, and arrange them on dashboards you filter, share and keep in Git.

Dashboards in Tracix are built from saved charts. Find a metric in the Metrics Explorer, build a chart over metrics, logs or traces as a visualization, then place visualizations on dashboards that your team filters and shares. This page covers all three.

## Explore metrics

Open **Insights › Metrics Explorer**. Every metric that reported in the time range appears as a card with a chart, its type and its unit, whether it arrived over OTLP, from a Prometheus scrape, or from an integration such as Host Metrics or Kubernetes.

* Filter with the bar, using text, `type:gauge`, `service:checkout-api`, `dataset:…`, any `attribute:value`, `-key:value` exclusions and `*` wildcards, or with the **type**, **dataset** and **service** facets.
* **Break down by dimension…** splits every card by an attribute, such as `host.name`.
* Open a card for the metric's unit, temporality, services, datasets and dimensions, a breakdown table, and the aggregation to chart.

Each metric type gets the aggregations that fit it:

| Metric type                    | Aggregations, default first |
| ------------------------------ | --------------------------- |
| Histogram                      | p99, p95, p90, p50, mean    |
| Exponential histogram, summary | mean                        |
| Counter (monotonic sum)        | rate, sum                   |
| Gauge, non-monotonic sum       | avg, max, min, last         |

To alert on a metric, open its card and select the bell, **Create monitor for this metric**. See [Monitors and templates](https://tracix.io/docs/alerting/monitors).

### Query with SQL

The **SQL** tab runs read-only SQL over the metric store: one `SELECT` or `WITH` statement, up to 2,000 rows and 30 seconds. Select **Run**, then view the result as a **Table** or a **Chart**. Queries use SQL rather than a Prometheus query language.

If your workspace has an AI model connected, type a question in **Ask in plain language…** and select **Draft SQL**. Tracix shows the query for you to review; nothing runs until you select **Run query**, or **Edit in editor** to change it first.

## Build a visualization

A visualization is a saved chart that any dashboard can use. Open **Insights › Visualizations** and select **Create visualization**.

**1. Pick the data**

Choose a source, such as **Telemetry · Metrics**, **Telemetry · Logs** or **Telemetry · Traces**, and the fields to chart.

**2. Pick the chart**

Choose a chart type: line, area, stacked area, bar, horizontal bar, stacked bar, mixed XY, table, metric, gauge, pie, donut, heatmap or treemap. Drop fields on the axes, and pick each metric's operation, such as count, sum, average, unique count, a percentile, a cumulative sum or a moving average.

**3. Save it**

Name the visualization and select **Save**. When you came from a dashboard, **Save and return** adds it to that dashboard.

You can also save charts from other places: **Save to dashboard** in the Log Explorer, and **Add to dashboard…** or **Save as visualization…** under a chart in a [Brain](https://tracix.io/docs/ai/brain) answer.

## Build a dashboard

**1. Create it**

Open **Insights › Dashboards** and select **New dashboard**. The dashboard opens in edit mode.

**2. Add panels**

Open the **Add** menu. **Visualization** builds a new chart from scratch; **From library** opens **Add from library** to pick saved visualizations. Drag panels to arrange them and drag their corners to resize them.

**3. Add filters and controls**

**Add filter** adds a filter that applies to every panel. **Add control** adds a picker for viewers: an **Options list (terms)**, a **Range slider (numeric)** or a **Time range (timestamp)**. A control can take its values from another control.

**4. Save**

Select **Save**. The first time, **Dashboard settings** asks for a title, a description, tags and who can see it.

A panel's **Drilldowns** open a URL or another dashboard from the panel, passing the time range. Viewers can type a filter in the filter bar, such as `service.name:checkout-api AND status>=500`, and step or zoom the time range. A dashboard opens on the last 15 minutes, and supports automatic refresh.

### Share a dashboard

Select **Share**. Under **Share dashboard**, choose **Private** (only you and admins) or **Team** (anyone in your workspace), with a **Minimum role** of viewer, editor or admin.

Under **Public link & embed**, the dashboard's owner or an admin can create a public link that works without signing in, expiring after 7, 30 or 90 days or never. The link is shown once, and you can revoke it at any time. Save the dashboard before you create a link.

Creating and duplicating dashboards needs the editor or admin role.

### Dashboards from integrations

Connecting an integration that ships a dashboard installs it, marked **Managed**. Tracix keeps managed dashboards up to date, so they cannot be edited: select **Duplicate** to make a copy you can change. A managed dashboard stays when you disconnect its integration.

### Dashboards as code

Dashboards and visualizations, like monitors, can be kept as code: JSON bundles in a Git repository that you validate, review as a plan and apply. Applying needs a workspace admin, and bundles can't be applied from CI yet. A dashboard managed this way is read-only in the console. See [Monitors and dashboards as code](https://tracix.io/docs/api/as-code).

> **Not yet**
>
> There is no JSON import or export for dashboards in the console. Today you can copy a dashboard with **Duplicate**, or manage it as code.

## Next steps

- [Hosts, Kubernetes and cloud](https://tracix.io/docs/observe/infrastructure): The metrics behind your infrastructure views

- [Monitors and templates](https://tracix.io/docs/alerting/monitors): Alert on the metrics you chart

- [Monitors and dashboards as code](https://tracix.io/docs/api/as-code): Keep dashboards in Git
