Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datadog_monitor - Removal of 'silenced' resource argument has no practical effect #41

Closed
saj opened this issue Dec 28, 2017 · 3 comments
Labels

Comments

@saj
Copy link
Contributor

saj commented Dec 28, 2017

Terraform Version

  • Terraform v0.11.1
  • provider.datadog v1.0.2

Affected Resource(s)

  • datadog_monitor

Terraform Configuration Files

Start with something like this:

resource "datadog_monitor" "foo" {
  name = "..."
  type = "metric alert"
  ...

  # The significant bit.
  silenced {
    "*" = 0
  }
}

then remove the silenced argument:

resource "datadog_monitor" "foo" {
  name = "..."
  type = "metric alert"
  ...
}

Expected Behavior

  • Terraform removes the silence.
  • Terraform reaches steady state. (All resources should be in-sync.)

Actual Behavior

Terraform appears to remove the silence but this never actually happens:

module.redacted.datadog_monitor.redacted_a: Modifying... (ID: 3724916)
  silenced.%: "1" => "0"
  silenced.*: "0" => ""
module.redacted.datadog_monitor.redacted_b: Modifying... (ID: 3724915)
  silenced.%: "1" => "0"
  silenced.*: "0" => ""
module.redacted.datadog_monitor.redacted_c: Modifying... (ID: 3724914)
  silenced.%: "1" => "0"
  silenced.*: "0" => ""
module.redacted.datadog_monitor.redacted_d: Modifying... (ID: 3724917)
  silenced.%: "1" => "0"
  silenced.*: "0" => ""
module.redacted.datadog_monitor.redacted_c: Modifications complete after 1s (ID: 3724914)
module.redacted.datadog_monitor.redacted_d: Modifications complete after 1s (ID: 3724917)
module.redacted.datadog_monitor.redacted_a: Modifications complete after 1s (ID: 3724916)
module.redacted.datadog_monitor.redacted_b: Modifications complete after 1s (ID: 3724915)

Apply complete! Resources: 0 added, 4 changed, 0 destroyed.

Subsequent terraform plan invocations show the resources as out-of-sync, and subsequent terraform apply invocations end in the same result.

Workaround:

  1. Navigate to https://app.datadoghq.com/monitors#downtime
  2. Manually remove the silences.

Steps to Reproduce

  1. Create a new Datadog monitor using Terraform. The monitor is successfully created with a global silence.
  2. Modify the Datadog monitor using Terraform. Try to remove the silence created in the previous step. This will have no effect. Terraform will never reach steady state on its own.
@jamesmharvey
Copy link

If you don't want to use the web interface, another workaround is to set the silenced timestamp to some (non-zero) timestamp in the past.

@pdecat
Copy link
Contributor

pdecat commented Oct 30, 2018

It seems an explicit call to the https://api.datadoghq.com/api/v1/monitor/<MONITOR_ID>/unmute endpoint is required to effectively unmute the monitor's muted scopes: https://docs.datadoghq.com/api/#unmute-a-monitor

@masci masci added this to the 1.6.0 milestone Nov 29, 2018
@bal2ag
Copy link

bal2ag commented Dec 1, 2018

I wanted to make a comment that when this release was shipped (1.6.0) many of our monitors for which we were managing downtimes manually through the UI (required since the "silenced" argument wasn't working) suddenly were un-muted. I know this was an unintended consequence but it's causing us some difficulties as all of our manually managed downtimes were suddenly removed. Furthermore some monitors started failing to apply as they received a 400 response from Datadog (along the lines of a monitor already being unmuted).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants