You don't require to sum by a node when you are already querying with exact 
labels since I expect the output to be one. 
BTW, try with *container_memory_usage_bytes *instead of 
*container_memory_working_set_bytes*
On Wednesday, September 9, 2020 at 7:28:49 PM UTC+5:30 Anoop wrote:

> Hi,
>
> I am using Prometheus metric "container_memory_working_set_bytes" to 
> display the memory usage graph in %. However, it is showing a higher value 
> than what I can see when I use the linux command "free -h".
>
> The actual usage using linux command:
> [image: memory_linux.JPG]
>
> Based on this, it is actually taking less than 19%.
>
> *Now I am using below query to get the % value for memory usage:*
> sum by (node) 
> (container_memory_working_set_bytes{id="/",node="test-instance-e1"}) / sum 
> by (node) (machine_memory_bytes{node=" test-instance-e1"}) * 100
>
> But, this is showing 41%, which is not correct. 
>
> Can someone please guide me if there is any mistake in the Prometheus 
> query or if I can usage some other metrics/query to get the current memory 
> usage?
>
> Thank You,
> Anoop
>
>
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/bb710ee9-6cec-432d-9ec0-5703720ea5b1n%40googlegroups.com.

Reply via email to