Add a Custom Health connector
Add a Custom Health connector so Harness can fetch metrics from any provider that exposes an HTTP API.
The Custom Health connector connects Harness to any metrics or health provider that exposes an HTTP API. Use it when Harness does not have a dedicated connector for your provider, for example, Grafana Loki. Harness can then query your provider’s API and use the returned data in Continuous Verification to compare application behavior before and after a deployment, helping you confirm a release is healthy or trigger a rollback if it is not.
Go to Overview for information about all monitoring and logging connectors, such as scopes and delegate selection.
What you will learn from this topic
How to add a Custom Health connector to a Harness project.
How to configure the headers, parameters, and validation path that Harness uses to query your provider.
How to choose the delegates that connect to your provider and verify the connection.
Before you begin
Provider API details: The URL, required headers, request parameters, and a validation query for your metrics provider.
Harness permissions: Permission to create connectors and secrets in Harness.
Add a Custom Health connector
You can add a Custom Health connector at the project, org, or account scope. This procedure covers the project scope, and the process is the same for org and account scope.
Perform the following steps to add a Custom Health connector:
Open your Harness project.
In Project Settings, select Connectors.
Click New Connector, then select Custom Health under Monitoring and Logging Systems. The Custom Health connector settings appear.
Overview
Configure the identity fields for the connector:
In Name, enter a name for the connector. Harness generates the Id from the name.
Optionally, add a Description and Tags.
Click Continue.

Details
The Details step has three tabs: Headers, Parameters, and Validation Path. Configure each tab, then click Next to move to the next one.
Headers
In the Headers tab, configure the following settings:
In Base URL, enter the URL of the metrics data provider. For example,
https://mycompany.appd.com.Under Headers, enter the query headers your provider requires.
In Key, enter a valid query key.
In Value, select Plaintext and enter a value, or select a Harness encrypted text secret. To add more headers, click Add Header.
Click Next.

Parameters
In the Parameters tab, configure the following settings:
Under Parameters, enter the request parameters.
In Key, enter a valid query key.
In Value, select Plaintext and enter a value, or select a Harness encrypted text secret. To add more parameters, click Add Parameter.
Click Next.

Validation Path
In the Validation Path tab, configure the following settings:
In Request Method, select GET or POST.
In Validation Path, enter the query string from your metrics provider.
Click Next.

Delegates Setup
Select one of the following options:
Use any available Delegate: Harness selects an available delegate at runtime.
Only use Delegates with all of the following tags: Enter the tags of the delegates Harness must use with this connector.
The Test Delegate Connectivity list shows the delegates that match your selection. To add a delegate, click Install new Delegate.
Click Save and Continue.

Verify Connection
Click Finish after the connection test succeeds. The connector is listed in Connectors page.
Next steps
Add a Grafana Loki connector: Use the Custom Health connector type to connect to Grafana Loki.
Use delegate selectors: Control which delegates can connect to this connector.
Last updated
Was this helpful?