Probes are the heart of the monitoring requests. Probes are arrays of request objects defined in the config file
monika.yml like so.
Monika goes through each probe object, sends it out, and determines whether an alert or notification needs to be sent out.
An actual probe request may be something like below.
Details of the field are given in the table below.
|method||Http method such as GET, POST, PUT, DELETE.|
|url||This is the url endpoint to dispatch the request to.|
|timeout||Request timeout, after which time, |
|headers||Http headers you might need for your request.|
|body||Any http body if your method requires it.|
|interval (optional)||Number of probe's interval (in seconds). Default value is 10 seconds.|
|incidentThreshold (optional)||Number of times an alert should return true before Monika sends notifications. For example, when incidentThreshold is 3, Monika will only send notifications when the probed URL returns non-2xx status 3 times in a row. After sending the notifications, Monika will not send notifications anymore until the alert status changes. Default value is 5.|
|recoveryThreshold (optional)||Number of times an alert should return false before Monika sends notifications. For example, when recoveryThreshold is 3, Monika will only send notifications when the probed URL returns status 2xx 3 times in a row. After sending the notifications, Monika will not send notifications anymore until the alert status changes. Default value is 5.|
|alerts||The condition which will trigger an alert, and the subsequent notification method to send out the alert. See below for further details on alerts and notifications.|
|saveBody (optional)||When set to true, the response body of the request is stored in the internal database. The default is off when not defined. This is to keep the log file size small as some responses can be sizable. The setting is for each probe request.|
|alerts (optional)||See alerts section for detailed information.|
|ping (optional)||(boolean), If set true then send a PING to the specified url instead.|
You can send an ICMP echo request to a specific url by enabling the
ping: true field.
In this mode the http method is ignored and a PING echo request is sent to the specified url.
You can send a TCP request to a specific
data by using the
The default shape of a response when Monika has successfully fetched a request is as the following.
Details of the fields are shown in the table below.
|status||HTTP Status Code (e.g 200, 403, 500)|
|statusText||HTTP Status Code Explanation (e.g OK, Forbidden, Internal Server Error)|
|config||Request configuration (e.g URL, Method, Data, Headers, Body, etc.)|
|headers||Response headers from the fetched request (e.g SetCookie, ETag, etc.).|
|data||Response payload from the fetched request (e.g token, results, data).|
Probe response data could be used for Request Chaining.
In a configuration with multiple probes,
Monika will load the requests in the order that they are entered, one after another. However, probes may be performed out of sequence depending on their interval setting, network latency and response times. By default Monika loops through all the probe configurations in the order they are entered, but you can use the
--id or the
--repeat flags to specify or repeat a particular sequence. See the cli options here for more information.
In general, Monika will sleep until the next
interval timer to repeat a probe. If no
interval time is specified for a probe, the default value will be used. If the configured probe
interval is shorter than the amount of time to dispatch all the requests, then
Monika will immediately repeat after the last response and any notification alerts sent.
Currently, Monika only supports Content-Type value
application/json with UTF-8 encoding.
By default, the request body will be treated as-is. If the request header's
Content-Type is set to
application/x-www-form-urlencoded, it will be serialized into URL-safe string in UTF-8 encoding.
NOTE: We only support Postman collection v2.0 and v2.1 files.
To run monika using a Postman JSON file, use
--postman flag as follows:
Monika supports Insomnia collection file in version 4 format. Both
yaml files are supported.
To run Monika using an Insomnia collection file, use
--insomnia flag as follows:
HAR HTTP-Archive format was created by the Web Performance Working Group and has become the standard in browser archive request data definition. To run monika using a HAR file, use
--har flag as follows:
PT Artha Rajamas Mandiri (Hyperjump) is an open-source-first company providing engineering excellence service. We aim to build and commercialize open-source tools to help companies streamline, simplify, and secure the most important aspects of its modern DevOps practices.
Copyright © 2022 Hyperjump Tech. All Rights Reserved.