Custom Health Source
Add and configure Custom Health Metrics or Custom Health Logs as a Continuous Verification health source
Harness supports major APM vendors and log providers, and Custom Health Source covers cases where you need a customized APM or log provider. This topic describes how to add and configure Custom Health as a health source for the AI Verify (v1) step.
What you will learn from this topic
How to add a custom health source and select Metrics or Logs
How to map Custom Health Metrics, including query type, JSON paths, and risk assignment
How to map Custom Health Logs, including path, body, and JSON path selection
Before you begin
Continuous Verification setup: Complete the shared AI Verify (v1) step and health source prerequisites first. Go to Configure Continuous Verification to configure CV.
Fixed service and environment: Adding a Custom Health Source is available only when the service and environment are configured as fixed values.
Connector: You need a connector that can reach your custom metrics or logs endpoint.
Add a custom health source
A health source maps a Harness service to the service in a deployment environment that an APM or logging tool monitors.
In Health Sources, click Add. The Add New Health Source settings appear.

Perform the following steps to add the health source:
In Select health source type, select Custom Health.
In Health Source Name, enter a name for the health source. For example,
Quickstart.In Connect Health Source, click Select Connector.
In Connector settings, choose an existing connector or click New Connector.
Click Apply Selected. The connector is added to the health source.
In Select Feature, select the feature to monitor: Custom Health Metrics or Custom Health Logs.
Click Next.
Custom Health Metrics
If you select Custom Health Metrics, the Customize Health Source settings appear.

Perform the following steps to map metrics:
Click Map Metric(s) to Harness Services.
In Metric Name, enter the name of the metric.
In Group Name, click Add New and enter a name for the metric group.
Click Query specifications and mapping.
In Query Type, choose either Service Based (used for Health Score and SLI) or Host Based (used for CV). If you select Host Based (Continuous Verification), verification does not run for SLI and Health Score (Service Based), and the reverse is also true.
In Request Method, select GET or POST. If you select POST, define the body format.
In Path, enter the complete path of the metric.
In Start and End Time Placeholders, configure the following fields:
In Start time placeholder, enter the start time placeholder in the metric path.
In Unit, select the preferred unit of measurement.
In End time placeholder, enter the end time placeholder in the metric path.
In Unit, select the preferred unit of measurement.
Click Fetch Records to retrieve records from the provided URL.
Click Metric values and charts. For each path, click the + icon to select the appropriate path from the data source.
For Metric Value Json Path, provide a JSON path with at least two
*segments.For Timestamp Value Json Path, provide a JSON path with at least two
*segments.For Service Instance Identifier Json Path, provide a JSON path with at least one
*segment.In Timestamp Format, enter a static value in
dd/mm/yyformat.
Click Assign. Select the services for which you want to apply the metric. You can select Health Score, SLI, or both. The next fields depend on the services you select.
In Risk Category, select a risk type. Available options are:
Errors
Infrastructure
Performance/Throughput
Performance/Other
Performance/Response Time
In Deviation compared to Baseline, select one of the following options based on the selected risk type:
Higher value is higher risk: Select this option if a higher value of the selected risk type is a risk.
Lower value is higher risk: Select this option if a lower value of the selected risk type is a risk.
Click Submit.
Custom Health Logs
If you select Custom Health Logs, the Customize Health Source settings appear.

Perform the following steps to map logs:
Click Query specifications and mapping.
In Query Name, enter a name for the query. For example,
Custom Log Query.In Request Method, select GET or POST. If you select POST, define the body format.
In Path, enter the complete path of the metric. For example,
v2/logs/events/search.In Start and End Time Placeholders, configure the following fields:
In Start time placeholder, enter the start time placeholder in the metric path. For example,
start_time.In Unit, select the preferred unit of measurement. For example, Milliseconds.
In End time placeholder, enter the end time placeholder in the metric path. For example,
end_time.In Unit, select the preferred unit of measurement. For example, Milliseconds.
In Body, enter the request body. For example,
{"filter":{"query":","from":start_time,"to":end_time}}.Click Fetch Records to retrieve records from the provided URL.

After the response is retrieved, click JSON path selection.
In Log Message JSON path, click the plus icon to select the path to the log message from the data source. For example,
$.data.[*].attributes.message.In Timestamp Field/Locator JSON Path, click the plus icon to select the path to the timestamp from the data source. For example,
$.data.[*].attributes.timestamp.In Provide Service Instance to map to Harness Service Instance, click the plus icon to select the service instance from the data source. For example,
$.data.[*].attributes.tags.[4].

Click Submit.
Next steps
Configure Continuous Verification: Finish AI Verify (v1) step settings and run verification.
CloudWatch Logs: Use CloudWatch Logs as a health source when you do not need a custom provider.
Interpret log results: Review how Harness presents log-based verification results.
Last updated
Was this helpful?