Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

prometheus check if a metric is present

Tags:

prometheus

I have alerts based on a metric which in my case, sometimes, may disappear. Let's say the metric as up(env=prod) and up(env=staging). I have an alert based on the value of this metric. Now, I want to trigger another alert if up(env='staging') is not present. I can sum the metric by env and look at the value but it does not tell me which env is missing.

like image 708
Muatik Avatar asked Jul 16 '18 09:07

Muatik


1 Answers

You can do this with absent(up{env="staging"})

like image 194
brian-brazil Avatar answered Jan 02 '23 19:01

brian-brazil