【发布时间】:2020-09-14 16:40:28
【问题描述】:
我正在尝试测试为 google pub sub 创建监视器并收到“无效查询”错误。这是我查看另一个工作监视器的源时的查询文本,所以我很困惑为什么这不起作用。
错误:Error: error creating monitor: 400 Bad Request: {"errors":["The value provided for parameter 'query' is invalid"]}
地形:
resource "datadog_monitor" "bad_stuff_sub_monitor" {
name = "${var.customer_name} Bad Stuff Monitor"
type = "metric alert"
message = "${var.customer_name} Bad Stuff Topic getting too big. Notify: ${var.datadog_monitor_notify_list}"
escalation_message = "Escalation message @pagerduty"
query = "avg:gcp.pubsub.subscription.num_undelivered_messages{project_id:terraform_gcp_test}"
thresholds = {
ok = 0
warning = 1
warning_recovery = 0
critical = 2
critical_recovery = 1
}
notify_no_data = false
renotify_interval = 1440
notify_audit = false
timeout_h = 60
include_tags = true
# ignore any changes in silenced value; using silenced is deprecated in favor of downtimes
lifecycle {
ignore_changes = [silenced]
}
tags = [var.customer_name, var.project_name]
}
【问题讨论】:
-
请注意像我这样的人:
type参数也很重要。如果您要离开示例,请确保更改类型以匹配您的查询
标签: terraform google-cloud-pubsub datadog terraform0.12+