SLOs and Maintenance Windows

Hello,

I am beginning to leverage SLO's and have a basic understanding so far. I created a synthetics availability SLO for some monitors. My question lies on how SLO's consider periods of maintenance. I know Kibana's Maintenance Windows are used to help avoid triggering alerts, but would maintenance windows be considered so it doesn't affect the target for the SLO.

Hi @erikg

Unfortunately the Maintenance Windows do not apply to SLOs... yeah I know a bummer. There is a design discussion on that at this time.

There is a rather low level workaround if you want roll up your sleeves. If involves some coding / work.

Here is the PR

Essentially you add a custom pipeline that gets called by the SLO ingest pipeline and you drop SLOs event during the window...

Your Pipeline would look like

PUT _ingest/pipeline/slo-54f50da8-77a2-4bd3-b4e8-1daf4f45aec9@custom
{
  "pipeline": {
    "processors": [
      {
        "drop": {
          "if": "def hour = ZonedDateTime.parse(ctx['@timestamp']).getHour(); return hour < 9 || hour >= 17"
        }
      }
    ]
  }
}

You get the Proper UID etc from the SLO Inspect at the Bottom of Editing your Slow... Look at the Rollup Pipeline and it will show you the name of the pipeline you need to create...

Now if I was doing this...

Instead of putting the drop directly into that pipeline I would have THAT pipeline call my drop calendar pipeline so I could reuse in a bunch of SLOs

So mine would looke like

PUT _ingest/pipeline/slo-drop-calendar
{
    "processors": [
      {
        "drop": {
          "if": "def hour = ZonedDateTime.parse(ctx['@timestamp']).getHour(); return hour < 9 || hour >= 17"
        }
      }
    ]
  }

PUT _ingest/pipeline/slo-54f50da8-77a2-4bd3-b4e8-1daf4f45aec9@custom
{
  "processors": [
    {
      "pipeline": {
        "ignore_missing_pipeline": true,
        "ignore_failure": true,
        "name": "slo-drop-calendar"
      }
    }
  ]
}

EDIT: Fixed Code Above

Probably way more than you wanted... but there you go

1 Like

woah thanks @stephenb !

1 Like