Build a SLI
This guide walks you through creating a Service Level Indicator (SLI) in slaOS
SLIs are key metrics that measure specific aspects of your service's performance and reliability. By following these steps, you'll learn to configure effective SLIs to monitor your service quality.
Create a Value SLI
Follow these steps to create a Value Service Level Indicator (SLI):
Find and click on "Indicators" in the side navigation bar
Click the "+ New SLI" button to open the Create SLI modal
Choose "Value" as the type of SLI you'll be building
Choose a metric query, aggregator, and filter
Allowed aggregators:
COUNT,SUM,MAX,MIN,AVGn/ais also an acceptable input; this will output an array of metrics without any aggregationYou can create multiple queries by clicking "+ New Query" and add a formula in the formula box to define the relationship between them.
Operators allowed on the formula builder:
*,/,+,-,<,>,<=,>=,=,!=
Provide a clear, descriptive name for your SLI and a description to explain its purpose and function.
Click the "Save" button to create your new Value SLI.
Examples
QUERY
A: SELECT {n/a} {latency_metric} FROM {key} WHERE {status_code < 500}
Unit ms
Example implementation π

This SLI will output a stream of latencies like {121,90,48,291,44,29,90,81...} seconds
QUERY
A: SELECT {AVG} {latency_metric} FROM {key} WHERE {status_code < 500}
Unit ms
Example Implementation π

This SLI will output a the average latency of all the latencies sent within a period. For example, if the latencies sent were {121,90,48,291,44,29,90,81} seconds, the output of which would be 99.25 seconds.
QUERY
A: SELECT {n/a} {external_timestamp_metric} FROM {key1}
B: SELECT {n/a} {internal_timestamp_metric} FROM {key2}
Unit epochs
Formula: A - B
Example implementation π

This SLI will output a stream of integers like {2,5,1,1,2,1,1,3,...} epochs.
QUERY
A: SELECT {AVG} {external_timestamp_metric} FROM {key1}
B: SELECT {AVG} {internal_timestamp_metric} FROM {key2}
Formula: A - B
Unit epochs
Example implementation π

This SLI will output the average data freshness within a period. For example, if the external_timestamp averages to 1.2 epochs and the internal_timestamp averages out to 1 epoch, the SLI will output 0.2 epochs.
Create a Percentage SLI
Follow these steps to create a Percentage Service Level Indicator (SLI):
Find and click on "Indicators" in the side navigation bar
Click the "+ New SLI" button to open the Create SLI modal
Choose "Percentage" as the type of SLI you'll be building
Choose a metric query, aggregator, and filter
Allowed aggregators:
COUNT,SUM,MAX,MIN,AVGn/ais also an acceptable input; this will output an array of metrics without any aggregationYou can create multiple queries by clicking "+ New Query" and add a formula in the formula box to define the relationship between them
Operators allowed on the formula builder:
*,/,+,-,<,>,<=,>=,=,!=
Provide a clear, descriptive name for your SLI and a description to explain its purpose and function
Click the "Save" button to create your new Percentage SLI
Examples
QUERY
A: SELECT {count} {*} FROM {key1} WHERE {status_code < 500}
B: SELECT {count} {*} FROM {key2}
Formula : A/B
Example implementation π

The SLI will output a ratio, where the numerator counts all the events where the status code is less than 500 and the denominator is all events.
QUERY
A: SELECT {n/a} {uptime_metric} FROM {key}
Example implementation π

The SLI will output the average of the uptime metric over a time period. For example, if the uptime metric is passed hourly to slaOS as {0.9998, 0.9992, 0.9892, 0.4819, 0.9999, 0.9759}, the SLI output will be 0.90765 or 90.965%
QUERY
A: SELECT {count} {*} FROM {key1} WHERE {status_code >= 500}
B: SELECT {count} {*} FROM {key2}
Formula : A/B
Example implementation π

The SLI will output a ratio, where the numerator counts all the events where the status code is more than 500 and the denominator is all events.
Last updated

