---
title: "Preview the uptime an alert would produce as an SLI source"
method: GET
path: "/api/v2/{org_id}/alerts/{alert_id}/slo-preview"
tags: ["SLOs"]
---

# Preview the uptime an alert would produce as an SLI source

`GET /api/v2/{org_id}/alerts/{alert_id}/slo-preview`

## Request

- Base URL: `https://api.openobserve.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.openobserve.ai/api/v2/{org_id}/alerts/{alert_id}/slo-preview`
- Auth: API key in header `Authorization`
- TypeScript: <https://skmtc.dev/openobserve/apis/openobserve-api-http/docs/api/v2/:org_id/alerts/:alert_id/slo-preview/get.ts> (a function with typed inputs; its response is checked against the schema)

Returns the ledger intervals for the ribbon plus the achieved SLI and the
coverage behind it — the alert analogue of the time-slice preview. Computed
by the same fold the ingest pass runs, so the preview cannot disagree with
the SLO it is previewing.

## Path parameters

- `org_id` string, required
- `alert_id` string, required

## Query parameters

- `window_secs` integer, required
- `slice_interval_secs` integer, required

## Response `200`

Success

- AlertSliPreview: What an alert SLI would have measured over a window, computed from the ledger before anything is saved.
  - `alert_id` string, required
  - `coverage` number, double, required: `observed / expected`, 0..1 — the denominator behind the SLI, which is the number that decides whether the SLO would freeze.
  - `expected_slices` integer, required
  - `good_secs` number, double, required
  - `intervals` AlertSliPreviewInterval[], required
    - `frequency_secs` integer, required
    - `from_us` integer, required
    - `level` string, nullable: `None` when the stored level is one this build cannot interpret — which the ribbon must draw as unmeasured, never as good.
    - `to_us` integer, required
  - `observed_slices` integer, required
  - `range_end_secs` integer, required
  - `range_start_secs` integer, required: The range the ribbon is drawn against. Intervals alone cannot place a band, and a gap at either edge would otherwise be invisible.
  - `sli` number, double, nullable: Percentage 0..100 over MEASURED time. `None` when nothing was measured — deliberately not 0, which would render a brand-new source as total downtime.
  - `slice_interval_secs` integer, required
  - `total_secs` number, double, required
  - `would_freeze` boolean, required: Whether an SLO on this source would be FROZEN right now rather than reporting the SLI beside it. [`Self::sli`] is the honest ratio over measured time, which is what the form asks for — but below `ZO_SLO_MIN_COVERAGE` the saved SLO reports no data at all (`SloStatusView::derive`), so "100% over 33% of the window" is a reading the SLO will refuse to give. The floor is server-side config the form cannot see, so the comparison has to travel with the answer (§2, D34).

## Other responses

- `400`: Bad Request
- `404`: Not Found

---

[API](https://skmtc.dev/openobserve/apis/openobserve-api-http.md) - [All operations](https://skmtc.dev/openobserve/apis/openobserve-api-http/llms.txt) - [OpenAPI document](https://skmtc.dev/openobserve/apis/openobserve-api-http/revisions/0529b8a10252?raw)
