Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform 警报策略“;在匹配资源上满足所有条件”;不匹配筛选器或groupByFields_Google Cloud Platform_Google Cloud Pubsub_Stackdriver_Google Cloud Stackdriver - Fatal编程技术网

Google cloud platform 警报策略“;在匹配资源上满足所有条件”;不匹配筛选器或groupByFields

Google cloud platform 警报策略“;在匹配资源上满足所有条件”;不匹配筛选器或groupByFields,google-cloud-platform,google-cloud-pubsub,stackdriver,google-cloud-stackdriver,Google Cloud Platform,Google Cloud Pubsub,Stackdriver,Google Cloud Stackdriver,感谢GCP Stackdriver,我愿意创建一个警报,为发布/订阅创建一个警报,例如“如果订阅有超过XXX条主题的等待消息(未确认),且该消费者在该主题上的消费率接近0,则触发警报” 我更习惯于普罗米修斯,在那里我可以简单地依靠标签加入timeseries,但我想知道如何使用Stackdriver做到这一点 首先,我考虑使用2个条件“当匹配资源的所有条件都满足时,策略违反”,但我想知道“匹配资源”是否与普罗米修斯中的行为相同 这是我想到的警报,但它似乎会在两个条件未完全满足时触发: { "

感谢GCP Stackdriver,我愿意创建一个警报,为发布/订阅创建一个警报,例如“如果订阅有超过XXX条主题的等待消息(未确认),且该消费者在该主题上的消费率接近0,则触发警报”

我更习惯于普罗米修斯,在那里我可以简单地依靠标签加入timeseries,但我想知道如何使用Stackdriver做到这一点

首先,我考虑使用2个条件“当匹配资源的所有条件都满足时,策略违反”,但我想知道“匹配资源”是否与普罗米修斯中的行为相同

这是我想到的警报,但它似乎会在两个条件未完全满足时触发:

{
  "combiner": "AND_WITH_MATCHING_RESOURCE",
  "conditions": [
    {
      "conditionThreshold": {
        "aggregations": [
          {
            "alignmentPeriod": "60s",
            "crossSeriesReducer": "REDUCE_SUM",
            "groupByFields": [
              "metadata.system_labels.topic_id",
              "resource.label.subscription_id"
            ],
            "perSeriesAligner": "ALIGN_RATE"
          }
        ],
        "comparison": "COMPARISON_LT",
        "duration": "300s",
        "filter": "metric.type=\"pubsub.googleapis.com/subscription/ack_message_count\" resource.type=\"pubsub_subscription\" resource.label.\"project_id\"=\"pl-service-prod-lm-fr\"",
        "thresholdValue": 1,
        "trigger": {
          "count": 1
        }
      },
      "displayName": "Ack message count"
    },
    {
      "conditionThreshold": {
        "aggregations": [
          {
            "alignmentPeriod": "60s",
            "crossSeriesReducer": "REDUCE_SUM",
            "groupByFields": [
              "metadata.system_labels.topic_id",
              "resource.label.subscription_id"
            ],
            "perSeriesAligner": "ALIGN_MEAN"
          }
        ],
        "comparison": "COMPARISON_GT",
        "duration": "300s",
        "filter": "metric.type=\"pubsub.googleapis.com/subscription/num_undelivered_messages\" resource.type=\"pubsub_subscription\" resource.label.\"project_id\"=\"pl-service-prod-lm-fr\"",
        "trigger": {
          "count": 1
        }
      },
      "displayName": "Unacked messages"
    }
  ],
  "displayName": "Pub/Sub is not consumed",
  "enabled": true,
  "incidentStrategy": {}
}