terraform-provider-sumologic icon indicating copy to clipboard operation
terraform-provider-sumologic copied to clipboard

Example SLO from documentation fails with error

Open mccartney opened this issue 2 years ago • 1 comments

Take the following:

resource "sumologic_slo" "slo_tf_window_based" {
  name        = "slo-tf-window-based"
  description = "example SLO created with terraform"
  parent_id   = "0000000000000001"
  signal_type = "Latency"
  service     = "auth"
  application = "login"
  compliance {
    compliance_type = "Rolling"
    size            = "7d"
    target          = 99
    timezone        = "Asia/Kolkata"
  }
  indicator {
    window_based_evaluation {
      op         = "LessThan"
      query_type = "Metrics"
      size       = "1m"
      threshold  = 200
      queries {
        query_group_type = "Threshold"
        query_group {
          row_id        = "A"
          query         = "metric=request_time_p90  service=auth api=login"
          use_row_count = false
        }
      }
    }
  }
}

straight from the provider documentation. When you apply it, you get:

│ Error: {"id":"F27ZZ-NM2EL-VIGFX","errors":[{"code":"slos:invalid_sli_evaluation_condition","message":"Invalid SLI evaluation condition.","detail":"Threshold based SLIs must have an aggregation defined over the window."}]}

mccartney avatar Feb 07 '23 09:02 mccartney

The doc also says:

aggregation - (Optional) Aggregation function applied over each window to arrive at SLI. Valid values are Avg , Sum, Count, Max, Min and p[1-99].

I guess the "Optional" needs a comment - it seems required in some cases.

mccartney avatar Feb 07 '23 09:02 mccartney