Prometheus:根据另一个指标过滤查询

asp*_*yct 2 monitoring grafana prometheus

假设我在普罗米修斯中有两个指标,都是计数器:

  • requests_processed_total
  • requests_failed_total

他们都有一个匹配的service标签。例子:

requests_processed_total{service="news"} 1097
requests_processed_total{service="store"} 487
requests_failed_total{service="news"} 23
requests_failed_total{service="store"} 89
Run Code Online (Sandbox Code Playgroud)

如何查询requests_failed_total,但仅限于其服务request_processed_total > 1000

我期待以下回复:

requests_failed_total{service="news"} 23

# Note that the "store" service is excluded
Run Code Online (Sandbox Code Playgroud)