> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/use-continuous-delivery/verify-deployments/configure-cv/health-sources/custom-health-metrics.md).

# Custom Health Source

This topic covers how to add and configure Custom Health as a Health Source for the AI Verify (v1) step.

Harness offers support for all major APM vendors and log providers, but there are cases where a customized APM or log provider is needed. The Custom Health Source lets you customize APMs and log providers of your choice.

### Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

This page assumes you have followed the rest of the steps to set up CV. To learn more, go to [Configure CV](/continuous-delivery/use-continuous-delivery/verify-deployments/configure-cv/verify-deployments.md)

### Add a custom health source <a href="#add-a-custom-health-source" id="add-a-custom-health-source"></a>

This option is available only if you have configured the service and environment as fixed values.

A Health Source is basically a mapping of a Harness Service to the service in a deployment environment monitored by an APM or logging tool.

In **Health Sources**, click **Add**. The **Add New Health Source** settings appear.

![](/files/ENVvQzQthV6QxCPgddsP)

1. In **Select health source type**, select **Custom Health**.
2. In **Health Source Name**, enter a name for the health source. For example, `Quickstart`.
3. In **Connect Health Source**, click **Select Connector**.
4. In **Connector** settings, you can either choose an existing connector or click **New Connector.**
5. Click **Apply Selected**. The Connector is added to the Health Source.
6. In **Select Feature**, select the feature to be monitored. You can either select **Custom Health Metrics** or **Custom Health Logs**.
7. Click **Next**.

#### Option: Custom Health Metrics <a href="#option-custom-health-metrics" id="option-custom-health-metrics"></a>

1. If you select Custom Health Metrics, the **Customize Health Source** settings appear as:

   ![](/files/TchSLJ2dTtSo2c70cLnw)
2. Click **Map Metric(s) to Harness Services**.
3. In **Metric Name**, enter the name of the metric.
4. In **Group Name**, click **Add New** and enter a name for the metric group.
5. Click **Query specifications and mapping.**
6. In **Query Type** you can choose either **Service Based (used for Health Score and SLI)** or **Host Based (used for CV)**. If you select the query type as **Host Based** (Continuous Verification), the verification won't happen for SLI and Health Score (Service Based), and vice versa.
7. In **Request Method**, you can select **GET** or **POST**. If you select POST, you need to define the body format.
8. In **Path**, enter the complete path of the metric.
9. In **Start and End Time Placeholders**, enter the following:
   1. In **Start time placeholder**, enter the start time placeholder in the metric path.
   2. In **Unit**, select the preferred unit of measurement.
   3. In **End time placeholder**, enter the end time placeholder in the metric path.
   4. In **Unit**, select the preferred unit of measurement.
10. Click **Fetch Records** to retrieve records from the provided URL.
11. Click **Metric values and charts**. For each path, click the **+** icon to select the appropriate path from the data source.
    1. For **Metric Value Json Path**, it expects at least 2 `*` in the json path.
    2. For **Timestamp Value Json Path**, it expects at least 2 `*` in the json path.
    3. For **Service Instance Identifier Json Path**, it expects at least 1 `*` in the json path.
    4. In **Timestamp Format**, enter a static value in dd/mm/yy format.
12. Click **Assign**. Select the services for which you want to apply the metric. You can select **Health Score** or **SLI** or both options. The subsequent steps depend on the service you select in this step.1. In **Risk Category**, select a risk type. Available options for risk types are:
    * Errors
    * Infrastructure
    * Performance/Throughput
    * Performance/Other
    * Performance/Response Time
13. In **Deviation compared to Baseline**, select one of the options based on the selected risk type. Available options are:
    * **Higher value is higher risk** - Select this option if a high value of the selected risk type is a risk.
    * **Lower value is higher risk** - Select this option if lower value of the selected risk type is a risk.
14. Click **Submit**.

#### Option: Custom Health Logs <a href="#option-custom-health-logs" id="option-custom-health-logs"></a>

1. If you select Custom Health Logs, the **Customize Health Source** settings appear as:

   ![](/files/MBVknZQuMDqCT3POWimi)
2. Click **Query specifications and mapping**.
3. In **Query Name**, enter a name for the query. For example, `Custom Log Query`.
4. In **Request Method**, you can select **GET** or **POST**. If you select POST, you need to define the body format.
5. In **Path**, enter the complete path of the metric. For example,`v2/logs/events/search`.
6. In **Start and End Time Placeholders**, enter the following:
   1. In **Start time placeholder**, enter the start time placeholder in the metric path. For example, start\_time.
   2. In **Unit**, select the preferred unit of measurement. For example, Milliseconds.
   3. In **End time placeholder**, enter the end time placeholder in the metric path. For example, end\_time.
   4. In **Unit**, select the preferred unit of measurement. For example, Milliseconds.
7. In **Body**, enter the request body. For example,`{"filter":{"query":","from":start_time,"to":end_time}}`.
8. Click **Fetch Records** to retrieve records from the provided URL.

   ![](/files/MlYIKmRwhQZtrHvGazcR)
9. Once the response is retrieved, click **JSON path selection**.

   1. In **Log Message JSON path**, click the plus icon to select the path to the log message from the data source. For example,`$.data.[*].attributes.message`.
   2. In **Timestamp Field/Locator JSON** Path, click the plus icon to select the path to the log message from the data source. For example,`$.data.[*].attributes.timestamp`.
   3. In **Provide Service Instance to map to Harness Service Instance**, click the plus icon to select the Service instance from the data source. For example,`$.data.[*].attributes.tags.[4]`.

   ![](/files/50Ti2YiphRD8uMc4HvY7)
10. Click **Submit**.
