# 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="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2F9wqDtAKL5xTZaoeP66xl%2FScreenshot%202023-01-15%20at%2022.12.49.png?alt=media&#x26;token=d4d9e8fe-27c6-41e7-a241-ea83ad826eb7" 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="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FURsYbTn54DINjjFAhd4s%2FScreenshot%202023-01-15%20at%2022.13.02.png?alt=media&#x26;token=4153856c-604e-4765-87f9-d65e354817ec" alt=""><figcaption></figcaption></figure>

## Define how to calculate your metric

[Mathematical functions](https://docs.ylem.co/pipelines/mathematical-functions) are supported here:

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FSjwnt9Z0MDOtCKwt8skY%2FScreenshot%202023-01-15%20at%2022.13.19.png?alt=media&#x26;token=7e900d7a-d610-456c-8bfb-583247ce5e60" alt=""><figcaption></figcaption></figure>

## Define how often or when to calculate your metric

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FUlFwJMDxJQ4q4x6guhCV%2FScreenshot%202023-01-15%20at%2022.13.38.png?alt=media&#x26;token=fdb99a3b-e440-4f71-b339-6028f8a15d85" alt=""><figcaption></figcaption></figure>

More scheduling information can be found [here](https://docs.ylem.co/pipelines/running-and-scheduling-workflows#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="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FoYhQbT93m4Kn9vnjMYTO%2FScreenshot%202024-04-17%20at%2013.56.04.png?alt=media&#x26;token=c73b1ee2-7ef0-4939-9458-64bfb935b7f8" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3180830455-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FD0FT8l3QzMrw546vOdHU%2Fuploads%2FwTdlrYPYwIDH5OBS6Aks%2FScreenshot%202024-04-17%20at%2013.55.55.png?alt=media&#x26;token=e3589119-2c5a-4d5a-a2a7-6b8f6f2ac36d" 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](https://docs.ylem.co/pipelines/library-of-templates) also contains multiple ones, which you can use for configuring your metrics.
