Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.
Continuous DeliveryContinuous VerificationCloudwatch

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:

  1. 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
  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, 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
  6. Click Apply Selected. The connector is added to the health source.

  7. In Select Feature, select the CloudWatch feature to configure:

    • CloudWatch Metrics

    • CloudWatch Logs

    CloudWatch Logs feature flag

    CloudWatch Logs requires the feature flag CDS_CV_CLOUDWATCH_LOGS_ENABLED. Contact Harness Support to enable it.

  8. Click Next.

Configuration

Depending on your feature selection, complete the steps in the corresponding tab.

To configure CloudWatch Metrics, do the following:

  1. Select the AWS Region.

  2. Click + Add Metric.

    You can customize the metrics to map the Harness service to the monitored environment in the 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, configure a risk profile.

  7. 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 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.

    Comparing groups with Continuous Verification

    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 WHERE clauses that target each group's dimension values.

  8. Click Fetch Records to retrieve the details.

    Query Specifications and Mapping panel showing the Fetch Records button and query results
  9. 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

CloudWatch Logs feature flag

CloudWatch Logs requires the feature flag CDS_CV_CLOUDWATCH_LOGS_ENABLED. Contact Harness Support to enable it.

Prerequisites and permissions

For prerequisites, configuration steps, and permissions required for CloudWatch Logs, go to CloudWatch Logs.

To configure CloudWatch Logs, do the following:

  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 also accepts a Harness expression or runtime input.

  6. Under Define Query, enter your CloudWatch Logs Insights query. This query also accepts a runtime input or expression.

  7. After entering your fixed input query, click Run Query.

  8. 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
  9. 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?