Monitor Applications 24/7 with Prometheus
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.
Harness 24/7 Service Guard differs from Deployment Verification in that it monitors the live microservice whereas Deployment Verification monitors the hosts and nodes for the first 15 minutes following steady state.
You can add your Prometheus monitoring to Harness 24/7 Service Guard in your Harness Application Environment. See Connect to Prometheus.
In this topic:
- Before You Begin
- Visual Summary
- Step 1: Set Up 24/7 Service Guard for Prometheus
- Step 2: Display Name
- Step 3: Service
- Step 4: Prometheus Server
- Step 5: Metric to Monitor
- Step 6: Custom Thresholds
- Step 7: Algorithm Sensitivity
- Step 8: Enable 24/7 Service Guard
- Next Steps
Before You Begin
- Set up a Harness Application, containing a Service and Environment. See Create an Application.
- See the Prometheus Verification Overview.
Here's an example of a 24/7 Service Guard configuration for Prometheus.
Step 1: Set Up 24/7 Service Guard for Prometheus
To set up 24/7 Service Guard for Prometheus, do the following:
- Ensure that you have added Prometheus as a Harness Verification Provider, as described in Connect to Prometheus.
- 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 Prometheus. The Prometheus dialog appears.
The Prometheus dialog has the following fields.
Step 2: Display Name
Enter the name to identify this Service's Prometheus monitoring on the 24/7 Service Guard dashboard.
Step 3: Service
The Harness Service to monitor with 24/7 Service Guard.
Step 4: Prometheus Server
Select the server you added when setting up the Connect to Prometheus.
Step 5: Metric to Monitor
Every time series is uniquely identified by its metric name and a set of key-value pairs, also known as labels. For more information, see Data Model from Prometheus. A metric requires the following parameters:
- Metric Name: The name of the metric defined in Prometheus.
- Metric Type: The type of metric (Response Time, Error, Throughput, or Value).
- Group Name: The transaction (service or request context) which the metric relates to. For example, Login or Hardware.
- Query: The API query required to retrieve the metric value.
You can simply obtain your query from Prometheus and paste it into Harness.
For example, here is a query in Prometheus:
See Expression queries from Prometheus for example of queries, but always use the placeholders demonstrated above.
Step 6: Custom Thresholds
In the Custom Thresholds section, you can define Ignore Hints. These are rules that instruct Harness to skip certain metrics/value combinations from verification analysis.
To configure these rules, see Apply Custom Thresholds to 24/7 Service Guard.
Step 7: Algorithm Sensitivity
Step 8: Enable 24/7 Service Guard
Click the checkbox to enable 24/7 Service Guard.