Service-level objectives API - POST an SLO
Creates a new service-level objective (SLO).
The request consumes an application/json
payload.
POST | ManagedDynatrace for Government | https://{your-domain}/e/{your-environment-id}/api/v2/slo |
SaaS | https://{your-environment-id}.live.dynatrace.com/api/v2/slo | |
Environment and Cluster ActiveGate (default port 9999) | https://{your-activegate-domain}:9999/e/{your-environment-id}/api/v2/slo |
Authentication
To execute this request, you need an access token with slo.write
scope.
To learn how to obtain and use it, see Tokens and authentication.
Parameters
Parameter | Type | Description | In | Required |
---|---|---|---|---|
body | SloConfigItemDtoImpl | The JSON body of the request. Contains the parameters of the new SLO. | body | required |
Request body objects
The SloConfigItemDtoImpl
object
Element | Type | Description | Required |
---|---|---|---|
description | string | The description of the SLO. | optional |
enabled | boolean | The SLO is enabled ( If not defined, the SLO is disabled by default. | optional |
errorBudgetBurnRate | SloBurnRateConfig | Error budget burn rate configuration of a service-level objective (SLO). | optional |
evaluationType | string | The evaluation type of the SLO.
| required |
filter | string | The entity filter for the SLO evaluation. The total length of the entitySelector string in SLOs is limited to 1,000 characters. Use the syntax of entity selector. | optional |
string | DEPRECATED The total count metric (the denominator in rate calculation). Required when the useRateMetric is set to | optional | |
metricExpression | string | The percentage-based metric expression for the calculation of the SLO. | optional |
metricName | string | The name that is used to create SLO func metrics keys. Once created, metric name cannot be changed. | optional |
string | DEPRECATED The metric for the count of successes (the numerator in rate calculation). Required when the useRateMetric is set to | optional | |
string | DEPRECATED The percentage-based metric for the calculation of the SLO. Required when the useRateMetric is set to | optional | |
name | string | The name of the SLO. | required |
target | number | The target value of the SLO. | required |
timeframe | string | The timeframe for the SLO evaluation. Use the syntax of the global timeframe selector. | required |
boolean | DEPRECATED The type of the metric to use for SLO calculation:
For a list of available metrics, see Built-in metric page or try the GET metrics API call. | optional | |
warning | number | The warning value of the SLO. At warning state the SLO is still fulfilled but is getting close to failure. | required |
The SloBurnRateConfig
object
Error budget burn rate configuration of a service-level objective (SLO).
Element | Type | Description | Required |
---|---|---|---|
burnRateVisualizationEnabled | boolean | The error budget burn rate calculation is enabled ( In case of If not defined, the error budget burn rate calculation is disabled by default. | optional |
fastBurnThreshold | number | The threshold between a slow and a fast burn rate. | optional |
Request body JSON model
This is a model of the request body, showing the possible elements. It has to be adjusted for usage in an actual request.
1{2 "description": "Rate of successful payments per week",3 "enabled": true,4 "errorBudgetBurnRate": {5 "burnRateVisualizationEnabled": true,6 "fastBurnThreshold": 1.57 },8 "evaluationType": "AGGREGATE",9 "filter": "type(\"SERVICE\")",10 "metricDenominator": "builtin:service.requestCount.server",11 "metricExpression": "(100)*(builtin:service.errors.server.successCount:splitBy())/(builtin:service.requestCount.server:splitBy())",12 "metricName": "payment_service_availability",13 "metricNumerator": "builtin:service.errors.server.successCount",14 "metricRate": "builtin:service.successes.server.rate",15 "name": "Payment service availability",16 "target": 95,17 "timeframe": "-1d",18 "useRateMetric": true,19 "warning": 97.520}
Response
Response codes
Code | Type | Description |
---|---|---|
201 | - | Success. The new SLO has been created. Response doesn't have a body. The location response header contains the ID of the new SLO. |
400 | ErrorEnvelope | Failed. The input is invalid. |
409 | ErrorEnvelope | Failed. Conflicting resource. |
500 | ErrorEnvelope | Internal server error. |