FWIW, we use saltstack based jinja2 templating with a configured systemd reload (ExecReload=/bin/kill -HUP $MAINPID) to update the thresholds, and it works fine
On Tuesday, February 28, 2023 at 9:31:12 AM UTC+1 Brian Candler wrote: > After changing the rules file, you'll need to trigger a prometheus reload, > either by hitting a special API endpoint or sending it a SIGHUP. See > https://prometheus.io/docs/prometheus/latest/management_api/#reload > > (Note: *don't* restart the prometheus process! That's a much slower > operation as it has to dump out and reload its WAL and can take several > minutes on a busy server) > > On Tuesday, 28 February 2023 at 06:55:24 UTC inmar tzemach wrote: > >> Thanks! >> >> How can I change the threshold from outside for giving expression while >> Prometheus running? >> >> On Monday, February 27, 2023 at 5:06:27 PM UTC+2 Brian Candler wrote: >> >>> No, but you can expand the rules files using a preprocessor of your >>> choice. >>> >>> If you want the threshold to be different for different time series, >>> then see >>> https://www.robustperception.io/using-time-series-as-alert-thresholds >>> >>> On Monday, 27 February 2023 at 13:58:47 UTC inmar tzemach wrote: >>> >>>> Is it possible to add parameters in rules files expression? >>>> Something like: >>>> expr: (100 - (avg by (instance) >>>> (irate(node_cpu_seconds_total{mode="idle"}[5m])) * 100)) > {{ $treshhold}} >>>> >>>> Thanks >>>> >>> -- 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/e3c57e07-094c-4d71-af0e-c9b0e0b34378n%40googlegroups.com.

