Is Prometheus allow to use conditional operation in PROMQL??

228 views
Skip to first unread message

gopal...@gmail.com

unread,
Oct 26, 2021, 2:03:27 PM10/26/21
to Prometheus Users
Hi,

Is there any way to use conditional operation in Prometheus like below

(?(cond)true|false)

Based on condition, i need to execute the another metrics

Example:

(?(Job_staus{job="XYZ_Job"}) XYZ_Record_Processed |XYZ_RecordFailed)

In above example checking XYZ job status periodically, if the Job is Active/True, 
then it should execute  XYZ_Record_Processed  metrics
else it should execute XYZ_RecordFailed metrics

Regards
Gopalakrishnan B
Reply all
Reply to author
Forward
0 new messages