BlyxDocumentation
Browse chapters
Documentation / Workflow recipes

Plover · Gate an alert on short and long error windows

Gate alerts on error-budget burn in both a short and a long window.

Gate an alert on short and long error windows

A brief burst or stale long-window average can trigger a noisy alert on its own. Require both windows to cross the selected burn threshold. The short window burns four times its error budget and the long window burns twice. Both reach the selected threshold.

Run the framework with your own input

Install Blyx 0.2.1 and a Rust toolchain with a host linker, then run the versioned project. Each positional argument is a number or a comma-separated numerical vector. The CLI accepts up to 16 entries per vector. The imported module accepts longer inputs.

git clone --depth 1 --branch v0.1.0 https://github.com/Rahulchaube1/blyx-plover.git
cd blyx-plover
blyxc native-run project.blyx -- 2 10 10 100 0.05 2

API and return values

Returns [alert, short burn, long burn, long-window excess failures]. The short window must be a subset of the long window, including its good events. Invalid input returns an empty vector.

ArgumentAccepted input
fast_badnonnegative exact integer
fast_totalpositive exact integer
slow_badnonnegative exact integer
slow_totalpositive exact integer
allowedpositive finite number
triggerpositive finite number

Use the libraries independently

The framework vendors the same library source published in these two repositories. Each module has its own package page, input contract and regression suite.

Try the program

Output Ready
Expected output
1
4
2
5
Open in the full playground →

Practice

Change slow_bad = 5.0. Predict the result, then run the program.

Hint

Returns [alert, short burn, long burn, long-window excess failures]. The short window must be a subset of the long window, including its good events.

Worked solution

The result vector is [0, 4, 1, 0]. Compare its fields with the return layout in the API section.

Find

    let slow_bad = 10.0;

Replace with

    let slow_bad = 5.0;

Output after the change

0
4
1
0