Automated Canary Analysis

With all the CD Abstraction pieces out of the way, now it is time to define the Workflow which will power the Canary analysis.

Create a new Workflow for the Sample App.

Setup -> AWS Canary Lab -> Workflows + Add Workflow

  • Name: Sample App Canary
  • Workflow Type: Canary Deployment
  • Environment: The EKS Cluster

Create Sample App Workflow

Once you hit Submit, can add a canary phase under “Deployment Phases” with + Add Phase

Sample App Canary

In the Phase definition, select the Sample App Service and your Infrastructure Definition.

Sample App Add Workflow Phase

Once you click Submit, your Canary Phase will be empty. This step will be filling out the Prometheus Details.

Sample App Canary phase setup

In the Verify section, click + Add Step. Search for “prom” as a function to add.

Add Prometheus Step

Select Prometheus and then click Next. This is where the Prometheus queries will be entered.

  • Prometheus Server: EKS Prometheus
  • Metric Name: normal_call
  • Metric Type: Throughput
  • Group Name: custom
  • Query: io_harness_custom_metric_normal_call{kubernetes_pod_name=“$hostName”}

Configure Prometheus CV

Add another metric for Errors with + Add

  • Metric Name: error_call
  • Metric Type: Error
  • Group Name: custom
  • Query: io_harness_custom_metric_error_call{kubernetes_pod_name=“$hostName”}

Configure Prometheus metric

Then set the Analysis Time to 5 mins and Algorithm to Sensitive.

Configure Analysis

When completed it should look like this.

Prometheus Configuration completed

Click Submit and you now have Prometheus added to analyze the canary.

Canary Phase Complete

As a good practice, can automate the removal of the resources if the canary should fail. On the right hand side under Rollback Steps, in the Deploy Phase, + Add Step.

Configure Rollback

Search for “Del” for the Delete Step.

Add Delete step to workflow

Select Delete.

  • Resources: ${k8s.canaryWorkload}

Configure Delete Step

Click Submit and the final canary should look like this.

Completed Sample App Workflow

Now you are ready to deploy your application.