SLI Configuration
A Service Level Indicator (SLI) is an automated measurement that runs on a schedule. Each SLI executes a script (via a CodeBundle) that returns a numeric metric, which is stored and evaluated for alerting.
Managing SLIs in the UI
SLIs are configured as part of an SLX in Workspace Studio > Tasks. Open the SLX Preview (eye icon) and select the Health tab to see live SLI data.

The Health tab displays:
- SLI Values — a time-series chart of the metric, with a configurable time range (1 hour, 6 hours, 24 hours, etc.)
- Debug Log — link to the raw SLI execution log for troubleshooting
The Metadata tab shows the SLX name, owners, resource group, and all tags (platform, cluster, namespace, resource type, access level) that drive alert routing and task discovery.

When creating or editing an SLI through the UI, the platform presents the key fields described in the spec reference below — interval, CodeBundle, alert thresholds, and task triggers — without requiring you to write YAML directly.
Spec Reference
The sections below document the full SLI Custom Resource spec for users who manage SLX configuration through Git or need to understand the underlying data model.
SLI Spec Overview
apiVersion: runwhen.com/v1kind: ServiceLevelIndicatormetadata: name: my-workspace--my-slx-sli labels: workspace: my-workspace slx: my-workspace--my-slxspec: codeBundle: repoUrl: https://github.com/runwhen-contrib/rw-cli-codecollection pathToRobot: codebundles/k8s-namespace-healthcheck/sli.robot ref: main intervalSeconds: 60 intervalStrategy: intermezzo locations: - northamerica-northeast2-01 configProvided: - name: NAMESPACE value: production secretsProvided: - name: kubeconfig workspaceKey: kubeconfig displayUnitsLong: "percent available" displayUnitsShort: "%" alerts: warning: operator: "lt" threshold: "0.99" for: "5m" ticket: operator: "lt" threshold: "0.95" for: "10m" page: operator: "lt" threshold: "0.9" alertConfig: tasks: persona: eager-edgar sessionTTL: 10mSpec Fields
| Field | Type | Default | Description |
|---|---|---|---|
codeBundle | object | required | Git reference to the SLI script |
intervalSeconds | integer | 60 | How often the SLI runs (in seconds) |
intervalStrategy | string | intermezzo | Scheduling strategy for the runner |
locations | string[] | — | Runner location(s) where the SLI executes |
configProvided | object[] | — | Environment variables passed to the script |
secretsProvided | object[] | — | Workspace secrets mapped into the script |
servicesProvided | object[] | — | Location service bindings |
displayUnitsLong | string | — | Human-readable unit label (e.g. “percent available”) |
displayUnitsShort | string | — | Short unit label, max 3 characters (e.g. ”%”, “ms”) |
alerts | object | — | Threshold alert configuration (see below) |
alertConfig | object | — | Automatic task-trigger configuration (see below) |
CodeBundle
The codeBundle field points to the script that the SLI runs:
| Field | Required | Description |
|---|---|---|
repoUrl | Yes | Git repository URL |
pathToRobot | Yes | Path to the .robot file within the repository |
ref | Yes | Git ref — branch, tag, or commit (default: main) |
Config and Secrets
configProvided — static environment variables:
configProvided: - name: NAMESPACE value: production - name: CONTEXT valueFrom: workspace: CONTEXTEach entry supports either a literal value or a valueFrom reference that resolves from the workspace or SLX configuration.
secretsProvided — workspace secret mappings:
secretsProvided: - name: kubeconfig workspaceKey: kubeconfigThe workspaceKey references a secret stored in the workspace’s secret store.
Threshold Alerts (spec.alerts)
Threshold alerts fire when the SLI metric crosses a user-defined value. Your SLI script can return any numeric value — not just 0 or 1 — giving you full control over how the metric is evaluated.
Structure
Threshold alerts are defined per severity level:
alerts: warning: operator: "lt" threshold: "0.95" for: "5m" ticket: operator: "lt" threshold: "0.9" for: "10m" page: operator: "lt" threshold: "0.8"Fields
| Field | Required | Type | Description |
|---|---|---|---|
operator | Yes | string | Comparison operator for the metric value |
threshold | Yes | string | Numeric value to compare against (parsed as float64) |
for | No | string | Duration the condition must hold before firing (e.g. 5m, 1h) |
Operators
| Word | Symbol | Meaning |
|---|---|---|
lt | < | Less than |
le | <= | Less than or equal to |
eq | == | Equal to |
ge | >= | Greater than or equal to |
gt | > | Greater than |
ne | != | Not equal to |
Severity Levels
| Severity | Typical Use |
|---|---|
warning | Informational — may not require immediate action |
ticket | Should be investigated |
page | Requires immediate response |
You can define one, two, or all three. Each operates independently with its own operator, threshold, and duration.
The for Duration
When for is set, the condition must be continuously true for the specified duration before the alert fires. This prevents transient fluctuations from triggering false alerts.
Without for — fires immediately:
metric_name < 0.95With for: "5m" — fires after 5 minutes:
last_over_time(metric_name[5m]) < 0.95Alert Modes
Each threshold alert has a mode (managed in CRD status, not spec):
| Mode | Behavior |
|---|---|
active | Alert fires when threshold is breached (default) |
silenced | Alert does not fire but is still visible in the UI |
disabled | Alert is completely disabled and hidden |
Task-Trigger Alerts (spec.alertConfig)
Task-trigger alerts are a separate, implicit mechanism. When configured, the platform automatically runs the SLX’s tasks whenever any sub-metric drops below 1.0. The operator and threshold are hardcoded — only the task execution behavior is configurable.
alertConfig: tasks: persona: eager-edgar sessionTTL: 10m| Field | Default | Description |
|---|---|---|
tasks.persona | eager-edgar | Which AI Assistant persona runs the triggered task |
tasks.sessionTTL | 10m | Cooldown — no new task run until this time has elapsed since the last run session |
Threshold Alert Examples
Availability (0.0 – 1.0)
alerts: warning: operator: "lt" threshold: "0.99" for: "5m" ticket: operator: "lt" threshold: "0.95" for: "10m" page: operator: "lt" threshold: "0.9"Response Latency (milliseconds)
alerts: warning: operator: "gt" threshold: "200" for: "5m" page: operator: "gt" threshold: "500"Unhealthy Pod Count
alerts: ticket: operator: "ge" threshold: "1" page: operator: "ge" threshold: "3"Error Rate (percentage)
alerts: warning: operator: "gt" threshold: "1" for: "10m" ticket: operator: "gt" threshold: "5" for: "5m" page: operator: "gt" threshold: "10"How SLI Alerts Are Evaluated
- SLI script runs on the configured
intervalSecondsschedule at the specified runner location - Metric is stored under the SLX’s metric name
- Alert rules are generated from your
spec.alertsthresholds and evaluated continuously - When a threshold is breached — immediately, or after the
forduration — the alert fires - An issue is created and linked to the SLX
- Task triggers execute automatically if
alertConfigis configured
Related Pages
- SLXs (Learn) — conceptual overview of SLXs
- SLO Configuration — error budget alerting against SLI metrics
- Task & Runbook Configuration — task execution configuration