> For the complete documentation index, see [llms.txt](https://docs.ylem.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ylem.co/metrics/metric-management.md).

# Metric management

The functionality of metrics allows you to quickly create OKRs, KPIs, SLAs, and other custom metrics, schedule them, monitor their value, and execute various pipelines based on them.

[Management of metrics](https://app.datamin.io/metrics) consists 5 simple steps:

## Give metric a name

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

## Define how to retrieve data for your metric

As same as in the case of the pipeline task "Query" you can choose between using a visual UI or an SQL interface:

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

## Define how to calculate your metric

[Mathematical functions](/pipelines/mathematical-functions.md) are supported here:

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

## Define how often or when to calculate your metric

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

More scheduling information can be found [here](/pipelines/running-and-scheduling-workflows.md#automatically-by-a-schedule).

## Define thresholds and pipelines to run

And now as the final and most important step, you can define which pipeline to execute depending on the value of your metric:

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

<figure><img src="/files/6ZnMYrX3sllJLOX1WHPE" alt=""><figcaption></figcaption></figure>

Some of the more detailed examples of metrics can be found here in the list of our use cases. Our [library of templates](/pipelines/library-of-templates.md) also contains multiple ones, which you can use for configuring your metrics.


---

# 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:

```
GET https://docs.ylem.co/metrics/metric-management.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
