gpt4 book ai didi

Terraform Datadog 查询无效

转载 作者:行者123 更新时间:2023-12-05 02:49:53 27 4
gpt4 key购买 nike

我正在尝试为 google pub sub 创建监视器,但收到“无效查询”错误。这是我查看另一个工作监视器的源代码时的查询文本,所以我很困惑为什么这不起作用。

错误:错误:创建监视器时出错:400 错误请求:{"errors":["为参数 'query' 提供的值无效"]}

地形:

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]
}

最佳答案

所以我最后只是查看了 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"

您似乎需要指定一个时间范围,并添加一个与您的严重警报阈值相匹配的比较阈值。这就是所缺少的。

关于Terraform Datadog 查询无效,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63888511/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com