opensearch-project / alerting-dashboards-plugin

📟 Manage your monitors, alerts and notifications in OpenSearch Dashboards
https://opensearch.org/docs/latest/monitoring-plugins/alerting/index/
Apache License 2.0
25 stars 86 forks source link

In Opensearch miscellaneous behaviour in Alerts #1014

Open alwalaupendra opened 1 month ago

alwalaupendra commented 1 month ago

Raising this issue after discussion with AWS support person. In Opensearch alert monitor trigger condition does not work as expected. After speaking to aws support we got to know that issue seems to be specific to mustache.js and the javascript ecosystem in general. In alert trigger condition decimal number query conversion is not happening. Kindly help us to get resolved this.

amsiglan commented 1 month ago

Can you please provide an example of the trigger condition?

If you are using variables/fields that are integers then it is expected that the result will get round off

for example if the condition is

params.sum / params.total *100 > 70 and params = { sum: 3, total: 4 } then the result be false since 3/4 will evaluate to 0

For this to work correctly we need to cast the field to double (double)params.sum / params.total * 100 > 70 and that will evaluate to true