Groups
Groups
Sign in
Groups
Groups
Prometheus Users
Conversations
About
Send feedback
Help
Filter a Query from Results of Another Query
25 views
Skip to first unread message
Chris Beyers
unread,
Dec 4, 2023, 9:12:57 AM
12/4/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Prometheus Users
Grab the namespaces we want to collect data on:
sum(kube_namespace_labels{label_machineset="default"}) by (namespace)
Inject Into These Results:
kube_resourcequota{resource="limits.cpu",type="hard",namespace={only namespaces from previous query}}
How do I go about filtering the resourcequota totals from only namespaces returned in first query?
Much thanks!
Chris
Bryan Boreham
unread,
Dec 4, 2023, 9:15:32 AM
12/4/23
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Prometheus Users
The trick is to do a "join", which in PromQL terms can be an arithmetic expression.
Since the value of the first set of series is always 1, you can join by multiplying the two together.
Reply all
Reply to author
Forward
0 new messages