3 - 24/7 Service Guard for Custom Metrics
Harness 24/7 Service Guard monitors your live applications, catching problems that surface minutes or hours following deployment. For more information, see 24/7 Service Guard Overview.
While Harness supports all of the common metrics tools, you can add your Custom metrics to Harness 24/7 Service Guard in your Harness Application Environment. For a setup overview, see 1 - Custom Verification Connection Setup.
24/7 Service Guard Setup
To set up 24/7 Service Guard for custom metrics, do the following:
- Ensure that you have added your Custom Verification provider as a Harness Verification Provider, as described in Verification Provider Setup.
- In your Harness Application, ensure that you have added a Service, as described in Services. For 24/7 Service Guard, you do not need to add an Artifact Source to the Service, or configure its settings. You simply need to create a Service and name it. It will represent your application for 24/7 Service Guard.
- In your Harness Application, click Environments.
- In Environments, ensure that you have added an Environment for the Service you added. For steps on adding an Environment, see Environments.
- Click the Environment for your Service. Typically, the Environment Type is Production.
- In the Environment page, locate 24/7 Service Guard.
- In 24/7 Service Guard, click Add Service Verification, and then click Custom APM Verification.
The Custom APM Verification dialog appears.
Fill out the dialog. The dialog has the fields described below.
Custom APM Verification Settings
Fill in these basic settings at the top of the dialog.
Enter the name that will identify this 24/7 Service Guard monitoring in Harness' Continuous Verification page.
Select the Harness Service that represents your live, production application or service.
Metrics Data Server
Select the custom metric provider you added, described in Metrics Data Provider.
Select Infrastructure or Transaction.
Click Add to add a new metric collection. This displays the dialog shown below.
Metrics Collection Settings
In the resulting New Metrics Collection dialog, use the following controls to define a metrics collection.
Enter a name for the metrics you want analyzed, such as ThreadCount.
For the Infrastructure Metrics Type, select the type of metric you want to collect:
For the Transaction Metrics Type, select the type of metric you want to collect:
Metrics Collection URL
Enter a query for your verification. You can simply make the query in your Verification Provider and paste it in the Metrics Collection URL field.
You will use this query to obtain the JSON paths for the Response Mapping settings.
In most cases, you will want to add the placeholders
Select GET or POST. If you select POST, the Metric Collection Body field appears.
In Metric Collection Body, enter the JSON body to send as a payload when making a REST call to the APM Provider. The requirements of the JSON body will depend on your APM provider.
You can use variables you created in the Service and Workflow in the JSON, as well as Harness built-in variables.
These settings are for specifying which JSON fields in the responses to use for monitoring.
Select Fixed or Dynamic.
Fixed: Use this option when all metrics are for the same transaction. For example, a single login page.
Dynamic: Use this option when the metrics are for multiple transactions
Enter a name to identify the transaction.
Transaction Name Path (Dynamic)
This is the JSON label for identifying a transaction name.
For example, in a New Relic Insights query, the FACET clause is used to group results by the attribute transactionName. You can obtain the field name that records the transactionName by using the Guide From Example feature:
Regex to transform Transaction Name (Dynamic)
Enter a regex expression here to obtain the specific name from the transaction path.
For example, if your Transaction Name Path JSON evaluated to a value such as
Specify the value for the event count. This is used to filter and aggregate data returned in a SELECT statement. To find the correct label for the value, do the following:
Specify the value for the timestamp in the query. To find the correct label for the value, do the following:
The JSON path is added to the Timestamp path:
Enter a timestamp format. The format follows the Java SimpleDateFormat. For example, a timestamp syntax might be yyyy-MM-dd'T'HH:mm:ss.SSSX. If you leave this field empty, Harness will use the default range of 1 hour previous (now-1h) to now.
Once you have filled in the New Metrics Collection dialog, click Test to check your settings. Once they test successfully, click Add to add this collection to the Custom APM Verification settings.
This restores the Custom APM Verification dialog. Here, you have the option to click Add to define additional metrics collections, using the options just outlined.
In the Custom APM Verification dialog, you can access the Custom Thresholds section once you have configured at least one Metrics Collection. Within Custom Thresholds, you can define Ignore Hints rules that instruct Harness to remove certain metrics/value combinations from 24/7 Service Guard analysis.
For details about defining Custom Thresholds, see Apply Custom Thresholds to 24/7 Service Guard.
Sensitivity and Enabling Settings
Use these two remaining controls to complete the Custom APM Verification settings:
Select the Algorithm Sensitivity. See CV Strategies, Tuning, and Best Practices.
Enable 24/7 Service Guard
Select this check box to enable 24/7 Service Guard.
When you are finished, the Custom APM Verification Settings dialog will look something like this:
Click Submit. The Custom Metrics 24/7 Service Guard verification is added.
Seeing Verification Results
To see the running 24/7 Service Guard analysis, click Continuous Verification.
The 24/7 Service Guard dashboard displays the production verification results.