Create an SLO Beta
You must have all
privileges for the SLOs feature in the Observability section of the Kibana feature privileges.
Path parameters
-
An identifier for the space. If
/s/
and the identifier are omitted from the path, the default space is used.
Body Required
-
The budgeting method to use when computing the rollup data.
Values are
occurrences
ortimeslices
. -
A description for the SLO.
groupBy string | array[string]
optional group by field or fields to use to generate an SLO per distinct value
-
id string
A optional and unique identifier for the SLO. Must be between 8 and 36 chars
-
A name for the SLO.
-
Defines properties for the SLO objective
Additional properties are allowed.
-
settings object
Defines properties for SLO settings.
Additional properties are allowed.
-
Defines properties for the SLO time window
Additional properties are allowed.
POST
/s/{spaceId}/api/observability/slos
curl \
--request POST https://<KIBANA_URL>/s/default/api/observability/slos \
--header "Content-Type: application/json" \
--header "kbn-xsrf: string" \
--data '{"budgetingMethod":"occurrences","description":"string","groupBy":[["service.name"],"service.name",["service.name","service.environment"]],"id":"my-super-slo-id","indicator":{"params":{"dataViewId":"03b80ab3-003d-498b-881c-3beedbaf1162","filter":"field.environment : \"production\" and service.name : \"my-service\"","good":"request.latency \u003c= 150 and request.status_code : \"2xx\"","index":"my-service-*","timestampField":"timestamp","total":"field.environment : \"production\" and service.name : \"my-service\""},"type":"sli.kql.custom"},"name":"string","objective":{"target":0.99,"timesliceTarget":0.995,"timesliceWindow":"5m"},"settings":{"frequency":"5m","preventInitialBackfill":true,"syncDelay":"5m","syncField":"event.ingested"},"tags":["string"],"timeWindow":{"duration":"30d","type":"rolling"}}'
Request examples
# Headers
kbn-xsrf: string
# Payload
{
"budgetingMethod": "occurrences",
"description": "string",
"groupBy": [
[
"service.name"
],
"service.name",
[
"service.name",
"service.environment"
]
],
"id": "my-super-slo-id",
"indicator": {
"params": {
"dataViewId": "03b80ab3-003d-498b-881c-3beedbaf1162",
"filter": "field.environment : \"production\" and service.name : \"my-service\"",
"good": "request.latency <= 150 and request.status_code : \"2xx\"",
"index": "my-service-*",
"timestampField": "timestamp",
"total": "field.environment : \"production\" and service.name : \"my-service\""
},
"type": "sli.kql.custom"
},
"name": "string",
"objective": {
"target": 0.99,
"timesliceTarget": 0.995,
"timesliceWindow": "5m"
},
"settings": {
"frequency": "5m",
"preventInitialBackfill": true,
"syncDelay": "5m",
"syncField": "event.ingested"
},
"tags": [
"string"
],
"timeWindow": {
"duration": "30d",
"type": "rolling"
}
}
Response examples (200)
{
"id": "8853df00-ae2e-11ed-90af-09bb6422b258"
}
Response examples (400)
{
"error": "Bad Request",
"message": "Invalid value 'foo' supplied to: [...]",
"statusCode": 400
}
Response examples (401)
{
"error": "Unauthorized",
"message": "[security_exception\n\tRoot causes:\n\t\tsecurity_exception: unable to authenticate user [elastics] for REST request [/_security/_authenticate]]: unable to authenticate user [elastics] for REST request [/_security/_authenticate]",
"statusCode": 401
}
Response examples (403)
{
"error": "Unauthorized",
"message": "[security_exception\n\tRoot causes:\n\t\tsecurity_exception: unable to authenticate user [elastics] for REST request [/_security/_authenticate]]: unable to authenticate user [elastics] for REST request [/_security/_authenticate]",
"statusCode": 403
}
Response examples (409)
{
"error": "Conflict",
"message": "SLO [d077e940-1515-11ee-9c50-9d096392f520] already exists",
"statusCode": 409
}