Update an SLO
You must have the write
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. -
An identifier for the slo.
Body Required
-
budgetingMethod string
The budgeting method to use when computing the rollup data.
Values are
occurrences
ortimeslices
. -
description string
A description for the SLO.
groupBy string | array[string]
optional group by field or fields to use to generate an SLO per distinct value
indicator object
One of: Defines properties for a custom query indicator type
Hide attributes Show attributes
-
An object containing the indicator parameters.
Additional properties are allowed.
Hide params attributes Show params attributes object
-
dataViewId string
The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.
-
The index or index pattern to use
-
The timestamp field used in the source indice.
-
-
The type of indicator.
Defines properties for the APM availability indicator type
Hide attributes Show attributes
-
An object containing the indicator parameters.
Additional properties are allowed.
Hide params attributes Show params attributes object
-
The APM service environment or "*"
-
filter string
KQL query used for filtering the data
-
The index used by APM metrics
-
The APM service name
-
The APM transaction name or "*"
-
The APM transaction type or "*"
-
-
The type of indicator.
Defines properties for the APM latency indicator type
Hide attributes Show attributes
-
An object containing the indicator parameters.
Additional properties are allowed.
Hide params attributes Show params attributes object
-
The APM service environment or "*"
-
filter string
KQL query used for filtering the data
-
The index used by APM metrics
-
The APM service name
-
The latency threshold in milliseconds
-
The APM transaction name or "*"
-
The APM transaction type or "*"
-
-
The type of indicator.
Defines properties for a custom metric indicator type
Hide attributes Show attributes
-
An object containing the indicator parameters.
Additional properties are allowed.
Hide params attributes Show params attributes object
-
dataViewId string
The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.
-
filter string
the KQL query to filter the documents with.
-
An object defining the "good" metrics and equation
Additional properties are allowed.
Hide good attributes Show good attributes object
-
The equation to calculate the "good" metric.
-
List of metrics with their name, aggregation type, and field.
Hide metrics attributes Show metrics attributes object
-
The aggregation type of the metric. Only valid option is "sum"
Value is
sum
. -
The field of the metric.
-
filter string
The filter to apply to the metric.
-
The name of the metric. Only valid options are A-Z
Format should match the following pattern:
^[A-Z]$
.
-
-
-
The index or index pattern to use
-
The timestamp field used in the source indice.
-
An object defining the "total" metrics and equation
Additional properties are allowed.
Hide total attributes Show total attributes object
-
The equation to calculate the "total" metric.
-
List of metrics with their name, aggregation type, and field.
Hide metrics attributes Show metrics attributes object
-
The aggregation type of the metric. Only valid option is "sum"
Value is
sum
. -
The field of the metric.
-
filter string
The filter to apply to the metric.
-
The name of the metric. Only valid options are A-Z
Format should match the following pattern:
^[A-Z]$
.
-
-
-
-
The type of indicator.
Defines properties for a histogram indicator type
Hide attributes Show attributes
-
An object containing the indicator parameters.
Additional properties are allowed.
Hide params attributes Show params attributes object
-
dataViewId string
The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.
-
filter string
the KQL query to filter the documents with.
-
An object defining the "good" events
Additional properties are allowed.
Hide good attributes Show good attributes object
-
The type of aggregation to use.
Values are
value_count
orrange
. -
The field use to aggregate the good events.
-
filter string
The filter for good events.
-
from number
The starting value of the range. Only required for "range" aggregations.
-
to number
The ending value of the range. Only required for "range" aggregations.
-
-
The index or index pattern to use
-
The timestamp field used in the source indice.
-
An object defining the "total" events
Additional properties are allowed.
Hide total attributes Show total attributes object
-
The type of aggregation to use.
Values are
value_count
orrange
. -
The field use to aggregate the good events.
-
filter string
The filter for total events.
-
from number
The starting value of the range. Only required for "range" aggregations.
-
to number
The ending value of the range. Only required for "range" aggregations.
-
-
-
The type of indicator.
Defines properties for a timeslice metric indicator type
Hide attributes Show attributes
-
An object containing the indicator parameters.
Additional properties are allowed.
Hide params attributes Show params attributes object
-
dataViewId string
The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.
-
filter string
the KQL query to filter the documents with.
-
The index or index pattern to use
-
An object defining the metrics, equation, and threshold to determine if it's a good slice or not
Additional properties are allowed.
Hide metric attributes Show metric attributes object
-
The comparator to use to compare the equation to the threshold.
Values are
GT
,GTE
,LT
, orLTE
. -
The equation to calculate the metric.
-
List of metrics with their name, aggregation type, and field.
Any of: Hide attributes Show attributes
-
The aggregation type of the metric.
Values are
sum
,avg
,min
,max
,std_deviation
,last_value
, orcardinality
. -
The field of the metric.
-
filter string
The filter to apply to the metric.
-
The name of the metric. Only valid options are A-Z
Format should match the following pattern:
^[A-Z]$
.
Hide attributes Show attributes
-
The aggregation type of the metric. Only valid option is "percentile"
Value is
percentile
. -
The field of the metric.
-
filter string
The filter to apply to the metric.
-
The name of the metric. Only valid options are A-Z
Format should match the following pattern:
^[A-Z]$
. -
The percentile value.
Hide attributes Show attributes
-
The aggregation type of the metric. Only valid option is "doc_count"
Value is
doc_count
. -
filter string
The filter to apply to the metric.
-
The name of the metric. Only valid options are A-Z
Format should match the following pattern:
^[A-Z]$
.
-
-
The threshold used to determine if the metric is a good slice or not.
-
-
The timestamp field used in the source indice.
-
-
The type of indicator.
-
-
name string
A name for the SLO.
-
objective object
Defines properties for the SLO objective
Additional properties are allowed.
Hide objective attributes Show objective attributes object
-
the target objective between 0 and 1 excluded
Minimum value is
0
, maximum value is100
. -
timesliceTarget number
the target objective for each slice when using a timeslices budgeting method
Minimum value is
0
, maximum value is100
. -
timesliceWindow string
the duration of each slice when using a timeslices budgeting method, as {duraton}{unit}
-
-
settings object
Defines properties for SLO settings.
Additional properties are allowed.
Hide settings attributes Show settings attributes object
-
frequency string
Configure how often the transform runs, default 1m
Default value is
1m
. -
preventInitialBackfill boolean
Prevents the transform from backfilling data when it starts.
Default value is
false
. -
syncDelay string
The synch delay to apply to the transform. Default 1m
Default value is
1m
.
-
-
tags array[string]
List of tags
-
timeWindow object
Defines properties for the SLO time window
Additional properties are allowed.
Hide timeWindow attributes Show timeWindow attributes object
-
the duration formatted as {duration}{unit}. Accepted values for rolling: 7d, 30d, 90d. Accepted values for calendar aligned: 1w (weekly) or 1M (monthly)
-
Indicates weither the time window is a rolling or a calendar aligned time window.
Values are
rolling
orcalendarAligned
.
-
Responses
-
200 application/json; Elastic-Api-Version=2023-10-31
Successful request
Hide response attributes Show response attributes object
-
The budgeting method to use when computing the rollup data.
Values are
occurrences
ortimeslices
. -
The creation date
-
The description of the SLO.
-
Indicate if the SLO is enabled
groupBy string | array[string] Required
optional group by field or fields to use to generate an SLO per distinct value
-
The identifier of the SLO.
indicator object Required
One of: Defines properties for a custom query indicator type
Hide attributes Show attributes
-
An object containing the indicator parameters.
Additional properties are allowed.
Hide params attributes Show params attributes object
-
dataViewId string
The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.
-
The index or index pattern to use
-
The timestamp field used in the source indice.
-
-
The type of indicator.
Value is
sli.kql.custom
.
Defines properties for the APM availability indicator type
Hide attributes Show attributes
-
An object containing the indicator parameters.
Additional properties are allowed.
Hide params attributes Show params attributes object
-
The APM service environment or "*"
-
filter string
KQL query used for filtering the data
-
The index used by APM metrics
-
The APM service name
-
The APM transaction name or "*"
-
The APM transaction type or "*"
-
-
The type of indicator.
Value is
sli.apm.transactionErrorRate
.
Defines properties for the APM latency indicator type
Hide attributes Show attributes
-
An object containing the indicator parameters.
Additional properties are allowed.
Hide params attributes Show params attributes object
-
The APM service environment or "*"
-
filter string
KQL query used for filtering the data
-
The index used by APM metrics
-
The APM service name
-
The latency threshold in milliseconds
-
The APM transaction name or "*"
-
The APM transaction type or "*"
-
-
The type of indicator.
Value is
sli.apm.transactionDuration
.
Defines properties for a custom metric indicator type
Hide attributes Show attributes
-
An object containing the indicator parameters.
Additional properties are allowed.
Hide params attributes Show params attributes object
-
dataViewId string
The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.
-
filter string
the KQL query to filter the documents with.
-
An object defining the "good" metrics and equation
Additional properties are allowed.
Hide good attributes Show good attributes object
-
The equation to calculate the "good" metric.
-
List of metrics with their name, aggregation type, and field.
Hide metrics attributes Show metrics attributes object
-
The aggregation type of the metric. Only valid option is "sum"
Value is
sum
. -
The field of the metric.
-
filter string
The filter to apply to the metric.
-
The name of the metric. Only valid options are A-Z
Format should match the following pattern:
^[A-Z]$
.
-
-
-
The index or index pattern to use
-
The timestamp field used in the source indice.
-
An object defining the "total" metrics and equation
Additional properties are allowed.
Hide total attributes Show total attributes object
-
The equation to calculate the "total" metric.
-
List of metrics with their name, aggregation type, and field.
Hide metrics attributes Show metrics attributes object
-
The aggregation type of the metric. Only valid option is "sum"
Value is
sum
. -
The field of the metric.
-
filter string
The filter to apply to the metric.
-
The name of the metric. Only valid options are A-Z
Format should match the following pattern:
^[A-Z]$
.
-
-
-
-
The type of indicator.
Value is
sli.metric.custom
.
Defines properties for a histogram indicator type
Hide attributes Show attributes
-
An object containing the indicator parameters.
Additional properties are allowed.
Hide params attributes Show params attributes object
-
dataViewId string
The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.
-
filter string
the KQL query to filter the documents with.
-
An object defining the "good" events
Additional properties are allowed.
Hide good attributes Show good attributes object
-
The type of aggregation to use.
Values are
value_count
orrange
. -
The field use to aggregate the good events.
-
filter string
The filter for good events.
-
from number
The starting value of the range. Only required for "range" aggregations.
-
to number
The ending value of the range. Only required for "range" aggregations.
-
-
The index or index pattern to use
-
The timestamp field used in the source indice.
-
An object defining the "total" events
Additional properties are allowed.
Hide total attributes Show total attributes object
-
The type of aggregation to use.
Values are
value_count
orrange
. -
The field use to aggregate the good events.
-
filter string
The filter for total events.
-
from number
The starting value of the range. Only required for "range" aggregations.
-
to number
The ending value of the range. Only required for "range" aggregations.
-
-
-
The type of indicator.
Value is
sli.histogram.custom
.
Defines properties for a timeslice metric indicator type
Hide attributes Show attributes
-
An object containing the indicator parameters.
Additional properties are allowed.
Hide params attributes Show params attributes object
-
dataViewId string
The kibana data view id to use, primarily used to include data view runtime mappings. Make sure to save SLO again if you add/update run time fields to the data view and if those fields are being used in slo queries.
-
filter string
the KQL query to filter the documents with.
-
The index or index pattern to use
-
An object defining the metrics, equation, and threshold to determine if it's a good slice or not
Additional properties are allowed.
Hide metric attributes Show metric attributes object
-
The comparator to use to compare the equation to the threshold.
Values are
GT
,GTE
,LT
, orLTE
. -
The equation to calculate the metric.
-
List of metrics with their name, aggregation type, and field.
Any of: Hide attributes Show attributes
-
The aggregation type of the metric.
Values are
sum
,avg
,min
,max
,std_deviation
,last_value
, orcardinality
. -
The field of the metric.
-
filter string
The filter to apply to the metric.
-
The name of the metric. Only valid options are A-Z
Format should match the following pattern:
^[A-Z]$
.
Hide attributes Show attributes
-
The aggregation type of the metric. Only valid option is "percentile"
Value is
percentile
. -
The field of the metric.
-
filter string
The filter to apply to the metric.
-
The name of the metric. Only valid options are A-Z
Format should match the following pattern:
^[A-Z]$
. -
The percentile value.
Hide attributes Show attributes
-
The aggregation type of the metric. Only valid option is "doc_count"
Value is
doc_count
. -
filter string
The filter to apply to the metric.
-
The name of the metric. Only valid options are A-Z
Format should match the following pattern:
^[A-Z]$
.
-
-
The threshold used to determine if the metric is a good slice or not.
-
-
The timestamp field used in the source indice.
-
-
The type of indicator.
Value is
sli.metric.timeslice
.
-
-
The name of the SLO.
-
Defines properties for the SLO objective
Additional properties are allowed.
Hide objective attributes Show objective attributes object
-
the target objective between 0 and 1 excluded
Minimum value is
0
, maximum value is100
. -
timesliceTarget number
the target objective for each slice when using a timeslices budgeting method
Minimum value is
0
, maximum value is100
. -
timesliceWindow string
the duration of each slice when using a timeslices budgeting method, as {duraton}{unit}
-
-
The SLO revision
-
Defines properties for SLO settings.
Additional properties are allowed.
Hide settings attributes Show settings attributes object
-
frequency string
Configure how often the transform runs, default 1m
Default value is
1m
. -
preventInitialBackfill boolean
Prevents the transform from backfilling data when it starts.
Default value is
false
. -
syncDelay string
The synch delay to apply to the transform. Default 1m
Default value is
1m
.
-
-
List of tags
-
Defines properties for the SLO time window
Additional properties are allowed.
Hide timeWindow attributes Show timeWindow attributes object
-
the duration formatted as {duration}{unit}. Accepted values for rolling: 7d, 30d, 90d. Accepted values for calendar aligned: 1w (weekly) or 1M (monthly)
-
Indicates weither the time window is a rolling or a calendar aligned time window.
Values are
rolling
orcalendarAligned
.
-
-
The last update date
-
The internal SLO version
-
-
400 application/json; Elastic-Api-Version=2023-10-31
Bad request
Hide response attributes Show response attributes object
-
401 application/json; Elastic-Api-Version=2023-10-31
Unauthorized response
Hide response attributes Show response attributes object
-
403 application/json; Elastic-Api-Version=2023-10-31
Unauthorized response
Hide response attributes Show response attributes object
-
404 application/json; Elastic-Api-Version=2023-10-31
Not found response
Hide response attributes Show response attributes object
curl \
-X PUT https://localhost:5601/s/default/api/observability/slos/9c235211-6834-11ea-a78c-6feb38a34414 \
-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"
]
],
"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"
}
}
{
"budgetingMethod": "occurrences",
"createdAt": "2023-01-12T10:03:19.000Z",
"description": "My SLO description",
"enabled": true,
"groupBy": [
[
"service.name"
],
"service.name",
[
"service.name",
"service.environment"
]
],
"id": "8853df00-ae2e-11ed-90af-09bb6422b258",
"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": "My Service SLO",
"objective": {
"target": 0.99,
"timesliceTarget": 0.995,
"timesliceWindow": "5m"
},
"revision": 2,
"settings": {
"frequency": "5m",
"preventInitialBackfill": true,
"syncDelay": "5m"
},
"tags": [
"string"
],
"timeWindow": {
"duration": "30d",
"type": "rolling"
},
"updatedAt": "2023-01-12T10:03:19.000Z",
"version": 2
}
{
"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": "Not Found",
"message": "SLO [3749f390-03a3-11ee-8139-c7ff60a1692d] not found",
"statusCode": 404
}