Querying pods with a certain enum value and info with Prometheus

1/16/2020

In my set up, I started the HTTP server to scrape my container for metrics. I am using the official Python package to implement the Enum metric e.g.

worker_status = prom.Enum('worker_status', 'Status of worker', states=['idle', 'running'])
  1. How can I write the PromQL query such that I can find the nodes with the state - idle/running?

Also, I am also using the Info metric e.g.

worker_spec = prom.Info('worker_spec', 'Spec which the worker is using to process')
.
.
.
worker_spec.info({'spec': os.getenv('TRAINING')})
  1. How can I write the query to find the container that matches BOTH the info spec i.e. worker_spec as well as the specific state i.e. worker_status.

I tried to use the and operator and == operator to find the container that matches both conditions but the graph just returns empty data.

-- Wong Seng Wee
kubernetes
prometheus

0 Answers