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

[Feature Request] `on_missing_data` not supported for log monitors

Open drmaciej opened this issue 2 years ago • 2 comments

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

1.1.7

Affected Resource(s)

datadog_monitor

Expected Behavior

Able to specify on_missing_data in a datadog_monitor resource with type = "log alert".

Actual Behavior

The field value defaults to "default" in the created resource.

drmaciej avatar Aug 12 '22 04:08 drmaciej

same problem with type = error-tracking alert

bberzinskas-tw avatar Aug 23 '22 05:08 bberzinskas-tw

Hi, what version of the Datadog terraform provider are you using? Could you share a sample config as well.

I tested out the below resource with v3.15.1 and on_missing_data property is set properly on the created monitor resource:

resource "datadog_monitor" "foo" {
  name = "Log alert monitor"
  type = "log alert"
  message = "some message Notify: @hipchat-channel"
  escalation_message = "the situation has escalated @pagerduty"
  query = "logs(\"service:foo AND type:error\").index(\"main\").rollup(\"count\").by(\"source\").last(\"5m\") > 2"
  monitor_thresholds {
	warning = "1.0"
	critical = "2.0"
  }
  renotify_interval = 60
  renotify_occurrences = 5
  renotify_statuses = ["alert", "warn"]
  notify_audit = false
  timeout_h = 1
  group_retention_duration = "2d"
  on_missing_data = "show_no_data"
  new_host_delay = 600
  evaluation_delay = 700
  include_tags = true
  require_full_window = true
  locked = false
  tags = ["foo:bar", "baz"]
  enable_logs_sample = true
}

skarimo avatar Sep 08 '22 18:09 skarimo

Closing this issue for now as we were unable to reproduce. Feel free to re-open and share a sample config if the behavior is still occurring for you. Thanks!

skarimo avatar Dec 28 '22 19:12 skarimo

Apologies, I have missed your response. I have now upgraded to 3.19.1 and it works as expected.

drmaciej avatar Jan 03 '23 04:01 drmaciej

@drmaciej for above just changing Datadog provider version 3.19.1 works or even Terraform needs a specific version or above ?

VidyadharRS avatar Oct 26 '23 15:10 VidyadharRS