Warm tip: This article is reproduced from stackoverflow.com, please click
containers kubernetes prometheus

Kubernetes Prometheus: Add alert when container memory usage is greater than total kube node memory

发布于 2020-04-13 10:27:07

I am monitoring several kubernetes clusters with Prometheus.

I want an alert rule that fires, when the total container memory usage exceeds or is equal to the total kube node memory capacity.

What I constructed is the following:

sum(container_memory_usage_bytes{instance=~"sa.*.domain"}) >= sum(kube_node_status_capacity_memory_bytes{node=~"sa.*.domain"})

but in the expression evaluator in the Prometheus GUI I get a numerical value back when I test this expression.

Can someone help me with the right expression?

Thanks in advance.

Best regards, rforberger

Questioner
Ronny Forberger
Viewed
69
Ronny Forberger 2020-02-03 22:24

I have rebuild the query, and have a question regarding it. I will open another question.