---
title: "ktm metrics slo"
description: "Compute SLI/SLO metrics using Google SRE burn-rate methodology"
sidebarTitle: "slo"
lastUpdated: "2026-09-23"
---

> **For AI agents:** the complete documentation index is at [llms.txt](/llms.txt). Append `.md` to any page URL for its markdown version.

{/* GENERATED FILE: do not edit by hand. Regenerate with: node scripts/generate.mjs */}

Compute SLI/SLO metrics using Google SRE burn-rate methodology

## Usage

```bash
ktm metrics slo [flags]
```

## Examples

```bash
# Compute SLO for 99.9% target over 30-day window
ktm metrics slo --operator acme \
  --query "SELECT sum(good) AS good, sum(total) AS total FROM test WHERE time > now() - 30d" \
  --slo-target 99.9

# Custom field names and 7-day window
ktm metrics slo --operator acme \
  --query "SELECT sum(success) AS ok, sum(requests) AS all_req FROM api WHERE time > now() - 7d" \
  --slo-target 99.5 --good-field ok --total-field all_req --window 7d
```

## Flags

| Flag | Type | Default | Description |
| --- | --- | --- | --- |
| `--good-field` | string | `good` | Field name for good events |
| `--operator` | string |  | Operator slug (= InfluxDB database name) |
| `--precision` | string |  | Query time precision (s, ms, u, ns) |
| `--query` | string |  | InfluxQL query returning good/total fields |
| `--slo-target` | float |  | SLO target percentage (e.g. 99.9) |
| `--total-field` | string | `total` | Field name for total events |
| `--window` | string | `30d` | SLO window (e.g. 30d, 168h) |

## Details

Compute SLI/SLO metrics from InfluxDB query results.

Prerequisite: Discover available measurements and fields first using
'metrics query --operator &lt;slug&gt; --query "SHOW MEASUREMENTS"' and
'metrics query --operator &lt;slug&gt; --query "SHOW FIELD KEYS FROM &lt;measurement&gt;"'.
Do not fabricate measurement or field names.

Run an InfluxQL query that returns good and total event counts
(e.g., SELECT sum(good) AS good, sum(total) AS total FROM ...).
The tool extracts good/total fields, computes SLI, error budget,
burn rate, and severity.

Severity thresholds (Google SRE):
  - critical: burn rate &gt; 14.4x (page immediately)
  - red:      burn rate &gt; 6x (create ticket)
  - yellow:   burn rate &gt; 1x (SLO at risk)
  - green:    burn rate &lt;= 1x (within budget)

## Related

- [`ktm metrics`](/cli/commands/metrics)

<Note>
  Global flags (`--output`, `--debug`, `--host`, …) apply to every command. See the [command reference overview](/cli/commands/overview).
</Note>

## What's next?

<Columns cols={2}>
  <Card title="All commands" icon="terminal" href="/cli/commands/overview">
    Browse the full CLI reference.
  </Card>
  <Card title="Get started" icon="rocket" href="/cli/getting-started">
    Install the CLI and authenticate.
  </Card>
</Columns>
