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/6a6f9b4f-e41f-4a6c-9814-89b978704c75n%40googlegroups.com.

Reply via email to