Request-based SLO
A request-based Service Level Objective (SLO) uses a Service Level Indicator (SLI), which calculates the ratio of successful requests to the total number of requests. It tells you how well a service is performing based on the ratio of successful requests to the total number of requests.
Let's say you have a website that allows users to search for products. To measure the SLI, you would track the number of search requests that were completed successfully (example: the user received the search results) and divide it by the total number of search requests made.
For example, if you had 100 search requests and 95 of them returned the expected results, then the SLI would be 95/100 = 0.95 or 95%. This means that 95% of the search requests were successful.
Prerequisites
A Harness Delegate. Ensure that you have installed a Harness Delegate that can communicate with Harness, your health source, and change sources. For more information, go to Get started with delegates.
An Organization in Harness. If you haven't already created one, go to Create organizations and projects.
A project in Harness. If you haven't already created one, follow these steps.
Steps to create a project in Harness.
- Health source connector. Ensure that your health source is connected to Harness. The health source can be a monitoring and logging system such as Prometheus. This enables Harness to collect health and performance metrics and monitor your SLO. For more information, go to Connect to Monitoring and Logging Systems.
Create a request-based SLO
To create a request based SLO, do the following:
In your Harness project, navigate to the Service Reliability module, and then select SLOs > + Create SLO.
The Create SLO page appears.
Enter SLO details
In the SLO details section, do the following:
- Enter a name for the SLO, an optional Description, and a Tag. Select a Monitored Service and a User Journey, and then select Next.
Configure Service Level Indicators (SLIs)
SLIs are tools you use to measure your service's performance. It helps you determine how close or far you are from meeting your SLO so that you can take corrective action if necessary.
In this section, you will configure a request-based SLI for your SLO. A request-based SLI is a measurement that tells you how well a service is performing based on the ratio of successful requests to the total number of requests.
To configure request-based SLIs, do the following:
- Select a Health Source to manage the service level. If you haven't already added a health source, follow these instructions.
Steps to add a health source.
Select the REQUEST tab.
From the Event type dropdown list, select the type of event that you want to measure. The available options are Good and Bad.
Select a metric from the dropdown list based on the event type you have chosen. The metric dropdown field varies depending on the event type selected. For example, if you have chosen the Good event type, you will see the Metric for good requests dropdown list, while if you have chosen the Bad event type, you will see the Metric for bad requests dropdown list.
From the Metric for valid requests dropdown list, select a metric for the valid requests.
When configuring SLIs, you will see a metric graph based on the last 24 hours of data received from your health monitoring tool. Additionally, the recommended minimum, maximum, and average values specific to the SLI parameter that you are configuring are also displayed. The metric graphs and accompanying suggested values help you determine the ideal percentage of valid requests for your SLI.
Set your SLO
To measure a SLO, you need to specify the time duration over which the target value for the SLI is evaluated. For example, if you want to measure the success rate of a web service for a week, you would set the compliance period to seven days. You would also set a target value for the success rate, such as 99%. This means that the service must have a success rate of 99% or higher over the specified period for the SLO to be considered met.
Configure the following settings to determine the compliance time period and target value for your SLO:
From the Period Type dropdown list, select a period type. The available options are Rolling and Calendar.
Depending on the period type you selected, choose the period length. For example, if you selected Rolling as the period type, you should select the number of days for the Period Length. If you selected Calendar as the period type, you should select the period length as either Weekly, Monthly, or Quarterly.
The Rolling period type calculates the compliance period based on the current time and the length of the period. For example, if you select a rolling period of seven days, the compliance period will always be the last seven days, regardless of the current date.
On the other hand, the Calendar period type sets fixed calendar periods for the compliance period, such as weekly, monthly, or quarterly. For example, if you select a monthly period length, the compliance period will always be the entire calendar month, regardless of when the measurement starts.
Save
Select Save to save the settings.
The request-based SLO appears on the Service Level Objectives (SLOs) page.