1 - Custom Verification Connection Setup

Updated 2 weeks ago by Michael Cretzman

The first step in using a Custom APM with Harness is to set up a Custom APM Verification Provider in Harness.

A Harness Verification Provider is a connection to monitoring tools such as a Custom APM. Once Harness is connected, you can use Harness Deployment Verification with your Custom APM data and analysis.

Custom APM Verification Provider Setup

Connect Harness to a Custom Metrics of Logs Provider 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 custom metrics or logs provider, do the following:

  1. Click Setup.
  2. Click Connectors.
  3. Click Verification Providers.
  4. Click Add Verification Provider, and click Custom Verification.

The Metrics/Logs Data Provider dialog appears. In Type, select Metrics Data Provider or Custom Logs Provider.

Metrics Data Provider

In the Metrics Data Provider dialog, you can configure how Harness can query event data via API.

For example, with New Relic Insights, you are configuring the Metrics Data Provider dialog to perform a cURL request like the following:

curl -H "Accept: application/json" \
-H "X-Query-Key: YOUR_QUERY_KEY" \
"https://insights-api.newrelic.com/v1/accounts/YOUR_ACCOUNT_ID/query?nrql=YOUR_QUERY_STRING"
To query event data via API in New Relic Insights, you will need to set up an API key in New Relic. For more information, see Query Insights event data via API from New Relic.

The purpose of the Metrics Data Provider dialog is to validate the credentials and validation path you enter and return an HTTP 200 from your metrics provider.

The Metrics Data Provider dialog has the following fields.

Field

Description

Type

Select Metrics Data Provider.

Display Name

The name for this Verification Provider connector in Harness. This is the name you will use to reference this Verification Provider whenever you use it to add a verification step to a Workflow.

Base URL

Enter the URL for API requests. For example, in New Relic Insights, you can change the default URL to get the Base URL for the API.Default URL: https://insights.newrelic.com/accounts/12121212Base URL for API: https://insights-api.newrelic.com/v1/accounts/12121212

Headers

Add the query headers required by your metrics data provider. For New Relic Insights, do the following:

  1. Click Add Headers.
  2. In Key, enter X-Query-Key. For New Relic, a X-Query-Key must contain a valid query key.
  3. In Value, enter the API key you got from New Relic.
  4. Click the checkbox under Encrypted Value to encrypt the key.
  5. Click Add Headers again.
  6. In Key, enter Accept. This is for the Content-Type of a query.
  7. In Value, enter application/json. The Content-Type of a query must be application/json.

Parameters

Add any request parameters that do not change for every request.

Validation Path

In Path, you will define a validation path. Enter the query string from your metric provider. The resulting URL ({base_URL}/{validation_path}) is used to validate the connection to the metric provider. This query is invoked with the headers and parameters defined here.For example, in New Relic Insights, you can take the query from the NRQL> field and add it to the string query?nrql=, for example:

query?nrql=SELECT%20average%28duration%29%20FROM%20PageView

The field accepts URL encoded or unencoded queries.

If you select POST, the Body field appears. Enter a sample JSON body to send as the payload when making the call to the APM provider. The requirements of the JSON body will depend on your APM provider.

Custom Logs Provider

For any log providers without native support in Harness, you can specify the API calls needed to make a connection. The purpose of the Custom Logs Provider settings are to validate the credentials and validation path you enter and return an HTTP 200 from your logs provider.

To add a Custom Logs Provider, do the following:

  1. In Display Name, give the Verification Provider a name. You will use this name to select this provider in a Workflow.
  2. In Base URL, enter the base URL of the REST endpoint where Harness will connect. Often, the URL is the server name followed by the index name, such as http://server_name/index_name.
  3. In Parameters, click Add Parameters, and add any required parameters.
  4. In Validation Path, you will define a validation path used by Harness to validate the connection and ensure a Harness Delegate can reach the provider. Harness expects an HTTP 200 response.

When you are finished, the dialog will look something like this:

Click TEST to validate the settings and SUBMIT to add the Verification Provider.

In some cases, you might need to include a token in the Body in Validation Path. You can enter your token in Body, but to protect your token, you can add it to Harness as an Encrypted Text secret and then reference it in Body using the ${secrets.getValue("secret_name")} syntax:

The Encrypted Text secret must have Scope to Account enabled or it cannot be used in the Custom Logs Provider.

If you want to use the same token in your 24/7 Service Guard Custom Logs setup, you must create another Encrypted Text secret for the same token and ensure that Scope to Account is not enabled. Encrypted Text secrets used in Harness account settings are not shared with Encrypted Text secrets used in Harness Applications. This enables you to prevent Application users from accessing account-level secrets.

Next Step


How did we do?