Hi Team On Sunday, 11 December 2022 at 23:20:24 UTC+5:30 [email protected] wrote:
> When you say "the value is missing", what condition exactly do you want to > alert on? > > To detect that there is *no* metric matching your selector, you can use > the absent(…) function. It returns 1 when … is nothing. > > It gets more complicated and difficult if you want to detect that a single > series has disappeared. In this case, you need to very specific in telling > Prometheus which series *should* exist. Common ways to do this are > > - listing them all out with separate absent(x) clauses and specific > positive matchers > - comparing to a previous time (x offset 15m unless x) > - use some other metric that lets you determine what should be there > - generate recording rules to create such a metric > > The fundamental challenge here is to distinguish between "this went > missing" and "this went away because of expected changes". > > In general, I prefer splitting "metric indicates there is a problem " and > "metric is missing" into two different alerts with separate names and > descriptions. To the one investigating, the difference matters. > Additionally using absent() often results in different label sets because > it cannot know labels for a time series that is absent. This causes trouble > with templating that you sidestep by using separate alert definitions to > begin with. > > /MR > > > On Fri, 9 Dec 2022, 08:31 Sebastian Glock, <[email protected]> wrote: > >> Hi, >> >> I'm having trouble setting up an alert that will send a notification when >> a value is different from 0 and the value is missing (i.e. null). >> >> expression: >> windows_mscluster_resourcegroup_state {name!~"Available Storage"} != 0 or >> on() vector(0) >> >> The alert goes off non-stop. How can I set the metric to send an alert >> when the value is different from 0 and is null? >> >> I tried with sum() but not working anyway: >> sum(windows_mscluster_resourcegroup_state {name!~"Available Storage"} != >> 0) or on() vector(0) >> >> Thanks for replies! >> >> -- >> > 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/9fbc7d5d-c7ce-4b93-b653-733cac798956n%40googlegroups.com >> >> <https://groups.google.com/d/msgid/prometheus-users/9fbc7d5d-c7ce-4b93-b653-733cac798956n%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/06c25a97-ca2f-4fd7-bd1a-82902864bd84n%40googlegroups.com.

