v1

latestOpenAPI 3.0.02026-07-142351,1971.3 MB
Service Level Objectives

Get an SLO's details

Get a service level objective object.

get/api/v1/slo/{slo_id}

Path parameters

slo_idstring required

The ID of the service level objective object.

Query parameters

with_configured_alert_idsboolean

Get the IDs of SLO monitors that reference this SLO.

Response

OK

errorsstring[]

An array of error messages. Each endpoint documents how/whether this field is used.

Example response

{
  "data": {
    "configured_alert_ids": [
      123,
      456,
      789
    ],
    "groups": [
      "env:prod",
      "role:mysql"
    ],
    "name": "Custom Metric SLO",
    "query": {
      "denominator": "sum:my.custom.metric{*}.as_count()",
      "numerator": "sum:my.custom.metric{type:good}.as_count()"
    },
    "sli_specification": {
      "time_slice": {
        "comparator": "<",
        "query": {
          "formulas": [
            {
              "formula": "query2/query1"
            }
          ],
          "queries": [
            {
              "data_source": "metrics",
              "name": "query1",
              "query": "sum:trace.servlet.request.hits{*} by {env}.as_count()"
            },
            {
              "data_source": "metrics",
              "name": "query2",
              "query": "sum:trace.servlet.request.errors{*} by {env}.as_count()"
            }
          ]
        },
        "threshold": 5
      }
    },
    "tags": [
      "env:prod",
      "app:core"
    ],
    "target_threshold": 99.9,
    "thresholds": [
      {
        "target": 95,
        "timeframe": "7d"
      },
      {
        "target": 95,
        "timeframe": "30d",
        "warning": 97
      }
    ],
    "timeframe": "30d",
    "type": "metric",
    "warning_threshold": 99.95
  }
}