×
Help - SLO Unit Test Helper
This tool helps you visualize SLO (Service Level Objective) scenarios by defining series of good and bad
events over time.
Input Fields:
- Good/Bad Events:
Define event series using a prometheus alert format.
- A good/bad serie is defined by a series of segments.
- A segment is defined by
[initial]+[increment]x[steps].
initial: The starting value for this segment. Use # to use the last
value from the previous segment.
increment: The value to add at each step within this segment.
steps: The number of data points in this segment.
- The character
# has special meaning in this tool:
- Computes the initial value for the next segment from the last value of the previous segment.
- This is not a valid value in Prometheus.
- You get the real expression for Prometheus after the input box
- It is used to continue the series from the last value of the previous segment.
- Example:
0+0x10 10+1x10 #+3x10
- starts at 0, and repeats 0 for 10 steps
- then jumps to 10 and increments by 1 for another 10 steps
- by using
# we use the last value from the previous segment (20) as the initial
value for the next segment
- then continues from the last value with 3 increment for 10 steps
- Threshold 1 & 2: These are the threshold values for
alert1 and
alert2 series respectively.
- For Proportion Rate over N: Thresholds are typically small numbers (e.g., 0.01 for
1%).
- For Count over N: Thresholds represent a sum of bad events (e.g., 100).
- This means that only the bad events is useful for the alerting.
- Alert1 Range (short): The window size (number of data points) used to calculate the
alert1 series.
- Alert2 Range (long): The window size for the
alert2 series.
Controls:
-
Highlight Alert Checkbox:
- Toggles the visual highlighting on the chart (red area)
-
Highlighting occurs when both of the following conditions are true:
alert1 is above threshold1
alert2 is above threshold2
-
Debounce Alert Checkbox:
- Enables alert debouncing.
-
If checked, highlights will only appear if:
- The alert condition (
alert1 > threshold1 AND alert2
> threshold2)
- persists for the specified "Debounce Time".
-
Debounce Time (steps):
-
The number of consecutive data points an alert condition must be true before it's visually
highlighted.
-
Only applies if "Debounce alert" is checked.
- Show Time Format Checkbox: Toggles between showing step numbers and time format (e.g.,
"1h 30m") on the chart axis and tooltips. Time format uses the configured interval setting.
- Interval: Specifies the time between samples. Supports seconds (s), minutes (m), hours
(h), and days (d). Examples: "1m" (1 minute), "5m" (5 minutes), "1h" (1 hour), "30s" (30 seconds). Default
is "1m".
- Formula Selector: Choose the calculation method for
alert1 and
alert2 series:
- Proportion Rate over N: Calculates
sum(bad events in window) / (sum(bad events in window) + sum(good events in window)).
This is a ratio, typically between 0 and 1.
- Count over N: Calculates
sum(bad events in window). This is an
absolute count/sum of bad events over the specified window. It only uses the 'bad events' series for
its calculation.
Chart Features:
- Series Display: The chart shows multiple series including alert1, alert2, thresholds,
raw bad/good events (hidden by default), and their rates (hidden by default). You can toggle series
visibility in the chart legend.
- Zoom and Pan: The chart supports zooming and panning for detailed analysis. Use mouse
wheel to zoom and drag to pan.
- Tooltips: Hover over data points to see detailed values. Tooltips show step number or
time format based on the "Show Time Format" setting.
- Auto-update: The chart automatically updates when you modify any input values. Changes
to bad/good events are throttled to prevent excessive updates.
Advanced Series Syntax:
- Special Values: Use
_ for special values that don't affect calculations
(e.g., _x5 for 5 special values).
- Decimal Values: Support for decimal numbers in series definitions (e.g.,
0.5+0.1x2).
- Negative Values: Support for negative initial values and decrements (e.g.,
-2+4x3 or 1-2x4).
- Shorthand Notation: Use
axn as shorthand for a+0xn (constant
value for n+1 steps).
Data Persistence:
All your configuration settings are automatically saved to your browser's localStorage, so they will
persist between sessions.
Testing:
Add ?test=true to the URL to run unit tests in the browser console, which verify the core
functionality of the series parsing and calculation functions.