我有一个指标来监控名为 nodejs_microservice_health_status
的微服务的健康状态。
我想创建一个变量 failedmicroservice
,它在 service
等于 0 时提取指标的 nodejs_microservice_health_status
标签的值。
PromQL 查询 nodejs_microservice_health_status == bool 0
返回所有等于 0 的项目,但是当我尝试将变量的查询设置为 label_values({nodejs_microservice_health_status == bool 0}, service)
时,
我收到以下错误:
有人知道怎么做吗?
答案 0 :(得分:1)
使用以下值,
查询:
query_result(nodejs_microservice_health_status==0)
正则表达式:
/.*service=\"([^\"]+)\".*/