Der*_*k F 5 google-cloud-pubsub datadog terraform terraform0.12+
我正在尝试测试为 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]
}
Run Code Online (Sandbox Code Playgroud)
因此,我最终只是查看了 datadog terraform 提供程序中的测试,并注意到他们正在测试的查询格式。
query = "avg(last_30m):avg:gcp.pubsub.subscription.num_undelivered_messages{project_id:${var.project_name},subscription_id:{project_id:terraform_gcp_test} > 2"
Run Code Online (Sandbox Code Playgroud)
看来您需要指定一个时间范围,并添加与您的关键警报阈值相匹配的比较阈值。这就是所缺少的。
| 归档时间: |
|
| 查看次数: |
6808 次 |
| 最近记录: |