> For the complete documentation index, see [llms.txt](https://docs.dbnl.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dbnl.com/v0.26.x/workflow/metrics.md).

# Metrics

A Metric is a mapping from [Columns](/v0.26.x/configuration/data-pipeline.md#columns) into meaningful numeric values representing cost, quality, performance, or other behavioral characteristics. Metrics are computed for every ingested log or trace as part of the [DBNL Data Pipeline](/v0.26.x/configuration/data-pipeline.md) and show up in the [Logs](/v0.26.x/workflow/logs.md) view, [Explorer](/v0.26.x/workflow/explorer.md) pages, and [Metrics Dashboard](/v0.26.x/workflow/dashboards.md#metrics-dashboard).

DBNL comes with many built in metrics and templates that can be customized. Fundamentally, Metrics are one of two types:

* [**LLM-as-judge Metrics**](#llm-as-judge-metrics): Evals and judges that require an LLM to compute a score or classification based on a prompt.
* [**Standard Metrics**](#standard-metrics): Functions that can be computed using non-LLM methods like traditional Natural Language Processing (NLP) metrics, statistical operations, and other common mapping [functions](/v0.26.x/reference/query-language/functions.md).

### Default Metrics

Every product contains the following metrics by default, computed using the required `input` and `output` fields of the [DBNL Semantic Convention](/v0.26.x/configuration/dbnl-semantic-convention.md) and the default [Model Connection](/v0.26.x/configuration/model-connections.md) for the [Project](/v0.26.x/workflow/projects.md):

* `answer_relevancy`: Determines if the `input` is relevant to the `output`. See [template](/v0.26.x/workflow/metrics/llm-as-judge-metric-templates.md#llm_answer_relevancy).
* `user_frustration`: Assesses the level of frustration of the `input` based on tone, word choice, and other properties. See [template](/v0.26.x/workflow/metrics/llm-as-judge-metric-templates.md#llm_text_frustration).
* `topic`: Classifies the conversation into a topic based on the `input` and `output`. This Metric is created after topics are automatically generated from the first 7 days of ingested data. Topics can be manually adjusted by editing the [template](/v0.26.x/workflow/metrics/llm-as-judge-metric-templates.md#topic).
* `conversation_summary` (immutable): A summary of the `input` and `output`, used as part of `topic` generation.
* `summary_embedding` (immutable): An embedding of the `conversation_summary`, used as part of `topic` generation.

### Creating a Metric

Metrics can be created by clicking on the "+ Create New Metric" button on the Metrics page.

<figure><img src="/files/zNneK6P87NM3nAdiXQRi" alt=""><figcaption></figcaption></figure>

### LLM-as-Judge Metrics

LLM-as-Judge Metrics can be customized from the built in [LLM-as-Judge Metric Templates](/v0.26.x/workflow/metrics/llm-as-judge-metric-templates.md). Each of these Metrics is one of two types:

* Classifier Metric: Outputs a categorical value equal to one of a predefined set of classes. Example: [`llm_answer_groundedness`](/v0.26.x/workflow/metrics/llm-as-judge-metric-templates.md#llm_answer_groundedness).
* Scorer Metric: Outputs an integer in the range `[1, 2, 3, 4, 5]`. Example: [`llm_text_frustration`](/v0.26.x/workflow/metrics/llm-as-judge-metric-templates.md#llm_text_frustration).

### Standard Metrics

Standard Metrics are functions that can be computed using non-LLM methods. They can be built using the [Functions](/v0.26.x/reference/query-language/functions.md) available in the [DBNL Query Language](/v0.26.x/reference/query-language.md).
