resource "datadog_dashboard" "critical_prod_service" {
  title       = "Critical Production Service Status"
  description = "Summarises Status of monitors tagged as critical"
  layout_type = "ordered"
  reflow_type = "fixed"

  widget {
    manage_status_definition {
      query               = "tag:(service_type:critical AND title:\"healthy\" AND title: \"prod\")"
      title               = "Critical Service Healthy Tasks"
      display_format      = "countsAndList"
      sort                = "status,asc"
      summary_type        = "monitors"
      show_last_triggered = false
      hide_zero_counts    = true
    }
    widget_layout {
      height = 4
      width  = 4
      x      = 0
      y      = 0
    }
  }
  widget {
    manage_status_definition {
      query               = "tag:(service_type:critical AND title:\"5xx\" AND title: \"prod\")"
      title               = "Critical Service 5xx"
      display_format      = "countsAndList"
      sort                = "status,asc"
      summary_type        = "monitors"
      show_last_triggered = false
      hide_zero_counts    = true
    }
    widget_layout {
      height = 4
      width  = 4
      x      = 4
      y      = 0
    }
  }
}
