3 - Verify Deployments with Datadog

Updated 1 day ago by Michael Cretzman

Harness can analyze Datadog data and analysis to verify, rollback, and improve deployments. To apply this analysis to your deployments, you set up Datadog as a verification step in a Harness Workflow.

Once you run a deployment and Datadog preforms verification, Harness' machine-learning verification analysis will assess the risk level of the deployment.

In order to obtain the names of the host(s), pod(s), or container(s) where your service is deployed, the verification provider should be added to your workflow after you have run at least one successful deployment.

In this topic:

Deployment Verification Setup

You can use Datadog metrics or logs for verification. They are configured as separate Workflow steps, but most of their settings are the same.

To verify your deployment with Datadog Logs, do the following:

  1. Ensure that you have added Datadog as a verification provider, as described above.
  2. In your workflow, under Verify Service, click Add Verification, and then click Datadog Metrics or Datadog Log. The Datadog Metrics or Datadog Log dialog appears.

  1. The dialog have the same fields unless noted otherwise.

Field

Description

Datadog Metrics/Log Server

Select the Datadog verification provider you added, as described above.

Datadog Monitoring

Datadog Metrics only

Here you can select any of the Datadog API metrics. For a list of the API metrics, see Data Collected from Datadog.

Infrastructure Metrics

Datadog Metrics only

Select the Docker, Kubernetes, and ECS metrics to use.

Datadog Custom Metrics

Datadog Metrics only

  1. In Hostname Identifier, enter the field name in Datadog for the host name.
    This would be the hosts value used when searching:
  2. In Metric Type, select the metric to use. To use multiple types, click Add.
  3. In Display Name, enter a name to identify this metric in the Harness dashboards.
  4. In Group Name, enter the name of the service or request context to which the metric relates. For example, Login.
  5. In Metric Name, enter the metric you want to use. These are the metrics you will see in the Datadog Metrics Explorer Graph menu:

Search Keywords

Datadog Log only

Enter search keywords, such as *expression*. Separate keywords using spaces. Follow the Datadog log search syntax.

Expression for Host/Container name

Enter an expression that evaluates to the host/container/pod name tagged in the Datadog events.For example, in Datadog, a Kubernetes deployment might use the tag pod_name to identify the pod where the microservice is deployed. Find the where the same name is identified in the deployment environment, and use that path as the expression.For example, locate the pod name in the Datadog Event Stream page:

  1. In Datadog, click Events.
  2. Locate an event using a search query. For more information, see Event Stream from Datadog.
  3. Expand the event by click the the ellipsis at the end of the event title.
  4. Look through the event details and locate the tag that lists the pod name for the instance where the service is deployed. In our example, the tag is pod_name.
  5. Next, look in the JSON for the host/container/pod in the deployment environment and identify the label containing the same hostname. The path to that label is what the expression should be in Expression for Host/Container name. The default expression is ${host.hostName}. In most cases, this expression will work.

Analysis Time duration

Set the duration for the verification step. If a verification step exceeds the value, the workflow Failure Strategy is triggered. For example, if the Failure Strategy is Ignore, then the verification state is marked Failed but the workflow execution continues.

See CV Strategies, Tuning, and Best Practices.

Baseline for Risk Analysis

See CV Strategies, Tuning, and Best Practices.

Algorithm Sensitivity

See CV Strategies, Tuning, and Best Practices.

Execute with previous steps

Check this checkbox to run this verification step in parallel with the previous steps in Verify Service.

  1. For Datadog Metrics, click TEST. Harness verifies the settings you entered.
  2. When you are finished, click SUBMIT. The Datadog verification step is added to your workflow.

Datadog and ECS

For ECS-based deployments, Datadog uses the container ID to fetch data for both metrics and logs. Harness can fetch the container ID if the Harness Delegate is running on same ECS cluster as the container or the Delegate must be in same AWS VPC and port 51678 must be open for incoming traffic.

Verification Results

Once you have deployed your workflow (or pipeline) using the Datadog verification step, you can automatically verify cloud application and infrastructure performance across your deployment. For more information, see Add a Workflow and Add a Pipeline.

Workflow Verification

To see the results of Harness machine-learning evaluation of your Datadog verification, in your workflow or pipeline deployment you can expand the Verify Service step and then click the Datadog step.

Continuous Verification

You can also see the evaluation in the Continuous Verification dashboard. The workflow verification view is for the DevOps user who developed the workflow. The Continuous Verification dashboard is where all future deployments are displayed for developers and others interested in deployment analysis.

To learn about the verification analysis features, see the following sections.

Deployments

Deployment infoSee the verification analysis for each deployment, with information on its service, environment, pipeline, and workflows.

Verification phases and providersSee the vertfication phases for each vertfication provider. Click each provider for logs and analysis.

Verification timelineSee when each deployment and verification was performed.

Transaction Analysis

Execution detailsSee the details of verification execution. Total is the total time the verification step took, and Analysis duration is how long the analysis took.

Risk level analysisGet an overall risk level and view the cluster chart to see events.

Transaction-level summarySee a summary of each transaction with the query string, error values comparison, and a risk analysis summary.

Execution Analysis

Event typeFilter cluster chart events by Unknown Event, Unexpected Frequency, Anticipated Event, Baseline Event, and Ignore Event.

Cluster chartView the chart to see how the selected event contrast. Click each event to see its log details.

Event Management

Event-level analysisSee the threat level for each event captured.

Tune event captureRemove events from analysis at the service, workflow, execution, or overall level.

Event distributionClick the chart icon to see an event distribution including the measured data, baseline data, and event frequency.

Next Steps


How did we do?