Create an SLO
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
indicator object Required
-
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.
Responses
-
200 application/json; Elastic-Api-Version=2023-10-31
Successful request
-
400 application/json; Elastic-Api-Version=2023-10-31
Bad request
-
401 application/json; Elastic-Api-Version=2023-10-31
Unauthorized response
-
403 application/json; Elastic-Api-Version=2023-10-31
Unauthorized response
-
409 application/json; Elastic-Api-Version=2023-10-31
Conflict - The SLO id already exists
curl \
-X POST https://localhost:5601/s/default/api/observability/slos \
-H "Content-Type: application/json; Elastic-Api-Version=2023-10-31" \
-H "kbn-xsrf: string"
# 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"
},
"tags": [
"string"
],
"timeWindow": {
"duration": "30d",
"type": "rolling"
}
}
{
"id": "8853df00-ae2e-11ed-90af-09bb6422b258"
}
{
"error": "Bad Request",
"message": "Invalid value 'foo' supplied to: [...]",
"statusCode": 400
}
{
"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
}
{
"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
}
{
"error": "Conflict",
"message": "SLO [d077e940-1515-11ee-9c50-9d096392f520] already exists",
"statusCode": 409
}