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
occurrencesortimeslices. -
A description for the SLO.
-
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
-
Defines properties for SLO settings.
-
Defines properties for the SLO time window
POST
/s/{spaceId}/api/observability/slos
curl \
--request POST 'https://localhost:5601/s/default/api/observability/slos' \
--header "Authorization: $API_KEY" \
--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 <= 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"
}
}'