Combine 2 queries into single query

29 views
Skip to first unread message

Pradeep Bangala Ramesh

unread,
Feb 11, 2021, 2:58:04 AM2/11/21
to Prometheus Users
HI 

I would like to combine 2 prom queries in to single one
filter the instances with cpu utilization less than 50 and memory utilization less than 30

for cpu 
(1-rate(node_cpu_seconds_total{instance=~"$node",mode="idle"}[30m]))*100 < 50 

For memory 
((node_memory_MemTotal_bytes) - (node_memory_MemFree_bytes + node_memory_Cached_bytes + node_memory_Buffers_bytes)) / node_memory_MemTotal_bytes * 100 < 30

Please help on how to combine both queries in to single one

Regards,
Pradeep

P Priess

unread,
Feb 11, 2021, 3:28:07 PM2/11/21
to Prometheus Users
If I understand it correct, you mean you wan to combine several queries in one *Panel* on your dashboard?
To achieve this, you need to add a second query on the panel-editing-form in the lower part, at the end of the form. So you have at lest one line for each query in one panel.

HTH, Peter
Reply all
Reply to author
Forward
0 new messages