Cloudwatch
Add AWS CloudWatch as a health source in Harness Continuous Verification to monitor metrics and logs during deployments.
This topic explains how to configure AWS CloudWatch as a health source in Harness Continuous Verification (CV). CloudWatch provides metrics and log data that Harness CV uses to verify deployment health and detect regressions automatically.
What you will learn from this topic
How to add AWS CloudWatch as a health source in Harness Continuous Verification
How to configure CloudWatch Metrics with Metrics Insights SQL queries
How to configure CloudWatch Logs with log group queries and field mapping
How to assign metrics to services and configure risk profiles
Before you begin
This topic assumes you have completed the prerequisite setup for Continuous Verification. Go to Configure CV to complete those steps before adding a health source.
Add CloudWatch as a health source
This option is available only if you have configured the service and environment as fixed values.
A health source maps a Harness service to the service in a deployment environment monitored by an APM or logging tool.
To add CloudWatch as a health source, do the following:
In Health Sources, click Add. The Add New Health Source settings appear.

Health Sources panel showing the Add button and the Add New Health Source dialog In Select health source type, select CloudWatch.
In Health Source Name, enter a name for the health source.
Under Connect Health Source, click Select Connector.
In Connector settings, choose an existing connector or click New Connector. Harness supports AWS connectors with Manual Credentials, IRSA, Assume IAM Role on Delegate, and OIDC credential types. Go to CloudWatch IAM permissions for IAM permissions and trust policy details for each credential type.

Connector selection panel showing the available AWS connector options Click Apply Selected. The connector is added to the health source.
In Select Feature, select the CloudWatch feature to configure:
CloudWatch Metrics
CloudWatch Logs
Click Next.
Configuration
Depending on your feature selection, complete the steps in the corresponding tab.
To configure CloudWatch Metrics, do the following:
Select the AWS Region.
Click + Add Metric.
You can customize the metrics to map the Harness service to the monitored environment in the Query Specifications and Mapping settings.
Enter a name for the metric in Metric Name.
Enter a name for the group in Group Name.
Select the services you want to apply to the metric under Assign. At least one selection is required.
If you select Continuous Verification or Service Health, configure a risk profile.
Enter the query in the Query field using CloudWatch Metrics Insights SQL syntax. This field also accepts a Harness expression or runtime input.
Harness supports the full Metrics Insights query language, including
WHEREandORDER BYclauses. UseWHEREto filter metrics by dimension values, for example, to isolate metrics for a specific ALB target group or EC2 instance. UseORDER BYto sort results when your query returns multiple time series.Click Fetch Records to retrieve the details.

Query Specifications and Mapping panel showing the Fetch Records button and query results Click Submit. The health source is displayed in the AI Verify (v1) step.

AI Verify (v1) step showing the CloudWatch Metrics health source added successfully
To configure CloudWatch Logs, do the following:
Click + Add Query.
Enter a Query Name.
Click Submit.
Select the AWS Region.
Select a CloudWatch Log Group. This field also accepts a Harness expression or runtime input.
Under Define Query, enter your CloudWatch Logs Insights query. This query also accepts a runtime input or expression.
After entering your fixed input query, click Run Query.
Complete the field mapping for the Timestamp Identifier, Service Instance Identifier, and Message Identifier. To do so, click the + icon and select the relevant field from the log results.

Field mapping panel showing the Timestamp Identifier, Service Instance Identifier, and Message Identifier selections Click Submit. The health source is displayed in the AI Verify (v1) step.
You can add one or more health sources for each APM or logging provider.
Next steps
After you add CloudWatch as a health source, you can run your deployment pipeline and review the verification results.
Configure CV: Review the full CV configuration workflow and available options.
CloudWatch IAM permissions: Review the IAM permissions and trust policy details required for each AWS connector credential type.
Health sources overview: Explore other supported health source providers for Continuous Verification.
Last updated
Was this helpful?