need a help with PromQL

169 views
Skip to first unread message

Dmitry Kundo

unread,
Oct 21, 2021, 3:51:05 AM10/21/21
to Prometheus Users
Hello,

I'm using process-exporter (https://github.com/ncabatoff/process-exporter) for monitoring running processes on hundreds of servers. There is a known problem that if the process exporter hasn't seen a certain process since the exporter started, it won't report it as "missing" - actually there will be no metric at all for this process.
So the alert:  namedprocess_namegroup_num_procs(groupname="AAA") == 0 won't fire for such servers.
Found a solution suggesting using absent function for checking this situation but I'm not sure how to make it work because I don't understand how to express the relevant labels set. Each such metric also has "server_id" label which identifies a specific server.

What I need is to express this:

namedprocess_namegroup_num_procs(groupname="AAA") == 0 or  absent( namedprocess_namegroup_num_procs (groupname="AAA", server_id="???????")   

The monitored servers are a dynamic group (EC2 auto-scaling instances), so I don't know all possible servers in advance,  and anyway there are hundreds of them.

Regards,
Dmitry









Brian Brazil

unread,
Oct 21, 2021, 3:56:20 AM10/21/21
to Dmitry Kundo, Prometheus Users
On Thu, 21 Oct 2021 at 08:51, Dmitry Kundo <dku...@gmail.com> wrote:
Hello,

I'm using process-exporter (https://github.com/ncabatoff/process-exporter) for monitoring running processes on hundreds of servers. There is a known problem that if the process exporter hasn't seen a certain process since the exporter started, it won't report it as "missing" - actually there will be no metric at all for this process.
So the alert:  namedprocess_namegroup_num_procs(groupname="AAA") == 0 won't fire for such servers.
Found a solution suggesting using absent function for checking this situation but I'm not sure how to make it work because I don't understand how to express the relevant labels set. Each such metric also has "server_id" label which identifies a specific server.

What I need is to express this:

namedprocess_namegroup_num_procs(groupname="AAA") == 0 or  absent( namedprocess_namegroup_num_procs (groupname="AAA", server_id="???????")   


up{job="myjob"} unless ignoring(groupname, server_id) namedprocess_namegroup_num_procs{job="myjob",groupname="AAA"} > 0

Brian
 


The monitored servers are a dynamic group (EC2 auto-scaling instances), so I don't know all possible servers in advance,  and anyway there are hundreds of them.

Regards,
Dmitry









--
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 view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CADxb1xW4tVzCq5SMtXCUAF7%2BCdCuGffLZmsRSNVqM1KOBaO5Kw%40mail.gmail.com.


--
Reply all
Reply to author
Forward
0 new messages