Search code examples
prometheus

How to execute multiple queries in one call in Prometheus


I'm running prometheus inside kubernetes cluster.

I need to send queries to Prometheus every minute, to gather information of many metrics from many containers. There are too match queries, so I must combine them.

I know how I can ask Prometheus for one metric information on multiple containers: my_metric{container_name=~"frontend|backend|db"} , but I haven't found a way to ask Prometheus for multiple metric information in one query.

I'm looking for the equivalent to 'union' in sql queries.


Solution

  • I found here this solution: {__name__=~"metricA|metricB|metricC",container_name=~"frontend|backend|db"}.