> For the complete documentation index, see [llms.txt](https://docs.amigo.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.amigo.ai/developer-guide/classic-api/data-access/organization-tables/metric.md).

# Metric

Schema reference for metric definitions and the evaluation results they produce.

### Metrics Table

**Table Name:** `metrics`\
**Description:** Metric definitions for evaluation and monitoring

{% tabs %}
{% tab title="Schema" %}

| Column                | Type           | Description                             |
| --------------------- | -------------- | --------------------------------------- |
| `_id`                 | string         | Metric identifier                       |
| `additional_notes`    | string         | Additional notes                        |
| `applied_to_services` | array\<string> | Associated service IDs                  |
| `created_at`          | timestamp      | Creation timestamp                      |
| `creator`             | json           | Creator information                     |
| `description`         | string         | Metric description                      |
| `is_deleted`          | boolean        | Deletion status                         |
| `metric_value`        | json           | Value definition (type, bounds)         |
| `metric_value_type`   | string         | Type of metric value                    |
| `name`                | string         | Metric name                             |
| `org_id`              | string         | Organization identifier                 |
| `region_name`         | string         | Deployment region                       |
| `tags`                | json           | Associated tags                         |
| `updated_at`          | timestamp      | Last update timestamp                   |
| `updated_by`          | json           | Last updater info `{ org_id, user_id }` |
| {% endtab %}          |                |                                         |

{% tab title="Query Example" %}

```sql
SELECT
  name,
  description,
  applied_to_services,
  metric_value
FROM metrics
WHERE is_deleted = false;
```

{% endtab %}
{% endtabs %}

### Metric Evaluation Results Table

**Table Name:** `metric_evaluation_results`\
**Description:** Results from metric evaluations

{% tabs %}
{% tab title="Schema" %}

| Column                            | Type      | Description                                                 |
| --------------------------------- | --------- | ----------------------------------------------------------- |
| `_id`                             | string    | Evaluation result ID                                        |
| `created_at`                      | timestamp | Creation timestamp                                          |
| `justification`                   | string    | Result justification                                        |
| `metric_id`                       | string    | Associated metric ID                                        |
| `metric_version_id`               | string    | Associated metric version ID                                |
| `org_id`                          | string    | Organization identifier                                     |
| `references`                      | json      | Referenced message IDs used to compute the result           |
| `region_name`                     | string    | Deployment region                                           |
| `result`                          | string    | Evaluation result (`NULL` if the metric was not applicable) |
| `run_index`                       | integer   | Run index within the unit test (simulation sources)         |
| `simulation_unit_test_set_run_id` | string    | Associated unit test set run ID (simulation sources)        |
| `source`                          | json      | Source information                                          |
| `source_type`                     | string    | Type of source                                              |
| `unit_test_id`                    | string    | Associated unit test ID (simulation sources)                |
| `updated_at`                      | timestamp | Last update timestamp                                       |
| {% endtab %}                      |           |                                                             |

{% tab title="Query Example" %}

```sql
SELECT
  metric_id,
  result,
  justification,
  source,
  created_at
FROM metric_evaluation_results
ORDER BY created_at DESC;
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.amigo.ai/developer-guide/classic-api/data-access/organization-tables/metric.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
