Grafana: SLOs & IRM

This content was generated with the assistance of AI and should be verified against the official documentation before being relied on in production.

Checked on 2026-11-09 against Grafana 13.3.x. Tested with Grafana Enterprise 13.3.0 in the hands-on lab: the HCL of this page passes terraform validate with provider 4.54.0 apart from the folder resource it refers to; it was not applied.

Two Grafana capabilities sit on top of Grafana Alerting and are documented only as Grafana Cloud features. Grafana SLO turns a service level indicator and a target into recording rules, a dashboard and burn-rate alert rules. Grafana IRM (incident response and management) takes the resulting alerts, decides who is on call and how an unanswered alert escalates, and gives the responders a place to run an incident. This page explains both, says plainly what is Grafana Cloud only, and then shows how a reader with a self-managed Grafana (OSS or Enterprise) gets the same alerting behaviour for the Bookshelf service with recording rules and a multiwindow burn-rate alert rule written as Terraform.

The concepts are not repeated here: the vocabulary, the arithmetic and the Workbook’s alert table are on SLIs, SLOs & Error Budgets, and routing, paging and incident practice are on Notifications & Incident Response. The Grafana side of the alert pipeline is described in Alerting Architecture, Recording Rules and Provisioning Alerting Resources.

What is Cloud only and what is not

Capability Grafana Cloud Self-managed Grafana (OSS or Enterprise)

Grafana SLO (SLI wizard, generated recording rules, dashboard, burn-rate alert rules, maintenance windows)

Yes; documented under the Grafana Cloud documentation.

Not documented as available. Build the same pattern with recording rules and alert rules (this page).

Grafana IRM (alert groups, on-call schedules, escalation chains, incident management)

Yes; a Grafana Cloud add-on.

No self-managed variant is described. Grafana Alerting can send alerts to an IRM integration through the Grafana IRM contact point (a webhook), and any webhook receiver works in the lab.

Burn-rate alert rules, recording rules, notification policies, contact points

Yes

Yes (Grafana-managed recording rules need a Prometheus-compatible write target)

Source: Grafana SLO documentation and Grafana IRM documentation. Both pages are documented only inside the Grafana Cloud documentation; the IRM overview describes it as a Grafana Cloud add-on. The contact point is described on Contact Points & Integrations.

From SLO to responder

flowchart LR M["Bookshelf metrics"] --> RR["Recording rules: error ratio per window"] RR --> BR["Burn-rate alert rules: fast and slow"] BR --> NP["Notification policy by team and severity"] NP --> CP["Contact point"] CP --> IRM["Grafana IRM integration"] CP --> WH["Webhook receiver in the lab"] IRM --> R["Route selects escalation chain"] R --> S["Notify the schedule on call"] S --> AG["Alert group: acknowledge or resolve"] AG --> INC["Declare incident when coordination is needed"] SLO["Grafana SLO on Cloud"] -. "generates" .-> RR SLO -. "generates" .-> BR

On Cloud, Grafana SLO generates the first two stages and the rest is the ordinary alerting pipeline followed by IRM. On a self-managed instance you write the first two stages yourself and the contact point posts to your own receiver, or to an IRM integration if you have one.

Grafana SLO

Grafana SLO is a framework for measuring the quality of service users receive and for alerting when the objective is at risk. Its documentation defines the four terms the same way as the shared page: the SLI is a metric that returns a success ratio (0.75 means 75 percent of requests met the goal), the SLO is a target plus a time window, the error budget is 100 percent minus the target and the burn rate is how fast the budget is spent, where a rate of 1 uses the whole budget exactly at the end of the window.

Source: Grafana SLO: Introduction ("Fundamentals").

Creating an SLO in the UI

In Grafana Cloud open Alerts & IRM, then SLO, then Create SLO. The wizard has these steps:

  1. Time window. The number of days over which the SLO is evaluated: default 28, minimum 7.

  2. Define the SLI. Pick a source data source (where the query runs) and a target data source (a Mimir or Prometheus-compatible data source that stores the generated recording rules; it may be the same). Then choose the query type. A ratio query takes a success metric and a total metric (Prometheus counters) and Grafana generates the PromQL. An advanced query is your own query, in the query builder or by hand, and it must be a ratio of numerator to denominator. Supported data sources are Mimir and other Prometheus-compatible data sources, Splunk, AppDynamics and Graphite; multi-stack data sources are not supported. For any other data source, create a Grafana-managed recording rule that writes the metric into Mimir and query that.

  3. Set a target. A percentage such as 99 percent; the error budget is computed. After you type it, the wizard charts the probability of meeting the target, estimated from 90 days of history.

  4. Name and labels. A short name, a description and labels such as team and service (they can route SLO alert notifications), plus an optional Knowledge Graph search expression for the RCA workbench.

  5. Alert rules. Fast-burn alerts use short evaluation periods and fire when the budget is consumed quickly, for example in an outage. Slow-burn alerts use longer periods and fire when it is consumed gradually. Each can have a name, description, labels, annotations (for example a runbook), an optional assistant investigation and a minimum failure threshold, the minimum number of failed events required to fire. The rules are created only when you save the SLO.

  6. Review and save.

Grafana then creates, in the SLO’s folder, a dashboard (SLI, error budget and burn rate), recording rules for the SLI and the error budget, and the alert rules; it recreates any of them that are deleted. Neither the create page nor the introduction gives numeric burn-rate thresholds or exact alert windows: the documentation says only that fast burn means the budget would be consumed over minutes or hours and slow burn over hours or days. If you need to know the numbers, read the generated alert rules in Alerting, Alert rules (they are in the SLO folder) or use the Workbook table on the shared page.

The SLO dashboard

The generated dashboard shows the SLI over the selected range with intervals under the objective highlighted, the remaining error budget as a burn-down chart, the burn rate (1 means the budget lasts exactly the window) with a stat for the current rate, the event rate for event-based SLIs (it explains why the budget drains faster at high traffic), results per dimension for multidimensional SLIs, and a Burn Rate Alerts panel with the state of the fast- and slow-burn alerts. SLO panels can be added to custom dashboards.

Limits and maintenance windows

Each SLO generates 10 to 12 Prometheus recording rules, each with at least one series, and a multidimensional SLI creates more series; each Grafana instance is limited to 70 SLOs by default. The series count is what usage is based on, so group-by dimensions have a direct cost in series.

A maintenance window pauses error budget consumption and burn-rate alerting for the SLOs you select, only while it is active: Grafana SLO omits SLI samples for those SLOs, so failures do not reduce the budget, and alerts that use their recording rules do not fire. The recording rules stop being written, which leaves a gap that is not backfilled. Creating one needs the maint-windows:admin role (the Admin basic role has it) and edit permission on the target folder; windows are a single fixed range, cannot start in the past and do not pause alerts built on source metrics outside Grafana SLO. Start a window a few minutes early.

Best practices from the documentation

  • Start with availability and latency SLIs for request-driven services and measure as close to the user as practical.

  • Prefer event-based SLIs to time-based ones, and avoid percentile-based SLIs: count the requests that meet the target instead, because histogram percentiles can be inaccurate.

  • Set attainable targets that stakeholders understand, make sure the service has enough traffic (low traffic makes alerts noisy) and, for low-traffic services, add synthetic traffic or the minimum failure threshold (it applies to all alerting windows, the smallest being one hour).

  • Send fast-burn alerts to on-call responders and slow-burn alerts to the team for business hours, keep labels few and consistent, and designate someone to validate the SLI when alerts first route to them.

The Grafana Alerting guide on when SLOs reduce alert noise names three signs that a threshold alert should become an SLO: nobody acts on the alert although the metric matters, several teams alert on the same user-facing metric with different thresholds, and the alert flaps on transient conditions whose cumulative effect the error budget captures. It adds that existing threshold alerts are not replaced automatically and can coexist: the alerts drive immediate response and the SLO gives long-term visibility.

The SLO as code

The grafana/grafana Terraform provider has a grafana_slo resource, which the SLO API also backs. The example below is the registry’s ratio example adapted to the Bookshelf availability SLI: success is every request that is not a 5xx, the objective is 99.5 percent, and fast- and slow-burn alerts carry annotations. The destination_datasource is the Grafana Cloud managed Prometheus data source named in the provider example.

resource "grafana_slo" "bookshelf_availability" {
  name        = "Bookshelf availability"
  description = "Share of Bookshelf requests answered without a 5xx status."

  query {
    ratio {
      success_metric = "http_server_requests_seconds_count{application=\"bookshelf\",status!~\"5..\"}"
      total_metric   = "http_server_requests_seconds_count{application=\"bookshelf\"}"
    }
    type = "ratio"
  }

  objectives {
    value  = 0.995
    window = "28d"
  }

  destination_datasource {
    uid = "grafanacloud-prom"
  }

  label {
    key   = "team"
    value = "bookshelf-sre"
  }

  alerting {
    fastburn {
      annotation {
        key   = "name"
        value = "Bookshelf SLO burn rate very high"
      }
      annotation {
        key   = "description"
        value = "The availability error budget is burning too fast."
      }
    }

    slowburn {
      annotation {
        key   = "name"
        value = "Bookshelf SLO burn rate high"
      }
      annotation {
        key   = "description"
        value = "The availability error budget is burning steadily."
      }
    }
  }
}

Reference: Terraform: grafana_slo (the ratio example; objectives, label and alerting are the documented blocks, the optional folder_uid places the SLO in a folder, and alerting.advanced_options.min_failures sets the minimum failure threshold). The Bookshelf metric names are the Micrometer names used on the other pages; the registry example uses 30d as the window format and 28d follows it. The resource targets Grafana Cloud and cannot be tried in the self-managed lab.

Grafana IRM

Grafana IRM is the on-call management and incident response product of Grafana Cloud, billed as an add-on. Its documentation describes this flow: an alert reaches an integration (each alert source has its own, and Grafana Alerting is one); a route selects an escalation chain, which is a sequence of steps that notify schedules, users or teams, wait, repeat, declare incidents or trigger webhooks; the alert joins a new or open alert group; the chain notifies whoever the schedule shows as on call, using that person’s notification rules; acknowledging or resolving the alert group stops the escalation. If the problem needs a coordinated response, the team declares an incident.

Source: Grafana IRM (redirects to the pages below) and Respond to incidents: Introduction ("How IRM works at a glance").

On-call schedules

A schedule says who is on call now. Rotations are the repeating pattern (for example weekly or monthly), shifts are the concrete periods someone is responsible, and overrides cover time off and swaps. A schedule is created in the IRM app, imported from a calendar by iCal URL (for example from Google Calendar) or managed as code with Terraform. Schedules are attached to an escalation chain with several Notify schedule steps separated by Wait steps: the primary level gets the first notification, the secondary level is notified when the primary does not acknowledge in time, and a tertiary level is the last resort. The page also describes schedule quality metrics and a quality score.

Source: Configure on-call schedules ("Schedule types", "Combine schedules and escalation levels").

Responding to alerts

The alert group table shows cards for firing, acknowledged, resolved and silenced alert groups. Unacknowledged or unresolved alerts escalate through the chain; a responder can add participants (which starts that person’s notification rules) or skip to the next step. Silences made in IRM are separate from Alertmanager silences when the Grafana Alerting integration is used, so a silence in one place does not silence the other.

Source: Respond to alerts ("Escalate an alert", "Silence alerts").

Incident management

Incident management in IRM has four stages: declare (create the incident record with severity levels and labels), document (a chronological timeline to which notes, queries and dashboard panels can be added), collaborate (participants and roles) and resolve (status updates and tasks), followed by post-incident analysis from the timelines. Incidents can also be handled from Slack with /grafana commands and through the Grafana IRM API. The overview page gives no further detail on severities, roles, status pages or Microsoft Teams, and this page does not claim any.

Source: Manage incidents. Practice (roles, severities, post-incident review) is covered tool-neutrally in Notifications & Incident Response.

Connecting Grafana Alerting to IRM

From a self-managed Grafana the connection is a contact point of type Grafana IRM, which posts to an IRM integration; the notification policy tree then routes critical burn-rate alerts to it exactly as it routes to the lab webhook bookshelf-webhook. Setup of the contact point is on Contact Points & Integrations, and the routing in Notification Policies.

Burn-rate alerts with Grafana Alerting

Without Cloud, build the pattern from the parts of the shared page. The Bookshelf objective is 99.5 percent availability over 30 days, so the error budget is with . With the observed 5xx ratio over a window, the burn rate is , and an alert for burn rate fires when the ratio exceeds :

With a 30-day period of 720 hours, a burn rate of 14.4 held for one hour spends of the budget and a burn rate of 6 held for six hours spends . The two alert rules therefore use these pairs, each requiring the long and the short window (one twelfth of it) to exceed the threshold at the same time:

Rule Long window Short window Burn rate Ratio threshold Severity label

Fast burn

1 hour

5 minutes

14.4

0.072

critical

Slow burn

6 hours

30 minutes

6

0.03

warning

The Workbook’s third pair (3 days and 6 hours, burn rate 1) is left out because the lab has not run long enough for a 3-day rate to mean anything; the Workbook sends the 6-hour pair to a page, while the lab policy tree has only critical and warning, so this page routes it as a warning. Both are choices, not Grafana defaults.

Source: SRE Workbook: Alerting on SLOs (burn rate, thresholds and budget consumed); arithmetic shared with SLIs, SLOs & Error Budgets.

Step 1: record the error ratio per window

A Grafana-managed recording rule evaluates the 5xx ratio once per minute and writes it to the Prometheus data source as a new series, so the alert rule reads a cheap series and the dashboard can reuse it. One rule per window gives four series named by the convention of the recording rules page, for example application:http_server_requests_5xx:ratio_rate1h. The target Prometheus must accept remote write (--web.enable-remote-write-receiver), and on self-managed Grafana the Terraform provider documents that recording rules need the grafanaManagedRecordingRules feature toggle; the details are on Recording Rules.

Step 2: alert on both windows

Each alert rule has two instant queries on the recorded series (long and short window), a Reduce expression for each and a Math expression as the condition. Math supports the relational operators and the logical && and ||, which return 1 for true and 0 for false, so the condition $E > 0.072 && $F > 0.072 is true only when both windows exceed the threshold. The for period avoids a one-evaluation blip and keep_firing_for stops the alert from resolving and refiring while the short window oscillates around the threshold. The two rules are generated from a small map so the long window, short window, threshold, severity and timers sit in one place.

locals {
  prom = { type = "prometheus", uid = "prometheus" }
  expr = { type = "__expr__", uid = "__expr__" }

  # Window suffixes of the recorded series; change them to shorten the lab.
  windows = ["5m", "30m", "1h", "6h"]

  # Burn-rate pairs for a 99.5 percent objective (error budget 0.005).
  burn = {
    fast = { long = "1h", short = "5m", threshold = 0.072, burn_rate = 14.4, severity = "critical", for = "2m", keep = "5m" }
    slow = { long = "6h", short = "30m", threshold = 0.03, burn_rate = 6, severity = "warning", for = "5m", keep = "10m" }
  }

  ratio_expr = "sum(rate(http_server_requests_seconds_count{application=\"bookshelf\",status=~\"5..\"}[%s])) / sum(rate(http_server_requests_seconds_count{application=\"bookshelf\"}[%s]))"
}

# Reuses grafana_folder.bookshelf from the provisioning page.

resource "grafana_rule_group" "slo_recording" {
  name             = "bookshelf-slo-recording"
  folder_uid       = grafana_folder.bookshelf.uid
  interval_seconds = 60

  dynamic "rule" {
    for_each = toset(local.windows)
    content {
      name = "bookshelf_5xx_ratio_rate${rule.value}"

      record {
        metric                = "application:http_server_requests_5xx:ratio_rate${rule.value}"
        from                  = "A"
        target_datasource_uid = "prometheus"
      }

      labels = {
        service = "bookshelf"
      }

      data {
        ref_id         = "A"
        datasource_uid = "prometheus"
        relative_time_range {
          from = 600
          to   = 0
        }
        model = jsonencode({
          refId   = "A"
          instant = true
          expr    = format(local.ratio_expr, rule.value, rule.value)
        })
      }
    }
  }
}

resource "grafana_rule_group" "slo_burn_rate" {
  name             = "bookshelf-slo-burn-rate"
  folder_uid       = grafana_folder.bookshelf.uid
  interval_seconds = 60

  dynamic "rule" {
    for_each = local.burn
    content {
      uid             = "bookshelf-slo-burn-${rule.key}"
      name            = "Bookshelf SLO burn rate (${rule.key})"
      condition       = "E"
      for             = rule.value.for
      keep_firing_for = rule.value.keep
      no_data_state   = "OK"
      exec_err_state  = "Error"
      is_paused       = false

      annotations = {
        summary     = "Bookshelf burns its error budget ${rule.value.burn_rate} times too fast (${rule.value.long} {{ printf \"%.3f\" $values.C.Value }}, ${rule.value.short} {{ printf \"%.3f\" $values.D.Value }})"
        description = "The 5xx ratio exceeds ${rule.value.threshold} in both the ${rule.value.long} and the ${rule.value.short} window, a ${rule.value.burn_rate}x burn of a 99.5 percent availability objective."
        runbook_url = "https://example.com/runbooks/bookshelf-slo-burn"
      }

      labels = {
        team     = "bookshelf-sre"
        severity = rule.value.severity
      }

      data {
        ref_id         = "A"
        datasource_uid = "prometheus"
        relative_time_range {
          from = 600
          to   = 0
        }
        model = jsonencode({
          datasource = local.prom
          expr       = "application:http_server_requests_5xx:ratio_rate${rule.value.long}"
          instant    = true
          range      = false
          refId      = "A"
        })
      }
      data {
        ref_id         = "B"
        datasource_uid = "prometheus"
        relative_time_range {
          from = 600
          to   = 0
        }
        model = jsonencode({
          datasource = local.prom
          expr       = "application:http_server_requests_5xx:ratio_rate${rule.value.short}"
          instant    = true
          range      = false
          refId      = "B"
        })
      }
      data {
        ref_id         = "C"
        datasource_uid = "__expr__"
        relative_time_range {
          from = 0
          to   = 0
        }
        model = jsonencode({
          datasource = local.expr
          expression = "A"
          reducer    = "last"
          settings   = { mode = "dropNN" }
          refId      = "C"
          type       = "reduce"
        })
      }
      data {
        ref_id         = "D"
        datasource_uid = "__expr__"
        relative_time_range {
          from = 0
          to   = 0
        }
        model = jsonencode({
          datasource = local.expr
          expression = "B"
          reducer    = "last"
          settings   = { mode = "dropNN" }
          refId      = "D"
          type       = "reduce"
        })
      }
      data {
        ref_id         = "E"
        datasource_uid = "__expr__"
        relative_time_range {
          from = 0
          to   = 0
        }
        model = jsonencode({
          datasource = local.expr
          expression = "$C > ${rule.value.threshold} && $D > ${rule.value.threshold}"
          refId      = "E"
          type       = "math"
        })
      }
    }
  }
}

Reference: Terraform: grafana_rule_group (rule, record, data, keep_firing_for, no_data_state), the recording rule example on Recording Rules and Grafana: Expression queries (Math, Operators). The folder, provider and token are the ones of Provisioning Alerting Resources, whose Bookshelf SLO burn rate rule (uid bookshelf-slo-burn-rate) is the single-pair version of the fast rule that queries the raw metric. The lab’s rule file already contains that single-pair rule, so this multiwindow version is an optional replacement: delete bookshelf-slo-burn-rate from the lab’s rule file before applying it, or the lab will notify twice. The rule data models follow the export format and should be checked by exporting a rule from the lab.

The alerts carry team = bookshelf-sre and a severity, so the policy tree of Notification Policies routes them to the contact point bookshelf-webhook (http://webhook-receiver:8080/grafana) with no change.

Comparison with Grafana SLO

Aspect Grafana SLO (Cloud) Rules on self-managed Grafana

SLI definition

Ratio or advanced query, validated by the wizard.

A PromQL ratio you write and keep consistent in several places.

Recording rules

10 to 12 per SLO, generated and recreated if deleted.

One per window, written by you.

Alert thresholds

Fast and slow burn generated; numbers not documented.

Explicit: 14.4 and 6 in the lab, visible in code review.

Dashboard

Generated.

Built by hand (see Building Dashboards).

Maintenance windows

Pause budget and burn-rate alerts for selected SLOs.

Mute timings and silences on the notification side; the budget still burns.

On-call and incidents

Grafana IRM.

Any receiver: webhook, e-mail, chat or another paging tool.

What can go wrong

  • The recorded series is missing. The recording rule is paused, Prometheus does not accept remote write or the feature toggle is off. The burn-rate rules use no_data_state = "OK" and dropNN, so a missing series makes them silently quiet; alert on the recorded metric separately, as recommended on Recording Rules.

  • No traffic. A ratio of zero over zero is NaN, which dropNN drops, so the alert stays normal. That is right for an idle lab and needs a deliberate choice for a real low-traffic service (the Grafana best practices suggest synthetic traffic or a minimum failure threshold).

  • Windows longer than the data. The 6-hour series means nothing until Prometheus has six hours of samples, so the slow rule is not trustworthy in a fresh lab; shorten local.windows and the pairs for experiments.

  • Mismatched intervals. Evaluating the alert more often than the recording rule reads the same point several times; the lab uses one minute for both.

  • Two copies of the same alert. The burn-rate rule on the provisioning page and the one here both fire.

  • An SLO that nobody owns. Without an error budget policy the alert pages and nothing changes; the shared page covers it.

  • Cloud features assumed on OSS. There is no wizard, no generated dashboard and no IRM unless you are on Grafana Cloud.

  • Maintenance window gaps (Cloud). Recording rules are not written during a window and are not backfilled, so queries on them have a hole for that period.

Verify it in the lab

  1. Start the grafana profile with the load generator running and apply the Terraform above. In Explore on the prometheus data source query application:http_server_requests_5xx:ratio_rate5m and the other three series; after two evaluations each must exist with the label service="bookshelf".

  2. Open Alerting, Alert rules, the folder bookshelf, and check that the two burn-rate rules (fast and slow) are Normal while the load is healthy.

  3. Switch the load generator to failing-request mode. The 5-minute series rises almost at once; the 1-hour series needs more time. With a healthy previous hour, a full outage must last about minutes before the 1-hour ratio passes 0.072, then the 2-minute for period applies, so expect the fast rule to fire after roughly six to seven minutes and to reach the webhook receiver with severity = critical. A freshly started lab has no healthy hour behind it: Prometheus then computes the 1-hour rate over the few minutes it holds, and the lab’s single-pair rule fired 2 minutes 38 seconds after the switch to failing-request mode.

  4. Return to normal traffic. The 5-minute window clears first, and keep_firing_for holds the alert for 5 more minutes before it resolves.

  5. Shorten the windows (for example 1m, 5m, 15m and 30m) and thresholds in locals to see the slow rule fire in the lab.

  6. On Grafana Cloud, additionally create the grafana_slo resource and compare its generated alert rules with the ones above.

In the books

Chapman and Holmes, Observability with Grafana, chapter 9, writes an alert from an SLI and SLO as a single threshold on a 5xx percentage and introduces Grafana OnCall and Incident as the parts of IRM next to Alerting. The multiwindow burn-rate alert, Grafana SLO’s generated rules and dashboard, the single IRM product with schedules, escalation chains and alert groups, and the Grafana-managed recording rules used here came later or are not covered. Hausenblas, Cloud Observability in Action, chapter 10, covers burn rate and commercial SLO offerings in general terms. Publisher pages are listed in the bibliography of the section index.