4 - Verify Deployments with New Relic

Updated 3 weeks ago by Michael Cretzman

The following procedure describes how to add New Relic as a verification step in a Harness workflow. For more information about workflows, see Add a Workflow.

Once you run a deployment and New Relic 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

To verify your deployment with New Relic, do the following:

  1. Ensure that you have added New Relic as a verification provider, as described above.
  2. In your workflow, under Verify Service, click Add Verification.
  3. In the Add Command popover, click New Relic.
    The New Relic dialog appears.

The New Relic dialog has the following fields.

Field

Description

Where to Find Information in New Relic

New Relic Server

Select the server you added when you set up the New Relic verification provider, as described above.

In Harness, click Setup, click Connectors, click Verification Providers. The New Relic verification provider(s) are listed. The New Relic logo is next to each New Relic provider.

Application Name

Select the application to use for this verification step.

If your New Relic account contains hundreds or thousands of applications, Harness requests that you enter in the application name. You can just paste in the application name as it appears in the New Relic Applications page Name column.

This is the application name used to aggregate data in the New Relic UI. You set both the license and the app name as part of the New Relic installation process.

To find your application, in New Relic, click Applications. The list of applications is displayed on the Applications page.

Expression for Host/Container Name

The expression entered here should resolve to a host/container name in your deployment environment. For instructions on how to the Guide From Example feature, see Guide From Example.

When you are setting up the workflow for the first time, Harness will not be able to help you create an expression in the Guide From Example feature because there has not been a host/container deployed yet. For this reason, you should add the Verify Step after you have done one successful deployment.

To ensure that you pick the right name when using Guide From Example, you can use a host name in New Relic as a guide.In New Relic, click your application, click the left menu, and then click JVMs. The host names are listed in the first column of the table.

The expression that you provide in Expression for Host/Container Name should evaluate to the names here.

The following settings are common to all verification provider dialogs in workflows.

Field

Description

Analysis Time duration

See CV Strategies, Tuning, and Best Practices.

Baseline for Risk Analysis

Canary Analysis - Harness will compare the metrics received for the nodes deployed in each phase with metrics received for the rest of the nodes in the application. For example, if this phase deploys to 25% of your nodes, the metrics received from New Relic during this deployment for these nodes will be compared with metrics received for the other 75% during the defined period of time.

Previous Analysis - Harness will compare the metrics received for the nodes deployed in each phase with metrics received for all the nodes during the previous deployment. For example, if this phase deploys V1.2 to node A, the metrics received from New Relic during this deployment will be compared to the metrics for nodes A, B, and C during the previous deployment (V1.1).

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.

Include instances from previous phases

If you are using this verification step in a multi-phase deployment, select this checkbox to include instances used in previous phases when collecting data. Do not apply this setting to the first phase in a multi-phase deployment.

Wait interval before execution

Set how long the deployment process should wait before executing the verification step.

Guide From Example

This section explains how to use the Guide From Example option next to the Expression for Host/Container name field, but the same information applies to when the Guide From Example option is next any other field, such as a Message field.

In the New Relic verification step dialog, you can see the Guide From Example option next to the Expression for Host/Container name field. This option lets you select the host(s), pod(s), or container(s) for Harness to use when performing verification.

You select the host, pod, or container in Guide From Example, and an expression is added to the Expression for Host/Container name field. The default expression is ${host.hostName}.

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. Then the Guide From Example feature can display the host or container name(s) for you to select.

To ensure that you pick the right name when using Guide From Example, you can use a host name in New Relic as a guide.

To use Guide From Example for a host or container name expression, do the following:

  1. In New Relic, click your application, click the left menu, and then click JVMs. The host names are listed in the first column of the table.
    The expression that you provide in Expression for Host/Container Name should evaluate to the names here.
  2. In your Harness workflow New Relic dialog, click Guide From Example. The Expression for Host Name popover appears.
    The dialog shows the service, environment, and service infrastructure used for this workflow.
  3. In Host, click the name of the host to use when testing verification. Match the hostname from the New Relic JVMs to the hostname in the Expression for Host Name popover:
  4. Click SUBMIT. The YAML for the host appears. Look for the host section.
    You want to use a hostName label in the host section. Do not use a hostName label outside of that section.
  5. To identify which label to use to build the expression, compare the host/container names in the YAML with the host names in the New Relic JVMs page.
  6. Locate the host/pod/container to use, and click the label to select the expression. For example, if you clicked the hostName label, the expression ${host.hostName} is added to the Expression for Host/Container name field. Click back in the main dialog to close the Guide From Example.
  7. At the bottom of the New Relic dialog, click TEST.
    A new Expression for Host Name popover appears.
  8. In Host, select the same host you selected last time, and then click RUN. Verification for the host is found.
    If you have errors, see Troubleshooting.
  9. Click back in the New Relic dialog and click SUBMIT. The New Relic verification step is added to your workflow.

Using Guide From Example for other dialog fields is the same process as above.

Templatize New Relic Verification

Once you have created a New Relic verification step, you can templatize certain settings. This enables you to use the New Relic verification step in the Workflow (and multiple Pipelines) without having to provide settings until runtime.

You templatize settings by click the [T] icon next to the setting.

The settings are replaced by Workflow variables:

You will now see them in the Workflow Variables section of the Workflow:

When you deploy the Workflow, Start New Deployment prompts you to enter values for templatize settings:

You can select the necessary settings and deploy the Workflow.

You can also pass variables into a Workflow from a Trigger that can be used for templatized values. For more information, see Passing Variables into Workflows and Pipelines from Triggers.

Verification Results

Once you have deployed your workflow (or pipeline) using the New Relic verification step, you can automatically verify cloud application and infrastructure performance across your deployment.

Workflow Verification

To see the results of Harness machine-learning evaluation of your New Relic verification, in your workflow or pipeline deployment you can expand the Verify Service step and then click the New Relic 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 Step


How did we do?