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

librato_alert doesn't create a condition with a duration #8968

Closed
jonleighton opened this issue Sep 21, 2016 · 2 comments
Closed

librato_alert doesn't create a condition with a duration #8968

jonleighton opened this issue Sep 21, 2016 · 2 comments

Comments

@jonleighton
Copy link

When I use a duration in a condition block in a librato_alert, the duration is not set during the creation of the alert. A subsequent terraform apply attempts to set the duration, but this also fails due to #8966.

Terraform Version

0.7.4

Affected Resource(s)

librato_alert

Terraform Configuration Files

variable "librato_email" {}
variable "librato_token" {}

provider "librato" {
  email = "${var.librato_email}"
  token = "${var.librato_token}"
}

resource "librato_service" "default" {
  title = "Email"
  type = "mail"
  settings = <<SETTINGS
{
  "addresses": "[email protected]"
}
SETTINGS
}

resource "librato_alert" "default" {
  name = "test"
  description = "A Test Alert"
  services = [ "${librato_service.default.id}" ]

  condition {
    type = "above"
    threshold = 10
    metric_name = "test"
    duration = 60
  }
}

Debug Output

https://gist.github.com/jonleighton/b82e81e6ba92ffb80b5418cf247cce58

Expected Behavior

The alert's condition should have been created with a duration.

Actual Behavior

The alert's condition was created to trigger immediately.

Steps to Reproduce

  1. Create a Librato Metrics account and make a note of the email and API token
  2. Run curl -u '<email>:<token>' -d 'gauges[0][name]=test' -d 'gauges[0][value]=60' -X POST https://metrics-api.librato.com/v1/metrics to create a metric
  3. terraform apply -var 'librato_email=<email>' -var 'librato_token=<token>'

Now observe in Librato Metrics that the alert condition doesn't have the duration specified.

A subsequent terraform apply will detect this, and try to modify the alert. However this will also fail, due to #8966.

References

@elblivion
Copy link
Contributor

Very odd. I reproduced also by adding a duration to the test condition at https://github.com/hashicorp/terraform/blob/master/builtin/providers/librato/resource_librato_alert_test.go#L181. Doesn't seem to happen for a summary_function, will investigate when I have time.

elblivion added a commit to elblivion/terraform that referenced this issue Sep 22, 2016
@ghost
Copy link

ghost commented Apr 22, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants