Datadog new_host_delay deprecation issue

Viewed 422

I am using terraform to create datadog monitors and after upgrading my datadog's provider from version 3.2 to 3.8.1, I am getting deprecation messages about the argument new_host_delay used in my monitors:

Warning: Argument is deprecated
Use `new_group_delay` except when setting `new_host_delay` to zero.

So when I change my templates to replace new_host_delay with new_group_delay like shown here:

resource "datadog_monitor" "efs_size_monitor" {
  type                = "metric alert"
  name                = "EFS issue"
  message             = "Written too much data to EFS"
  query               = "sum(last_1d):sum:aws.efs.data_write_iobytes{filesystemid:fs-303ad9fb}.as_count() > ${512 * 1024 * 1024}"
  new_group_delay     = 300
#  new_host_delay      = 300 # Old, deprecated attribute
}

I get an error message instead:

Error: error validating monitor from https://api.datadoghq.com/api/v1/monitor/validate: 400 Bad Request: {"errors": ["The new_group_delay option can only be used for multi-alert monitors"]}

Am I missing something? Is it possible that the new argument new_group_delay can really only be used for monitors which group multiple sources and the orginial deprecation warning about new_host_delay is just wrong, because I am only monitoring a single file-system ID?

0 Answers
Related