Star

linkMonitors

Inside config/ folder there is a file called monitors.yaml. We will be adding our monitors here. Please note that your yaml must be valid. It is an array.

linkUnderstanding monitors

Each monitor runs at 1 minute interval by default. Monitor runs in below priorty order.

Sample

1link- name: Google Search

2link description: Search the world's information, including webpages, images, videos and more.

3link tag: "google-search"

4link image: "/google.png"

5link cron: "* * * * *"

6link defaultStatus: "UP"

7link api:

8link timeout: 4000

9link method: POST

10link url: https://www.google.com/webhp

11link headers:

12link Content-Type: application/json

13link body: '{"order_amount":1,"order_currency":"INR"}'

14link eval: |

15link (function(statusCode, responseTime, responseDataBase64){

16link const resp = JSON.parse(atob(responseDataBase64));

17link return {

18link status: statusCode == 200 ? 'UP':'DOWN',

19link latency: responseTime,

20link }

21link })

nameRequiredThis will be shown in the UI to your users. Keep it short and unique
nameRequired + UniqueThis will be shown in the UI to your users. Keep it short and unique
descriptionOptionalThis will be show below your name
tagRequired + UniqueThis is used to tag incidents created in Github using comments
imageOptionalTo show a logo before the name
cronOptionalUse cron expression to specify the interval to run the monitors. Defaults to * * * * * i.e every minute
api.timeoutOptionaltimeout for the api in milliseconds. Default is 10000(10 secs)
api.methodOptionalHTTP Method
api.urlOptionalHTTP URL
api.headersOptionalHTTP headers
api.bodyOptionalHTTP Body as string
api.evalOptionalEvaluator written in JS, to parse HTTP response and calculate uptime and latency
defaultStatusOptionalIf no API is given this will be the default status. can be UP/DOWN/DEGRADED
hiddenOptionalIf set to true will not show the monitor in the UI
categoryOptionalUse this to group your monitors. Make sure you have defined category in site.yaml and use the name attribute here
dayDegradedMinimumCountOptionalDefault is 1. It means minimum this number of count for the day to be classified as DEGRADED(Yellow Bar) in 90 day view. Has to be number greater than 0
dayDownMinimumCountOptionalDefault is 1. It means minimum this number of count for the day to be classified as DOWN(Red Bar) in 90 day view. Has to be number greater than 0
includeDegradedInDowntimeOptionalBy deafault uptime percentage is calculated as (UP+DEGRADED/UP+DEGRADED+DOWN). Setting it as true will change the calculation to (UP/UP+DEGRADED+DOWN)
ping.hostsV4OptionalArray of hosts / IP to monitor ping response. Either domain name or IP4
ping.hostsV6OptionalArray of hosts / IP to monitor ping response. Either domain name or IP6

linkcron

Kener fills data every minute in UTC so if you give an expression that is not per minute, kener will backfill data using the latest status. Example for cron: "*/15 * * * *"

Kener will fill data from 18:01:00 to 18:14:00 as UP

linkeval

This is a anonymous JS function, by default it looks like this.

NOTE: The eval function should always return a json object. The json object can have only status(UP/DOWN/DEGRADED) and lantecy(number) {status:"DEGRADED", latency: 200}.

1link(function (statusCode, responseTime, responseDataBase64) {

2link let statusCodeShort = Math.floor(statusCode/100);

3link let status = 'DOWN'

4link if(statusCodeShort >=2 && statusCodeShort <= 3) {

5link status = 'UP',

6link }

7link return {

8link status: 'DOWN',

9link latency: responseTime,

10link }

11link})

1linklet decodedResp = atob(responseDataBase64);

2link//let jsonResp = JSON.parse(decodedResp)

MonitorsUnderstanding monitorscroneval

Home Quick Start How it works Environment Variables Deployment Github Setup Customize Site Internationalization Monitors Monitor Examples Incident Management Kener APIs Status Badges Showcase