> ## Documentation Index
> Fetch the complete documentation index at: https://midplane.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Metrics

> Your company's definitions of numbers such as MRR, so every agent gives the same answer: drafts from the schema, confirming them, changing them, and new metrics from the questions people ask.

A metric is the definition your company agreed on for a number such as MRR
or active customers, on one source. Agents are told to prefer metrics:
`find_data` or `list_metrics`, then `query_metric` by grain, date range and
dimension, so everyone gets the same number. Midplane compiles the call into
one SQL statement and runs it as the person asking, so a metric never reads
more than its asker could.

Owners and admins draft and confirm metrics; anyone in the workspace can
propose one. What a definition holds, how versions work and the time zone
are in [metric definitions](https://midplane.ai/docs/metrics/definitions.md).

## Drafts from the schema

When you first confirm a source's [review](https://midplane.ai/docs/review.md), Midplane drafts 5 to
10 core metrics from its schema and opens **Three questions**. Drafting
usually takes under a minute; meanwhile you can [connect your
agent](https://midplane.ai/docs/agents.md).

**1. Answer the three questions**

Which table holds your customers? What makes one active? Where is
revenue? Each comes with two to four answers drawn from your catalog,
such as the values of a `status` column, and **Something else:** for
your own words. Answer at least one, then select **Draft again with
these answers** once drafting has finished.

> [!WARNING]
>
> Answer before you confirm. A run with your answers replaces only the
> drafts no one has confirmed or changed.

**Skip for now** leaves them on **Metrics** for later.

**2. Check what was drafted**

**Metrics** lists the drafts, waiting ones first. Its **Drafting** card
names any draft that didn't check out against the catalog, and why.

What the model is sent is in [what the model sees](https://midplane.ai/docs/metrics/definitions.md#what-the-model-sees).

## Confirm a draft

Until a metric is confirmed, every answer that uses it says it is a draft.

**1. Check its value and trend**

The draft's page runs it as you, through your access and masks: **Value
now**, and **Last 90 days** by its grain. Check the number against one
you know, such as last month's revenue in your billing system, and read
the definition and the SQL it compiles to.

**2. Confirm it**

Select **Confirm v1** (the button names the version). It shows only
when the value and the trend came back for you. Agents use it from their
next call. For a metric that shouldn't exist, select **Discard**.

> [accordion] If several drafts wait
>
> Select **Review all 7 in a row** on **Metrics** (the number is how many
> wait). **Confirm** and **Discard** go on to the next draft, **Skip** goes
> on without a decision, and **Propose a change** keeps you in the run.

## Change a metric

Anyone can select **Propose a change** on a metric's page. The form starts
from the version you are looking at; the name and source stay, since a new
name is a new metric. Saving checks it against the catalog and adds a draft
version, and the confirmed version keeps answering until someone confirms
it. To go back, **View** an earlier version under **Versions** and propose a
change from it.

## New metrics from questions

The best metrics come from the questions people actually ask. Each way
files a draft, checked against the catalog.

| Way | Where | Who writes the definition |
| - | - | - |
| **Save as metric** on an answered `run_sql` call | [Activity](https://midplane.ai/docs/activity.md) | The drafting model, from the statement |
| **Asked again and again**: the same query answered 3 or more times in 30 days | **Metrics** | The drafting model, once you select **Save as metric** |
| Ask your agent, such as "Propose that as a metric called Active customers" | Your agent, with `propose_metric` | The agent |
| **Propose a metric** | **Metrics** | You ([the fields](https://midplane.ai/docs/metrics/definitions.md#what-a-definition-holds)) |

* **Save as metric** sends the statement as written, so any value in it,
  such as a customer's id, reaches the model too. Dates in it become the
  range a caller picks.
* From **Save as metric** or `propose_metric`, a draft named like a metric
  the source has becomes a new version of it.
* `propose_metric` never confirms a metric. It answers with a link to the
  metric's page, and proposing the same definition again adds nothing.

## Answers from a draft

An answer from a draft tells the agent to say so, and its provenance line
names the version and status:

```text theme={null}
MRR · definition v1, draft · Shop (Postgres) · 12:03 CET
```

Clients that show the chart view add **Draft definition, not confirmed**.
Once the metric is confirmed, new answers say `confirmed`. More on
[answers](https://midplane.ai/docs/answers.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.