Pular para o conteúdo principal
GET
/
api
/
v1
/
slos
/
{name}
Obter SLO
curl --request GET \
  --url https://api.example.com/api/v1/slos/{name}
{
  "apiVersion": "v1",
  "kind": "SLO",
  "metadata": {
    "name": "slo-payment-availability",
    "namespace": "production",
    "createdAt": "2026-01-15T10:00:00Z",
    "labels": {
      "service": "payment-service",
      "team": "platform",
      "tier": "critical"
    }
  },
  "spec": {
    "service": "payment-service",
    "type": "availability",
    "target": 99.95,
    "window": "30d",
    "indicator": {
      "source": "prometheus",
      "query": "sum(rate(http_requests_total{service='payment-service',code!~'5..'}[5m])) / sum(rate(http_requests_total{service='payment-service'}[5m])) * 100",
      "goodEventsQuery": "http_requests_total{code!~'5..'}",
      "totalEventsQuery": "http_requests_total"
    },
    "alerting": {
      "burnRateThresholds": [
        {
          "severity": "critical",
          "shortWindow": "5m",
          "longWindow": "1h",
          "burnRate": 14.4
        },
        {
          "severity": "warning",
          "shortWindow": "30m",
          "longWindow": "6h",
          "burnRate": 6.0
        }
      ],
      "notificationChannels": ["slack:#sre-alerts", "pagerduty:platform-team"]
    }
  },
  "status": {
    "current": 99.87,
    "status": "warning",
    "budgetTotal": 21.6,
    "budgetConsumed": 14.7,
    "budgetRemaining": 6.9,
    "budgetRemainingPercent": "32%",
    "windowStart": "2026-02-17T15:00:00Z",
    "windowEnd": "2026-03-19T15:00:00Z",
    "lastUpdated": "2026-03-19T15:00:00Z",
    "history": [
      {"date": "2026-03-19", "value": 99.82},
      {"date": "2026-03-18", "value": 99.91},
      {"date": "2026-03-17", "value": 99.98}
    ]
  }
}
name
string
obrigatório
Nome único do SLO (ex: slo-payment-availability)
{
  "apiVersion": "v1",
  "kind": "SLO",
  "metadata": {
    "name": "slo-payment-availability",
    "namespace": "production",
    "createdAt": "2026-01-15T10:00:00Z",
    "labels": {
      "service": "payment-service",
      "team": "platform",
      "tier": "critical"
    }
  },
  "spec": {
    "service": "payment-service",
    "type": "availability",
    "target": 99.95,
    "window": "30d",
    "indicator": {
      "source": "prometheus",
      "query": "sum(rate(http_requests_total{service='payment-service',code!~'5..'}[5m])) / sum(rate(http_requests_total{service='payment-service'}[5m])) * 100",
      "goodEventsQuery": "http_requests_total{code!~'5..'}",
      "totalEventsQuery": "http_requests_total"
    },
    "alerting": {
      "burnRateThresholds": [
        {
          "severity": "critical",
          "shortWindow": "5m",
          "longWindow": "1h",
          "burnRate": 14.4
        },
        {
          "severity": "warning",
          "shortWindow": "30m",
          "longWindow": "6h",
          "burnRate": 6.0
        }
      ],
      "notificationChannels": ["slack:#sre-alerts", "pagerduty:platform-team"]
    }
  },
  "status": {
    "current": 99.87,
    "status": "warning",
    "budgetTotal": 21.6,
    "budgetConsumed": 14.7,
    "budgetRemaining": 6.9,
    "budgetRemainingPercent": "32%",
    "windowStart": "2026-02-17T15:00:00Z",
    "windowEnd": "2026-03-19T15:00:00Z",
    "lastUpdated": "2026-03-19T15:00:00Z",
    "history": [
      {"date": "2026-03-19", "value": 99.82},
      {"date": "2026-03-18", "value": 99.91},
      {"date": "2026-03-17", "value": 99.98}
    ]
  }
}