regexp usage

32 views
Skip to first unread message

Gabor Kiss

unread,
Apr 29, 2021, 9:14:48 AM4/29/21
to Prometheus Users
Hello guys!

I have a few servers with high memory usage and I want filtering them (In the example, server means string in that case). The hostname may vary:  bob-server-15.mydomain , server-alice.mydomain 15server.mydomain etc.

That was my first think, but it's wrong:

node_memory_MemAvailable_bytes{instance !~ ".server."}  / node_memory_MemTotal_bytes{instance !~ ".server."} * 100 < 15

Someone could help me out with this? 
Thank you,
Gabor

Gabor Kiss

unread,
Apr 30, 2021, 3:14:13 AM4/30/21
to l...@aurent.xyz, Prometheus Users
Thank you, It works perfectly! 

On Fri, Apr 30, 2021 at 7:54 AM Laurent C. <l...@aurent.xyz> wrote:

On 29/04/2021 15:14, 'Gabor Kiss' via Prometheus Users wrote:
> Hello guys!
>
Hi,


> I have a few servers with high memory usage and I want filtering them
> (In the example, server means string in that case). The hostname may
> vary:  bob-server-15.mydomain , server-alice.mydomain
> 15server.mydomain etc.
>
> That was my first think, but it's wrong:
>
> node_memory_MemAvailable_bytes{instance !~ ".server."}  /
> node_memory_MemTotal_bytes{instance !~ ".server."} * 100 < 15
>
I think this should do it:

node_memory_MemAvailable_bytes{instance !~ ".+server.+"}  /
node_memory_MemTotal_bytes{instance !~ ".+server.+"} * 100 < 15


Reply all
Reply to author
Forward
0 new messages