New Relic Verification

Updated 3 months ago by Michael Cretzman

New Relic delivers real-time and trending data about application performance. New Relic can determine whether a performance blocker comes from the app itself, CPU availability, database loads, or other source.

You can add a New Relic verification step to your workflow and New Relic will be used by Harness to verify the performance and quality of your deployments using Harness machine-learning verification analysis.

Verification analysis is limited to Web Transactions only. In New Relic, in your application, click Transactions, and in Type, click Web.

Web Transactions in New Relic

Web Transactions analyzed in Harness

Intended Audience

  • DevOps

Before You Begin

Connect to New Relic

Connect Harness to New Relic to have Harness verify the success of your deployments. Harness will use your tools to verify deployments and use its machine learning features to identify sources of failures.

To connect a verification provider, do the following:

  1. Click Setup.
  2. Click Connectors.
  3. Click Verification Providers.
  4. Click Add Verification Provider, and select New Relic.


    The Add NewRelic Verification Provider dialog appears.

The Add New Relic Verification Provider dialog has the following fields.

Field

Description

API Key

Enter the API key needed to connect with the server. For information on API keys, see Access to REST API keys from New Relic.

  1. Log into New Relic.
  2. On the home page, click your account name, and then click Account Settings.
  3. Click the left menu, under Integrations, click API keys.


    The API keys are displayed.



    An index of Admin user's API keys appears below the account's REST API key. The list includes the Admin's full name and the date their key was last used. You can view your own Admin user's API key: From the Admin index, select (Show key) for your name.

Display Name

Enter a display name for the provider. If you are going to use multiple providers of the same type, ensure you give each provider a different name.

Usage Restrictions

If you want to restrict the use of a provider to specific applications and environments, do the following:

In Usage Restrictions, click the drop-down under Applications, and click the name of the application.

In Environments, click the name of the environment.

Pro or higher subscription level needed. For more information, see Introduction to New Relic's REST API Explorer from New Relic.

Verify with New Relic

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.

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.

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

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.

Baseline for Risk Analysis

Select Previous Analysis to have this verification use the previous analysis for a baseline comparison. If your workflow is a Canary workflow type, you can select Canary Analysis to have this verification compare old versions of nodes to new versions of nodes in real-time.

Execute with previous steps

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

Failure Criteria

Specify the sensitivity of the failure criteria. When the criteria is met, the workflow Failure Strategy is triggered.

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.

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 info
See the verification analysis for each deployment, with information on its service, environment, pipeline, and workflows.

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

Verification timeline
See when each deployment and verification was performed.

Transaction Analysis

Execution details
See 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 analysis
Get an overall risk level and view the cluster chart to see events.

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

Execution Analysis

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

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

Event Management

Event-level analysis
See the threat level for each event captured.

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

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

Troubleshooting

The following are resolutions to common configuration problems.

Workflow Step Test Error

When you click TEST in the New Relic workflow dialog Expression for Host Name popover, you should get provider information:

The following error message can occur when testing the New Relic verification step in your workflow:

NEWRELIC_CONFIGURATION_ERROR: Error while saving New Relic configuration. No node with name ${hostName} found reporting to new relic

Here is the error in the Expression for Host Name popover:

Cause

The expression in the Expression for Host/Container name field is incorrect. Typically, this occurs when the wrong hostName label is selected to create the expression in the Expression for Host/Container name field.

Solution

Following the steps in Guide From Example again to select the correct expression. Ensure that the hostName label selected is under the host section of the YAML.

Next Steps


How did we do?