> 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/cloudwatch.md).

# Cloudwatch

### 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 Cloudwatch as a health source <a href="#add-cloudwatch-as-a-health-source" id="add-cloudwatch-as-a-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.

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

   ![](/files/qFiYaFDw9bwpZSWODakY)
2. In **Select health source type**, select **CloudWatch**.
3. In **Health Source Name**, enter a name for the Health Source.
4. Under **Connect Health Source**, click **Select Connector**.
5. In **Connector** settings, you can either choose an existing connector or click **New Connector.**

   ![](/files/NLqTRchf6xtFNkABGz6U)
6. Click **Apply Selected**. The Connector is added to the Health Source.
7. In **Select Feature**, select the CloudWatch feature:

   * CloudWatch Metrics
   * CloudWatch Logs

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>CloudWatch Logs is currently behind the feature flag <code>CDS_CV_CLOUDWATCH_LOGS_ENABLED</code>. Contact <a href="mailto:support@harness.io">Harness Support</a> to enable it.</p></div>
8. Click **Next**.

***

#### Configuration <a href="#configuration" id="configuration"></a>

Depending on your feature choice, do the following configuration steps.

{% tabs %}
{% tab title="CloudWatch Metrics" %}

1. Select the **AWS Region**.
2. Click **+ Add Metric**.

You can customize the metrics to map the Harness Service to the monitored environment in **Query Specifications and Mapping** settings.

3. Enter a name for the metric in **Metric Name**.
4. Enter a name for the group in **Group Name**.
5. Select the services you want to apply to the metric under **Assign**. At least one selection is required.
6. If you select **Continuous Verification** or **Service Health**, you will need to configure a risk profile. Expand the following block to learn more.
7. Enter the query in the **Query** field using [CloudWatch Metrics Insights SQL syntax](https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch-metrics-insights-syntax.html). This field can also be a Harness expression or runtime input.

   Harness supports the full Metrics Insights query language, including `WHERE` and `ORDER BY` clauses. Use `WHERE` to filter metrics by dimension values — for example, to isolate metrics for a specific ALB target group or EC2 instance. Use `ORDER BY` to sort results when your query returns multiple time series.

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>When you use Continuous Verification to compare a control group and a test group (for example, comparing two ALB target groups during a custom blue/green deployment), configure separate metric definitions with <code>WHERE</code> clauses that target each group's dimension values.</p></div>
8. Click **Fetch Records** to retrieve the details.

   ![](/files/x1GYb1LsAsAYPVNFiA8Y)
9. Click **Submit**. The Health Source is displayed in the AI Verify (v1) step.

   ![](/files/xsWQLX83lMRKdiYFN4OC)
   {% endtab %}

{% tab title="CloudWatch Logs" %}
{% hint style="info" %}
CloudWatch Logs is currently behind the feature flag `CDS_CV_CLOUDWATCH_LOGS_ENABLED`. Contact [Harness Support](mailto:support@harness.io) to enable it.
{% endhint %}

{% hint style="info" %}
For more information on the prerequisites, configuration steps, and permissions required for enabling cloudwatch logs, go to [Cloudwatch Logs](/continuous-delivery/use-continuous-delivery/verify-deployments/configure-cv/health-sources/cloudwatch-aws.md)
{% endhint %}

1. Click **+ Add Query**.
2. Enter a **Query Name**.
3. Click **Submit**.
4. Select the **AWS Region**.
5. Select a **CloudWatch Log Group**. This field can also be a Harness expression or runtime input.
6. Under **Define Query**, enter your [query](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html). This query can also be a runtime input or expression.
7. After writing your fixed input query, click **Run Query**.
8. Next, complete the field mapping for the **Timestamp Identifier**, **Service Instance Identifier**, and **Message Identifier**. To do so, hit the `+` button icon and select the relevant field from the log that appears after running the query.

   ![](/files/tSVHC1QRHm1HZU1IArUC)
9. Click **Submit**. The health source is displayed in the AI Verify (v1) step.
   {% endtab %}
   {% endtabs %}

***

You can add one or more Health Sources for each APM or logging provider.
