Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Monitor Configuration

Monitor configurations define how Stylus tests your infrastructure components. Each monitor consists of a test script that runs on a schedule and reports the status back to Stylus.

Monitor Types

Stylus supports several types of monitors:

Logging

Output from the test's standard output and standard error streams are captured and available from the logging endpoint.

Monitor States

The state of a monitor is determined by the return value of the test script or manually set by scripts/expressions. The six states, in order of precedence, are:

StateDescriptionHow it's set
Red🔴Tests that fail by returning a value other than zeroAutomatic (exit code ≠ 0)
Orange🟠Warning stateManual (scripts/expressions)
Yellow🟡A test that has timed outAutomatic (timeout)
Blue🔵Highlight stateManual (scripts/expressions)
Green🟢Tests that return zero (success)Automatic (exit code = 0)
BlankA test that has not run or completed yetAutomatic (initial state)

Metadata

Tests scripts may also set metadata associated with the run. More information on this is available in Advanced Configuration.

Testing Your Configurations

Since monitor scripts with metadata can be tricky to get right, Stylus includes a stylus test command that lets you develop your test script interactively. The output shows your script's stdout and stderr, plus the parsed monitor state as JSON, and the final rendered CSS.