Skip to content

new_group_delay only for multi-alert monitors #1221

Description

@johannes-mathes

Hi there,

Terraform Version

"0.14.6" also, 1.0.x
Run terraform -v to show the version. If you are not running the latest version of Terraform, please upgrade because your issue may have already been fixed.

datadog provider in latest version 3.4.0

Affected Resource(s)

resource "datadog_monitor"

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

resource "datadog_monitor" "running_task_count" {
  count               = var.task_count > 0 && var.monitoring_running_container_count ? 1 : 0
  name                = "VEDC - ${local.service_name}  - Running Task Count -${var.default_tags.Hub}-${var.default_tags.Stage}-${var.default_tags.Bluegreen} (ecs.containerinsights.DesiredTaskCount) TL"
  type                = "metric alert"
  query               = "min(last_5m):max:ecs.containerinsights.RunningTaskCount{clustername:${module.data_02.ecs_clusters_ecs_utils_cluster_name},servicename:${local.service_name_bluegreen}} < 0.99"
  message             = <<EOF
...
EOF
  tags                = local.datadog_monitor_tags
  new_group_delay      = 400
  require_full_window = false
  include_tags        = true
  monitor_thresholds {
    critical          = 0.99
    critical_recovery = 1
  }
}

Debug Output

Panic Output

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

Expected Behavior

According to the general documentation https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor

new_group_delay is to set. new_host_delay is deprecated. There is a warning if new_host_delay is set. No error should be thrown. So either un-deprecate new_host_delay or allow new_group_delay for all monitors.

new_group_delay (Number) Time (in seconds) to skip evaluations for new groups.
new_group_delay overrides new_host_delay if it is set to a nonzero value.

new_host_delay (Number, Deprecated) Time (in seconds) to allow a host to boot and applications to fully start before starting the evaluation of monitor results. Should be a non-negative integer. Defaults to 300 (this default will be removed in a major version release and new_host_delay will be removed entirely in a subsequent major version release). Deprecated. Prefer using new_group_delay (except when setting new_host_delay to zero).

Actual Behavior

Error is raised because new_group_delay is only for multi-alert monitors.

Steps to Reproduce

  1. terraform apply

Important Factoids

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions