• Home
  • Dynatrace API
  • Environment
  • Service-level objectives
  • POST an SLO

Service-level objectives API - POST an SLO

Creates a new service-level objective (SLO).

The request consumes an application/json payload.

POSTManagedDynatrace for Governmenthttps://{your-domain}/e/{your-environment-id}/api/v2/slo
SaaShttps://{your-environment-id}.live.dynatrace.com/api/v2/slo
Environment ActiveGatehttps://{your-activegate-domain}/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

ParameterTypeDescriptionInRequired
bodySloConfigItemDtoImpl

The JSON body of the request. Contains the parameters of the new SLO.

bodyrequired

Request body objects

The SloConfigItemDtoImpl object

ElementTypeDescriptionRequired
enabledboolean

The SLO is enabled (true) or disabled (false).

optional
namestring

The name of the SLO.

optional
descriptionstring

The description of the SLO (optional).

optional
metricNamestring

The name for a metric expression

optional
metricExpressionstring

The percentage-based metric expression for the calculation of the SLO.

optional
useRateMetricboolean

DEPRECATED

The type of the metric to use for SLO calculation:

  • true: An existing percentage-based metric.
  • false: A ratio of two metrics.

For a list of available metrics, see Built-in metric page or try the GET metrics API call.

optional
metricRatestring

DEPRECATED

The percentage-based metric for the calculation of the SLO.

Required when the useRateMetric is set to true.

optional
metricNumeratorstring

DEPRECATED

The metric for the count of successes (the numerator in rate calculation).

Required when the useRateMetric is set to false.

optional
metricDenominatorstring

DEPRECATED

The total count metric (the denominator in rate calculation).

Required when the useRateMetric is set to false.

optional
evaluationTypestring

The evaluation type of the SLO.

The element can hold these values
  • AGGREGATE
optional
filterstring

The entity filter for the SLO evaluation. Use the syntax of entity selector.

optional
targetnumber

The target value of the SLO.

optional
warningnumber

The warning value of the SLO.

At warning state the SLO is still fulfilled but is getting close to failure.

optional
errorBudgetBurnRateSloBurnRateConfig

Error budget burn rate configuration of a service-level objective (SLO).

optional
timeframestring

The timeframe for the SLO evaluation. Use the syntax of the global timeframe selector.

optional

The SloBurnRateConfig object

Error budget burn rate configuration of a service-level objective (SLO).

ElementTypeDescriptionRequired
burnRateVisualizationEnabledboolean

The error budget burn rate visualization is enabled (true) or disabled (false).

In case of false, no calculated values will be present here.

optional
fastBurnThresholdnumber

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.

json
{ "enabled": true, "name": "Payment service availability", "description": "Rate of successful payments per week", "metricName": "payment_service_availability", "metricExpression": "(100)*(builtin:service.errors.server.successCount:splitBy())/(builtin:service.requestCount.server:splitBy())", "useRateMetric": true, "metricRate": "builtin:service.successes.server.rate", "metricNumerator": "builtin:service.errors.server.successCount", "metricDenominator": "builtin:service.requestCount.server", "evaluationType": "AGGREGATE", "filter": "type(\"SERVICE\")", "target": 95, "warning": 97.5, "errorBudgetBurnRate": { "burnRateVisualizationEnabled": true, "fastBurnThreshold": 1.5 }, "timeframe": "-1d" }

Response

Response codes

CodeTypeDescription
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.

400ErrorEnvelope

Failed. The input is invalid.

404ErrorEnvelope

Failed. The requested resource doesn't exist.

409ErrorEnvelope

Failed. Conflicting resource.

500ErrorEnvelope

Internal server error.

Related topics
  • Service-level objectives

    Monitor and alert on service-level objectives with Dynatrace.