I am running prometheus in my kubernetes cluster.
I have the following system in kubernetes:
I have 4 nodes. I want to calculate free memory. I want to have the summation of those four nodes. Then I want to find the maximum over 1 day. So, for example,
at time=t1
node1: 500 MB
node2: 600 MB
node3: 200 MB
node4: 300 MB
Total = 1700 MB
at time=t2
node1: 400 MB
node2: 700 MB
node3: 100 MB
node4: 200 MB
Total = 1300 MB
at time=t3
node1: 600 MB
node2: 800 MB
node3: 1200 MB
node4: 1300 MB
Total = 3900 MB
at time=t4
node1: 100 MB
node2: 200 MB
node3: 300 MB
node4: 400 MB
Total = 1000 MB
So, The answer to my query should be 3900 MB. I am not able to do max_over_time for the sum. I tried(Which did not work)
max_over_time(sum(node_memory_MemFree)[2m])--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/76a9f208-e725-491f-9079-5aa628675756%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You need to use the range vector function first.sum(max_over_time(node_memory_MemFree[2m]))
On Jul 13, 2017 19:53, "Darshil Saraiya" <sdars...@gmail.com> wrote:
I am running prometheus in my kubernetes cluster.
I have the following system in kubernetes:
I have 4 nodes. I want to calculate free memory. I want to have the summation of those four nodes. Then I want to find the maximum over 1 day. So, for example,
at time=t1
node1: 500 MB
node2: 600 MB
node3: 200 MB
node4: 300 MB
Total = 1700 MB
at time=t2
node1: 400 MB
node2: 700 MB
node3: 100 MB
node4: 200 MB
Total = 1300 MB
at time=t3
node1: 100 MB
node2: 800 MB
node3: 1200 MB
node4: 1300 MB
Total = 3400 MB
at time=t4
node1: 100 MB
node2: 200 MB
node3: 300 MB
node4: 400 MB
Total = 1000 MB
So, The answer to my query should be 3400 MB. I am not able to do max_over_time for the sum. I tried(Which did not work)
max_over_time(sum(node_memory_MemFree)[2m])
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/985fe5a3-a2cd-4fed-8b1e-705d0255c977%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/985fe5a3-a2cd-4fed-8b1e-705d0255c977%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CABbyFmrvh62Awv-e1t0PL_%2B65coaw5ejmnUCwkDUBsMTRq3i_Q%40mail.gmail.com.
cluster:memory_used:bytes =
sum by (cluster) (
node_memory_MemTotal
) - sum by (cluster) (
node_memory_MemFree
) - sum by (cluster) (
node_memory_Buffers
) - sum by (cluster) (
node_memory_Cached
)
max_over_time(cluster:memory_used:bytes[2m])