Kener also gives APIs to push data and create incident. Before you use kener apis you will have to set an authorization token called API_TOKEN
. This also has to be set as an environment variable.
1linkexport API_TOKEN=some-token-set-by-you
Additonally you can set IP whitelisting by setting another environment token called API_IP
or API_IP_REGEX
. If you set both API_IP
and API_IP_REGEX
, API_IP
will be given preference. Read more here
The update status API can be used to manually update the state of a monitor from a remote server.
Parameter | Description |
---|---|
status | Required Can be only UP/DOWN/DEGRADED |
latency | Required In Seconds. Leave 0 if not required |
timestampInSeconds | Optional Timestamp in UTC seconds. Defaults to now. Should between 90 Days and now |
tag | Required Monitor Tag set in monitors.yaml |
1linkcurl --request POST \
2link --url http://your-kener.host/api/status \
3link --header 'Authorization: Bearer some-token-set-by-you' \
4link --header 'Content-Type: application/json' \
5link --data '{
6link "status": "DOWN",
7link "latency": 1213,
8link "timestampInSeconds": 1702405860,
9link "tag": "google-search"
10link}'
1link{
2link "status": 200,
3link "message": "success at 1702405860"
4link}
This will update the status of the monitor with tag google-search
to DOWN at UTC 1702405860
Use this API to get the status of a monitor.
Replace google-search
with your monitor tag in query param
1linkcurl --request GET \
2link --url 'http://your-kener.host/api/status?tag=google-search' \
3link --header 'Authorization: Bearer some-token-set-by-you'
1link{
2link "status": "UP",
3link "uptime": "9.0026",
4link "lastUpdatedAt": 1706447160
5link}
Can be use to create an incident from a remote server
Parameter | Description |
---|---|
startDatetime | Optional When did the incident start in UTC second |
endDatetime | Optional When did the incident end in UTC seconds |
title | Required Title of the incident |
body | Optional Body of the incident |
tags | Required Array of String, Monitor Tags of the incident |
impact | Optional Can be only DOWN/DEGRADED |
isMaintenance | Optional Boolean if incident is a maintenance |
isIdentified | Optional Incident identified |
isResolved | Optional Incident resolved |
1linkcurl --request POST \
2link --url http://your-kener.host/api/incident \
3link --header 'Authorization: Bearer some-token-set-by-you' \
4link --header 'Content-Type: application/json' \
5link --data '{
6link "startDatetime": 1702405740,
7link "endDatetime": 1702405920,
8link "title": "Outage in Mumbai",
9link "body": "Login cluster is down in mumbai region",
10link "tags": ["google-search"],
11link "impact": "DOWN",
12link "isMaintenance": false,
13link "isIdentified": true,
14link "isResolved": false
15link}'
1link{
2link "createdAt": 1703940450,
3link "closedAt": null,
4link "title": "Outage in Mumbai",
5link "tags": ["google-search"],
6link "incidentNumber": 12,
7link "startDatetime": 1702405740,
8link "endDatetime": 1702405920,
9link "body": "Login cluster is down in mumbai region",
10link "impact": "DOWN",
11link "isMaintenance": false,
12link "isIdentified": true,
13link "isResolved": false
14link}
Can be use to update an incident from a remote server. It will clear values if not passed
incidentNumber
: Number of the incidentParameter | Description |
---|---|
startDatetime | Optional When did the incident start in UTC second |
endDatetime | Optional When did the incident end in UTC seconds |
title | Required Title of the incident |
body | Optional Body of the incident |
tags | Required Array of String, Monitor Tags of the incident |
impact | Optional Can be only DOWN/DEGRADED |
isMaintenance | Optional Boolean if incident is a maintenance |
isIdentified | Optional Incident identified |
isResolved | Optional Incident resolved |
1linkcurl --request PATCH \
2link --url http://your-kener.host/api/incident/{incidentNumber} \
3link --header 'Authorization: Bearer some-token-set-by-you' \
4link --header 'Content-Type: application/json' \
5link --data '{
6link "startDatetime": 1702405740,
7link "endDatetime": 1702405920,
8link "title": "Outage in Mumbai",
9link "body": "Login cluster is down in mumbai region",
10link "tags": ["google-search"],
11link "impact": "DOWN",
12link "isMaintenance": false,
13link "isIdentified": true,
14link "isResolved": false
15link}'
1link{
2link "createdAt": 1703940450,
3link "closedAt": null,
4link "title": "Outage in Mumbai",
5link "tags": ["google-search"],
6link "incidentNumber": 12,
7link "startDatetime": 1702405740,
8link "endDatetime": 1702405920,
9link "body": "Login cluster is down in mumbai region",
10link "impact": "DOWN",
11link "isMaintenance": false,
12link "isIdentified": true,
13link "isResolved": false
14link}
Use incidentNumber
to fetch an incident
1linkcurl --request GET \
2link --url http://your-kener.host/api/incident/{incidentNumber} \
3link --header 'Authorization: Bearer some-token-set-by-you' \
1link{
2link "createdAt": 1703940450,
3link "closedAt": null,
4link "title": "Outage in Mumbai",
5link "tags": ["google-search"],
6link "incidentNumber": 12,
7link "startDatetime": 1702405740,
8link "endDatetime": 1702405920,
9link "body": "Login cluster is down in mumbai region",
10link "impact": "DOWN",
11link "isMaintenance": false,
12link "isIdentified": true,
13link "isResolved": false
14link}
Add comments for incident using incidentNumber
1linkcurl --request POST \
2link --url http://your-kener.host/api/incident/{incidentNumber}/comment \
3link --header 'Authorization: Bearer some-token-set-by-you' \
4link --header 'Content-Type: application/json' \
5link --data '{
6link "body": "comment 1"
7link}'
1link{
2link "commentID": 1873376745,
3link "body": "comment 1",
4link "createdAt": 1704123938
5link}
Use this API to fetch all the comments for an incident
1linkcurl --request GET \
2link --url http://your-kener.host/api/incident/{incidentNumber}/comment \
3link --header 'Authorization: Bearer some-token-set-by-you' \
1link[
2link {
3link "commentID": 1873372042,
4link "body": "comment 1",
5link "createdAt": 1704123116
6link },
7link {
8link "commentID": 1873372169,
9link "body": "comment 2",
10link "createdAt": 1704123139
11link }
12link]
Use this to API to update the status of an ongoing incident.
Parameter | Description |
---|---|
isIdentified | Optional Boolean, set it when incident has been identified |
isResolved | Optional Boolean, set it when incident has been resolved |
endDatetime | Optional When did the incident end in UTC seconds |
1linkcurl --request POST \
2link --url http://your-kener.host/api/incident/{incidentNumber}/status \
3link --header 'Authorization: Bearer some-token-set-by-you' \
4link --header 'Content-Type: application/json' \
5link --data '{
6link "isIdentified": true,
7link "isResolved": false
8link "endDatetime": 1702405920
9link}'
1link{
2link "createdAt": 1703940450,
3link "closedAt": null,
4link "title": "Outage in Mumbai",
5link "tags": ["google-search"],
6link "incidentNumber": 12,
7link "startDatetime": 1702405740,
8link "endDatetime": 1702405920,
9link "body": "Login cluster is down in mumbai region",
10link "impact": "DOWN",
11link "isMaintenance": false,
12link "isIdentified": true,
13link "isResolved": false
14link}
Use this to API to search incidents.
Parameter | Description |
---|---|
state | Optional open or closed. Default is open |
tags | Optional Comma separated monitor tags, example: earth,google-seach |
page | Optional Page number, starts with 1, defaults to 1 |
per_page | Optional Page size, defaults to 10, max is 100 |
created_after_utc | Optional timestamp in UTC seconds when the incident was created after. Example: 1702405920 |
created_before_utc | Optional timestamp in UTC seconds when the incident was created before . Example: 1702405920 |
title_like | Optional search incidents with title |
Search incidents that are closed and title contains hello incident
1linkcurl --request POST \
2link --url http://your-kener.host/api/incident?state=closed&title_like=Hello%20Incident \
3link --header 'Authorization: Bearer some-token-set-by-you' \
4link --header 'Content-Type: application/json' \
5link --data '{
6link "isIdentified": true,
7link "isResolved": false
8link "endDatetime": 1702405920
9link}'
1link[
2link {
3link "createdAt": 1703940450,
4link "closedAt": null,
5link "title": "Outage in Mumbai - Hello Incident",
6link "tags": ["google-search"],
7link "incidentNumber": 12,
8link "startDatetime": 1702405740,
9link "endDatetime": 1702405920,
10link "body": "Login cluster is down in mumbai region",
11link "impact": "DOWN",
12link "isMaintenance": false,
13link "isIdentified": true,
14link "isResolved": false
15link }
16link]