Manage monitors
StackState Self-hosted v5.1.x
Last updated
StackState Self-hosted v5.1.x
Last updated
Monitors process 4T data, such as metrics, events and topology, to produce a health state for elements (components and relations). The states are calculated and attached to relevant topology elements by a specific monitor function that's selected by the user.
Monitors are run by a dedicated subsystem of StackState called the monitor runner. The main task of the monitor runner is to schedule the execution of all existing monitors in such a way as to ensure that all of them produce viable results in a timely manner. The monitor runner is maintenance free - it starts whenever StackState starts and picks up any newly applied monitor definitions automatically whenever they're created, changed or removed. Any changes that have been applied to the monitors are reflected with the next execution cycle.
Most Monitors in StackState are created as part of a StackPack installed by the user with no further action required. The monitors are added upon installation of the StackPack and immediately start to produce health state results. Monitors automatically handle newly created topology elements and don't need to be specifically reconfigured after any topology changes occur or otherwise added to the newly created elements.
Details of the monitor functions provided by StackPacks can be found in .
You can from scratch using the StackState CLI.
It might be beneficial to modify an existing monitor definition to change its parameters, run interval or to disable it. All of these actions are done by utilizing the StackState CLI and are described in greater detail in the following sections.
Monitor configuration can be changed by modifying the monitor definition.
Find the ID or the identifier of the monitor to be modified. For example:
In the StackState UI: Inspect the monitor definition using the context menu (...) of the .
In the StackState CLI: List the monitors using sts monitor list
or stac monitor list
.
Export the monitor definition into a file named path/to/export.stj
:
new sts
CLI: sts settings describe --ids <id-of-a-monitor> -f path/to/export.stj
stac
CLI: stac monitor describe <id-or-identifier-of-a-monitor> > path/to/export.stj
Modify the exported file to change the monitor parameters
or intervalSeconds
.
Apply the changes to the monitor:
new sts
CLI: sts monitor apply -f path/to/export.stj
stac
CLI: stac monitor apply < path/to/export.stj
Once applied, the updated monitor definition will be in effect. Changes will be reflected with the next execution cycle.
The monitor runner schedules monitor execution using an interval parameter that's configured on a per-monitor basis - the intervalSeconds
. The runner will attempt to schedule a monitor execution every intervalSeconds
, counting from the end of the previous execution cycle, in parallel to the other existing monitors (subject to resource limits). For example, setting intervalSeconds
of a monitor definition to the value 600
will cause the monitor runner to attempt to schedule the execution of this monitor every ten minutes, assuming that the execution time itself is negligible.
For example, to run the monitor every 5 minutes, set the intervalSeconds
to 300
.
The status of a monitor can be obtained via the StackState CLI:
The output of this command indicates the specific errors that occurred along with the counts of how many times they happened and the health stream statistics associated with this monitor. Any execution issues are also logged in the global StackState log file.
You can use the CLI to run a monitor and preview its output without persisting its results.
Individual monitors can be disabled using the StackState CLI. To disable/enable a monitor:
Identify the monitor to enable/disable. This can be done by finding the monitor identifier or ID in the StackState UI or using the StackState CLI:
Inspect the monitor definition available under the context menu of a monitor result panel in the StackState UI.
Use the StackState CLI command sts monitor list
to retrieve details of all monitors.
Enable/disable the monitor using the StackState CLI:
To delete a monitor and remove it from StackState, use the StackState CLI:
The monitor runner subsystem can be disabled in the StackState configuration by appending the following line at the end of the file etc/application_stackstate.conf
:
stackstate.featureSwitches.monitorRunner = false
To set a new run interval for a monitor, adjust the intervalSeconds
parameter in the monitor STJ definition as described in the instructions to .
➡️
➡️
➡️
You can also to stop it running and producing health states without the need to completely delete it.
➡️