Create an SLO
You must have all
privileges for the SLOs feature in the Observability section of the Kibana feature privileges.
Path parameters
-
spaceId
string Required An identifier for the space. If
/s/
and the identifier are omitted from the path, the default space is used.
Body
Required
-
budgetingMethod
string Required The budgeting method to use when computing the rollup data.
Values are
occurrences
ortimeslices
. -
description
string Required 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 -
name
string Required A name for the SLO.
-
objective
object Required Defines properties for the SLO objective
-
settings
object Defines properties for SLO settings.
-
timeWindow
object Required 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 \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"}}'