Skip to content

Terraform Monitor Criteria evaluateOverTime not waiting #2321

Description

@matiaschileno

Hello.
Using self-hosted 9.5.0 version and Terraform for creating monitors, I've configured a Monitor Criteria to set Monitor Status to offline when isOnline is false OR Response Status Code is not 200. I would like to do this only if any of the filters match for at least 5 minutes but this is not working, it is not waiting for 5 minutes, it triggers at the first occurrence immediately. What am I missing ?

The monitor interval is set to * * * * * (every minute) and this is my Terraform code for my offline criteria :

...
{
  _type = "MonitorCriteriaInstance"
  value = {
    alerts              = []
    changeMonitorStatus = true
    createAlerts        = false
    createIncidents     = true
    description         = "This criteria checks if the ${each.value.app_name} is offline"
    filterCondition     = "Any"
    filters = [
      {
        checkOn          = "Is Online"
        evaluateOverTime = true
        evaluateOverTimeOptions = {
          evaluateOverTimeType = "All Values"
          timeValueInMinutes   = "5"
        }
        filterType = "False"
      },
      {
        checkOn          = "Response Status Code"
        evaluateOverTime = true
        evaluateOverTimeOptions = {
          evaluateOverTimeType = "All Values"
          timeValueInMinutes   = "5"
        }
        filterType = "Not Equal To"
        value      = 200
      },
    ]
    id = each.value.criteria.offline.id
    incidents = [
      {
        autoResolveIncident = true
        description         = "${each.value.app_name} is currently offline."
        id                  = each.value.criteria.offline.incident_id
        incidentSeverityId = {
          _type = "ObjectID"
          value = local.global.incident_severities.critical
        }
        onCallPolicyIds = []
        title           = "${each.value.app_name} is offline"
      },
    ]
    monitorStatusId = local.global.monitor_statuses.offline
    name            = "Check if ${each.value.app_name} is offline"
  }
}
...

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions