在Bosun模板中,是否可以将评估变量的输出格式化为较小的精度小数位?
简单示例:
template test_template{
subject = test
body = {{.Eval .Alert.Vars.average_runtime}} seconds
}
alert test_alert{
template test_template
$average_runtime = avg(q("avg:metric_name", "24h",""))
crit = $average_runtime > 150.0
}
Run Code Online (Sandbox Code Playgroud)
结果是
190.71165892385326秒
在模板体中,这是不必要的精确.理想情况下,我希望看到:
190.71秒
bosun ×1