Google cloud stackdriver GCP操作套件监控和SLI用于定制服务指标

Google cloud stackdriver GCP操作套件监控和SLI用于定制服务指标,google-cloud-stackdriver,google-cloud-monitoring,Google Cloud Stackdriver,Google Cloud Monitoring,我已经为所有请求创建了基于请求日志的度量,如log\u-based\u-total\u-requests,为所有错误响应创建了log\u-based\u-errors。然后使用GCP监控API,我尝试将SLI设置如下: { "name": null, "displayName": "99.9% - Good/Total Ratio - Rolling day", "goal": 0.999, &quo

我已经为所有请求创建了基于请求日志的度量,如
log\u-based\u-total\u-requests
,为所有错误响应创建了
log\u-based\u-errors
。然后使用GCP监控API,我尝试将SLI设置如下:

{
  "name": null,
  "displayName": "99.9% - Good/Total Ratio - Rolling day",
  "goal": 0.999,
  "rollingPeriod": "86400s",
  "serviceLevelIndicator": {
    "requestBased": {
      "goodTotalRatio": {
        "totalServiceFilter": "metric.type=\"logging.googleapis.com/user/log_based_total_requests\" resource.type=\"gce_instance\"",
        "badServiceFilter": "metric.type=\"logging.googleapis.com/user/log_based_errors\" resource.type=\"gce_instance\""
      }
    }
  }
}
所有传入请求的SLI为99.9%,因此错误仅占所有请求的0.1%

在GCP监控中创建SLI SLO后,SLI SLO疯狂地显示为-8752.5%,当我尝试通过UI编辑它时,它会抛出以下消息:

分析SLO中使用的筛选器字符串时出现问题。只有 支持使用“和”连接标签的筛选器。过滤 不支持groupId。UI还不支持任何 基于请求的SLI,基于两个具有 不同的度量类型。表单中的数据已重置


所以我的问题是,我的SLI定义是否正确,如果正确,那么为什么我会出现错误,我的SLO显示奇怪的数据?

你能尝试在
badServiceFilter
上添加
metric.label