Like I said: if you want to create rules dynamically, then write out the
rules and drop them into a file which prometheus will pick up.
But I suspect you ought to gain some familiarity with writing alerting
rules by hand first.
I have one more question, what type of expressions I can put in alerting
> rules I mean only using metrics or a simple boolean expression also works
> or I need to make a custom metric for that...
>
You put in PromQL expressions - the same expressions which you'd use in the
web interface to query prometheus. The alert will fire when the rule
returns a value.
So for example, say you have 100 metrics called
"node_filesystem_avail_bytes". You can write an expression which filters
it down, e.g.
node_filesystem_avail_bytes{fstype!~"fuse.*|nfs.*"} < 100000000
If any of those returns a result, then the alert is triggered. If this
query returns no metrics at the current time, then there's no alert.
Documentation:
https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/
--
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/64d0e4a6-f313-4feb-9233-e537889fc454%40googlegroups.com.