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

# Custom Metrics

# Custom Metrics

Custom metrics in OpenMetadata enhance profiling capabilities by enabling users to define and compute unique business metrics using custom SQL queries. These metrics can be added at both the table and column levels, allowing tailored analysis specific to organizational needs. Once defined, custom metrics are incorporated into the profiler workflow, and their computed values are displayed alongside system metrics in the table and column profiles. This feature provides a flexible way to track specific data insights, empowering users to gain deeper visibility into their datasets.

## Table-Level Metrics

* Navigate to the **Database** and switch to the **Data Observability** tab. Click on **Table Profile**, and on the right-hand side, select the **Add** option to access the custom metric feature.

<img src="https://mintcdn.com/openmetadata/SkZlgor4HLQUK_jg/public/images/features/ingestion/workflows/profiler/custom-metric1.png?fit=max&auto=format&n=SkZlgor4HLQUK_jg&q=85&s=680064859900f9cfb9fa9305c8e5f146" alt="Click Add Custom Metric" width="2943" height="1243" data-path="public/images/features/ingestion/workflows/profiler/custom-metric1.png" />

* Enter a meaningful name for the custom metric and input the required SQL query based on your data requirements.

<img src="https://mintcdn.com/openmetadata/SkZlgor4HLQUK_jg/public/images/features/ingestion/workflows/profiler/custom-metric2.png?fit=max&auto=format&n=SkZlgor4HLQUK_jg&q=85&s=5ad86227662d249b9f50f6ec13b8ec54" alt="Input SQL query" width="4024" height="1911" data-path="public/images/features/ingestion/workflows/profiler/custom-metric2.png" />

* Once the custom metric is defined, run the **Profiler Agent** in the **Database Services**.

<img src="https://mintcdn.com/openmetadata/SkZlgor4HLQUK_jg/public/images/features/ingestion/workflows/profiler/custom-metric3.png?fit=max&auto=format&n=SkZlgor4HLQUK_jg&q=85&s=be13b0399ecc7ebb45df554061f327aa" alt="Run Profiler Agent" width="4024" height="1911" data-path="public/images/features/ingestion/workflows/profiler/custom-metric3.png" />

* After running the profiler agent, return to the same dataset to view the computed custom metric within the table profile.

<img src="https://mintcdn.com/openmetadata/SkZlgor4HLQUK_jg/public/images/features/ingestion/workflows/profiler/custom-metric4.png?fit=max&auto=format&n=SkZlgor4HLQUK_jg&q=85&s=75a56d4dbc5ddf00e2120064786b74cc" alt="View Custom Metric" width="4024" height="1911" data-path="public/images/features/ingestion/workflows/profiler/custom-metric4.png" />

## Column-Level Metrics

* Navigate to the **Database** and switch to the **Data Observability** tab. Click on **Column Profile**, and on the right-hand side, select the **Add** option to access the custom metric feature.

<img src="https://mintcdn.com/openmetadata/SkZlgor4HLQUK_jg/public/images/features/ingestion/workflows/profiler/custom-metric1.png?fit=max&auto=format&n=SkZlgor4HLQUK_jg&q=85&s=680064859900f9cfb9fa9305c8e5f146" alt="Click Add Custom Metric" width="2943" height="1243" data-path="public/images/features/ingestion/workflows/profiler/custom-metric1.png" />

* After clicking on Custom Metric, provide a name, select column name, and define the SQL query.

<img src="https://mintcdn.com/openmetadata/SkZlgor4HLQUK_jg/public/images/features/ingestion/workflows/profiler/column-metric2.png?fit=max&auto=format&n=SkZlgor4HLQUK_jg&q=85&s=ed8b2f18d2a6dfe1674d6de14a0c19a0" alt="Run Profiler Agent" width="2948" height="1500" data-path="public/images/features/ingestion/workflows/profiler/column-metric2.png" />

* Save and run the profiler workflow to generate the metric.

<img src="https://mintcdn.com/openmetadata/SkZlgor4HLQUK_jg/public/images/features/ingestion/workflows/profiler/column-metric3.png?fit=max&auto=format&n=SkZlgor4HLQUK_jg&q=85&s=d6c4ecdda32c91fcebe1f03c493bd4e4" alt="Run Profiler Agent" width="4024" height="1911" data-path="public/images/features/ingestion/workflows/profiler/column-metric3.png" />

* After running the profiler agent, return to the same dataset to view the computed custom metric within the column profile.

<img src="https://mintcdn.com/openmetadata/SkZlgor4HLQUK_jg/public/images/features/ingestion/workflows/profiler/column-metric4.png?fit=max&auto=format&n=SkZlgor4HLQUK_jg&q=85&s=3e3fb4731591751044046df4a5480cab" alt="View Custom Metric" width="4024" height="1911" data-path="public/images/features/ingestion/workflows/profiler/column-metric4.png" />
