Hi,
On 3/14/20 9:13 PM, Aditya Nageswar wrote:
> I want the threshold to be as a variable, I dont want to use it in
> static way.
>
> FYI, Similar to {{ $value }} I would like to know if there is something
> like {{ $threshold }} to print my alert threshold.
I don't think there is some special $threshold variable or something.
Prometheus does not know what values or metrics you use as thresholds --
it's just an arbitrary PromQL expression to Prometheus.
Therefore, you have to make this explicit. You probably want to have
something like this:
https://prometheus.io/docs/prometheus/latest/configuration/template_examples/#display-one-value
In other words: It won't be a variable such as $threshold, but rather
some {{ query 'foo_metric' }} in your case.
I cannot provide a more specific answer without knowing your actual query.
If you want specific guidance on some alert from your setup, it would be
best if you posted the actual alert definition here.
Kind regards,
Christian