1

I have a metric to monitor the health status of microservices called nodejs_microservice_health_status.

I want to create a variable failedmicroservice which extracts the value of the service label of the metrics when nodejs_microservice_health_status equals to 0.

The PromQL query nodejs_microservice_health_status == bool 0 returns all the items equals to 0, but when I tried to set the Query of the variable to label_values({nodejs_microservice_health_status == bool 0}, service), enter image description here

I got the following error:

enter image description here

Do anyone knows how to do this?

Ken Tsoi
  • 1,195
  • 1
  • 17
  • 37

1 Answers1

4

Use the following values,

Query:

query_result(nodejs_microservice_health_status==0)

Regex:

/.*service=\"([^\"]+)\".*/