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

Timeout_h has no effect on datadog_monitor #2636

Open
annedroiid opened this issue Oct 30, 2024 · 0 comments
Open

Timeout_h has no effect on datadog_monitor #2636

annedroiid opened this issue Oct 30, 2024 · 0 comments
Labels

Comments

@annedroiid
Copy link

Datadog Terraform Provider Version

v3.46.0

Terraform Version

1.6.6

What resources or data sources are affected?

resource_datadog_monitor

Terraform Configuration Files

resource "datadog_monitor" "example_monitor_1" {
name = "TEST Simple test monitor 1"
type = "metric alert"
message = "Sample monitor to get auto-resolving on no data working. Was created with timeout_h"

query = "avg(last_5m):avg:aws.applicationelb.target_response_time.p99{ingress.k8s.aws/stack:service-name/service-name-dev-ingress, region:us-west-2} > 2"

monitor_thresholds {
warning = 1
critical = 2
}

notify_no_data = false
renotify_interval = 60
evaluation_delay = 0
timeout_h = 0

tags = local.no_alert_tags
}

resource "datadog_monitor" "example_monitor_2" {
name = "TEST Simple test monitor 2"
type = "metric alert"
message = "Sample monitor to get auto-resolving on no data working. Was not created with timeout_h"

query = "avg(last_5m):avg:aws.applicationelb.target_response_time.p99{ingress.k8s.aws/stack:service-name/service-name-dev-ingress, region:us-west-2} > 2"

monitor_thresholds {
warning = 1
critical = 2
}

notify_no_data = false
renotify_interval = 60
evaluation_delay = 0

tags = local.no_alert_tags
}

Relevant debug or panic output

Initial terraform plan when neither monitor existed: https://gist.github.com/annedroiid/7d52b5085c1e6dec931c5490ba9ea834
Output from running terraform plan after adding timeout_h to the second monitor above: https://gist.github.com/annedroiid/ca9579e3a06c0412f40e53e17b426184

Expected Behavior

When the monitors were first created the first monitor should have had the setting If a group stops reporting data, resolve after enabled and set to 0.

When I updated the second monitor to also have the timeout_h it should have then added the field to that monitor too.

Actual Behavior

Even though the first monitor said it was going to add timeout_h in the plan, the actual monitor does not have the relevant flag set (image below)
Image

Adding the timeout_h flag to the existing monitor results in no changes listed when you run terraform plan. This was how I first discovered the issues with this field.

Steps to Reproduce

For the first part of the issue, running terraform apply and creating a monitor as described above will show the issue.

For the second part of the issue, running terraform plan when a monitor already exists and you've just added the timeout_h field will show the issue.

Important Factoids

I'm using terraform enterprise, I believe version v202406-1.

References

No response

@annedroiid annedroiid added the bug label Oct 30, 2024
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

1 participant