[//]: # (werk v2)
# Synthetic Monitoring: Re-work Keyword Monitoring
key | value
---------- | ---
date | 2024-09-17T09:43:05+00:00
version | 2.4.0b1
class | feature
edition | cee
component | checks
level | 2
compatible | no
Version 2.3 offered the option to monitor the runtime of Robot Framework (RF) keywords.
This was
possible via the option _Maximum Keyword runtime_ in the ruleset _Robotmk test_. However,
this
option was hard to use because the resulting metric names were not robust to modifications
of
the test definition. Moving, adding or deleting keywords resulted in shifting metric
names, which
rendered the recorded metric histories hard to interpret.
To address this issue, the monitoring of keywords (formerly as an accessory to test
monitoring)
has been expanded into an independent Key Performance Indicator (KPI) monitoring in
version 2.4. The
option _Maximum Keyword runtime_ has been removed from the _Robotmk test_ ruleset.
Instead, Checkmk
now offers two distinct mechanisms for monitoring KPIs:
1. **Pattern-based approach**: There is a new service discovery ruleset called _Robotmk
KPI
discovery_. This ruleset offers the option to discover keywords based on regular
expressions.
However, contrary to before, the matched RF keywords must be unique per RF test.
Furthermore, each
matched keyword now results in a separate service.
2. **Marker-based approach**: To overcome the limitation of unique keywords per RF test,
version 2.4
additionally introduces the option to mark RF keywords directly in the test definitions as
KPIs to
be monitored by Checkmk. To this end, we introduce a
[dedicated RF keyword
library](https://pypi.org/project/robotframework-robotmklibrary).
For now,
this library exposes one keyword only, namely `Monitor Subsequent Keyword Runtime`. This
keyword
marks the subsequent keyword as a KPI that will be monitored with a separate service by
Checkmk.
Users can optionally specify an identifier for this KPI that will be used in the
corresponding
service name. This enables monitoring multiple KPIs that are based on the same underlying
RF
keyword.
In both cases, thresholds for the KPI runtime are configurable via the new ruleset
_Robotmk KPI
monitoring_.
These changes are marked as incompatible because no automatic migration from 2.3 to 2.4 is
possible.
When updating to 2.4, the patterns previously configured below the _Maximum Keyword
runtime_ option
will be dropped.