Absent doesn't work that way. It just tells you that there are no timeseries that match. As a result, when it fires there are no labels to give back to you.
If you make a broad regex, the alert won't fire unless there are no matches at all. For that reason, you will need a discrete alert for every process you want to monitor. --Matt On Thu, Apr 15, 2021 at 10:52 AM [email protected] <[email protected]> wrote: > I wanted to make this alert with lots of processes. > > Eg.: absent(process_cpu_usage{command=~"/usr/sbin/rsyslogd.*") or > absent(process_cpu_usage{command=~"/usr/sbin/mysql") or absent(....) > On Thursday, April 15, 2021 at 4:06:28 PM UTC+2 [email protected] wrote: > >> Absent doesn't return labels because there aren't any. Add the labels you >> need for the alert identification in the labels section. >> >> --Matt >> >> On Thu, Apr 15, 2021, 07:50 [email protected] <[email protected]> >> wrote: >> >>> Hi, >>> >>> I have cpu usage exporter with these metrics for every running processes. >>> process_cpu_usage{command="/usr/bin/rsyslog -n"} 0.12 >>> >>> I would like to use this exporter for monitoring if process is running. >>> >>> I've tried to use absent - but with regexp match it doesn't return >>> "command" label. And I need it for alert description >>> Eg: >>> absent(process_cpu_usage{command=~"/usr/sbin/rsyslogd.*", instance=" >>> my-server.com"}) >>> >>> Is there a way how to add label to vector(0)? >>> >>> Or do you know any other way, how to solve it? >>> >>> Thank you. >>> >>> >>> -- >>> 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/42c7e7dc-e32b-42f8-b7e9-a19d2ec0f485n%40googlegroups.com >>> <https://groups.google.com/d/msgid/prometheus-users/42c7e7dc-e32b-42f8-b7e9-a19d2ec0f485n%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > 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/08bd910d-d8ad-47af-a273-b0b6a5f8260dn%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/08bd910d-d8ad-47af-a273-b0b6a5f8260dn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- --Matt -- 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/CAGyBzcz%3DxJ_WAOWwoQw6tNzUMY80jQckUUXNP7zQ7OHnm%3Dxfgw%40mail.gmail.com.

