• Home
  • API
  • Environment
  • Service-level objectives
  • GET all SLOs

Service-level objectives API - GET all SLOs

Lists all service-level objectives and their calculated values.

By default the values are calculated for the SLO's own timeframe. You can use a custom timeframe:

  1. Set the timeFrame parameter to GTF.
  2. Provide the timeframe in from and to parameters.

The request produces an application/json payload.

GETManagedDynatrace 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.read scope.

To learn how to obtain and use it, see Tokens and authentication.

Parameters

ParameterTypeDescriptionInRequired
nextPageKeystring

The cursor for the next page of results. You can find it in the nextPageKey field of the previous response.

The first page is always returned if you don't specify the nextPageKey query parameter.

When the nextPageKey is set to obtain subsequent pages, you must omit all other query parameters.

queryoptional
pageSizeinteger

The amount of SLOs in a single response payload.

The maximal allowed page size is 10000.

If not set, 10 is used.

queryoptional
fromstring

The start of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the relative timeframe of two weeks is used (now-2w).

queryoptional
tostring

The end of the requested timeframe.

You can use one of the following formats:

  • Timestamp in UTC milliseconds.
  • Human-readable format of 2021-01-25T05:57:01.123+01:00. If no time zone is specified, UTC is used. You can use a space character instead of the T. Seconds and fractions of a second are optional.
  • Relative timeframe, back from now. The format is now-NU/A, where N is the amount of time, U is the unit of time, and A is an alignment. The alignment rounds all the smaller values to the nearest zero in the past. For example, now-1y/w is one year back, aligned by a week. You can also specify relative timeframe without an alignment: now-NU. Supported time units for the relative timeframe are:
    • m: minutes
    • h: hours
    • d: days
    • w: weeks
    • M: months
    • y: years

If not set, the current timestamp is used.

queryoptional
sloSelectorstring

The scope of the query. Only SLOs matching the provided criteria are included in the response.

You can add one or several of the criteria listed below.

  • SLO ID: id("id-1","id-2").
  • Name: name("name"). Filters for an SLO with the given name. The filter is case-sensitive.
  • Health state: healthState("HEALTHY") or healthState("UNHEALTHY"). You can specify only one health state.
  • Text: text("value"). Filters for all SLOs that contain the given value in their name or description. The filter is case-insensitive.
  • Problem: problemDisplayName("value"). Filters for all SLOs that are related to a given problem display name (e.g. P-12345).
  • Management zone name: managementZone("MZ-A"). Filters for all SLOs that are related to the given management zone name.
  • Management zone ID: managementZoneID("123"). Filters for all SLOs that are related to the given management zone ID.

To set several criteria, separate them with comma (,). Only results matching all criteria are included in the response. e.g., .../api/v2/slo?sloSelector=name("Service Availability"), .../api/v2/slo?sloSelector=id("id"), .../api/v2/slo?sloSelector=text("Description"),healthState("HEALTHY").

The special characters ~ and " need to be escaped using a ~ (e.g. double quote search text("~"").

queryoptional
sortstring

The sorting of SLO entries:

  • name: Names in ascending order.
  • -name: Names in descending order.

If not set, the ascending order is used.

queryoptional
timeFramestring

The timeframe to calculate the SLO values:

  • CURRENT: SLO's own timeframe.
  • GTF: timeframe specified by from and to parameters.

If not set, the CURRENT value is used.

The element can hold these values
  • CURRENT
  • GTF
queryoptional
demoboolean

Get your SLOs (false) or a set of demo SLOs (true).

queryoptional
evaluatestring

Get your SLOs without them being evaluated (false) or with evaluations (true) with maximum pageSize of 25.

The element can hold these values
  • true
  • false
queryoptional
enabledSlosstring

Get your enabled SLOs (true), disabled ones (false) or both enabled and disabled ones (all).

The element can hold these values
  • true
  • false
  • all
queryoptional
showGlobalSlosboolean

Get your global SLOs (true) regardless of the selected filter or filter them out (false).

queryoptional

Response

Response codes

CodeTypeDescription
200SLOs

Success. The response contains the parameters and calculated values of the requested SLO.

400ErrorEnvelope

Failed. The input is invalid.

Response body objects

The SLOs object

Contains SLOs and paging information.

ElementTypeDescription
sloSLO[]

The list of SLOs.

totalCountinteger

The total number of entries in the result.

pageSizeinteger

The number of entries per page.

nextPageKeystring

The cursor for the next page of results. Has the value of null on the last page.

Use it in the nextPageKey query parameter to obtain subsequent pages of the result.

The SLO object

Parameters of a service-level objective (SLO).

ElementTypeDescription
problemFiltersstring[]

DEPRECATED

The entity filter for fetching the number of problems related to an SLO. Auto-generated in case no filter has been added to the SLO.

evaluatedPercentagenumber

The calculated value of the SLO. Has the value of the evaluated SLO or the value of -1:

  • If there is an error with the SLO calculation; in that case check the value of the error property.
  • If the evaluate parameter has not been set to true; in that case the error property will contain no error.
errorBudgetnumber

The error budget of the calculated SLO.

The error budget is the difference between the calculated and target values. A positive number means all is good; a negative number means trouble.

errorBudgetBurnRateSloBurnRate

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

metricExpressionstring

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

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.

metricRatestring

DEPRECATED

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

Required when the useRateMetric is set to true.

metricNumeratorstring

DEPRECATED

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

Required when the useRateMetric is set to false.

metricDenominatorstring

DEPRECATED

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

Required when the useRateMetric is set to false.

evaluationTypestring

The evaluation type of the SLO.

The element can hold these values
  • AGGREGATE
burnRateMetricKeystring

The error budget burn rate key for a metric expression.

errorBudgetMetricKeystring

The error budget key for a metric expression.

normalizedErrorBudgetMetricKeystring

The normalized error budget key for a metric expression.

numeratorValuenumber

DEPRECATED

The numerator value used to evaluate the SLO when useRateMetric is set to false.

denominatorValuenumber

DEPRECATED

The denominator value used to evaluate the SLO when useRateMetric is set to false.

relatedOpenProblemsinteger

Number of OPEN problems related to the SLO.

Has the value of -1 if there's an error with fetching SLO related problems.

relatedTotalProblemsinteger

Total number of problems related to the SLO.

Has the value of -1 if there's an error with fetching SLO related problems.

metricKeystring

The key for a metric expression. Once created, metric keys can't be changed

timeframestring

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

namestring

The name of the SLO.

idstring

The ID of the SLO

targetnumber

The target value of the SLO.

filterstring

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

descriptionstring

A short description of the SLO.

enabledboolean

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

statusstring

The status of the calculated SLO.

The element can hold these values
  • FAILURE
  • SUCCESS
  • WARNING
errorstring

The error of the SLO calculation.

If the value differs from NONE there's something wrong with the SLO calculation.

warningnumber

The warning value of the SLO.

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

The SloBurnRate object

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

ElementTypeDescription
fastBurnThresholdnumber

The threshold between a slow and a fast burn rate.

burnRateTypestring

The calculated burn rate type.

Has a value of 'FAST', 'SLOW' or 'NONE'.

The element can hold these values
  • FAST
  • NONE
  • SLOW
burnRateValuenumber

The burn rate of the SLO, calculated for the last hour.

sloValuenumber

The calculated value of the SLO for the timeframe chosen for the burn rate calculation.

burnRateVisualizationEnabledboolean

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

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

estimatedTimeToConsumeErrorBudgetnumber

The estimated time left to consume the error budget in hours.

Response body JSON model

json
{ "slo": [ { "problemFilters": "[type(\"SERVICE\")]", "evaluatedPercentage": 96.25, "errorBudget": 1.25, "errorBudgetBurnRate": { "fastBurnThreshold": 1.5, "burnRateType": "SLOW", "burnRateValue": 1.25, "sloValue": 95, "burnRateVisualizationEnabled": true, "estimatedTimeToConsumeErrorBudget": 24 }, "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", "burnRateMetricKey": "func:slo.errorBudgetBurnRate.payment_service_availability", "errorBudgetMetricKey": "func:slo.errorBudget.payment_service_availability", "normalizedErrorBudgetMetricKey": "func:slo.normalizedErrorBudget.payment_service_availability", "numeratorValue": 80, "denominatorValue": 90, "relatedOpenProblems": 1, "relatedTotalProblems": 1, "metricKey": "func:slo.payment_service_availability", "timeframe": "-1d", "name": "Payment service availability", "id": "123e4567-e89b-42d3-a456-556642440000", "target": 95, "filter": "type(\"SERVICE\")", "description": "Rate of successful payments per week", "enabled": true, "status": "WARNING", "error": "NONE", "warning": 97.5 } ], "totalCount": 1, "pageSize": 1, "nextPageKey": "AQAAABQBAAAABQ==" }
Related topics
  • Service-level objectives

    Monitor and alert on service-level objectives with Dynatrace.