I am trying to modify .opendistro-alerting-alerts which store all the information related to monitors, triggers, and destination. I would like to add one more field inside trigger along with severity is risk_score can I do that? If it is possible how to achieve that?
Basically, I have been able to update the mapping of .opendistro-alerting-alerts, but while using this API(POST - _plugins/_alerting/monitors) to create a new monitor doesn’t add risk_score in it.
If I’m understanding correctly and you’re looking to update the information present in the Alerts you can follow what was mentioned here.
However, if you’re trying to update the Monitor config itself, you’ll want to make changes to the Monitor data model class to add any fields, including updating toXContent and parsing logic. Then you can update the Monitor mappings to account for those new fields.
@qreshi@skkosuri-amzn@pablo I have started setting up the alerting plugin with opensearch as a developer mode, first I clone the OpenSearch and run the./gradlew run command on my Linux VM, as by default alerting is not integrated with OpenSearch so for that what steps do I need to follow to integrate alerting plugin with my running OpenSearch and start editing the code to get my required outputs?
@mann If you clone the Alerting repo and run ./gradlew run there it will start up an OpenSearch cluster with Alerting on it so you can test any changes you’re making. You can refer to the developer guide for other useful commands as well.
@qreshi I am able to run on a Linux environment, and I was successfully able to integrate my own field under monitor config. Now as I am trying to understand the code workflow, can you let me know how to start or enable a debugger such that I can able to identify the files which are executed and their order.
For now, I manually added logger messages and tried to understand the workflow, once a Create Monitor API triggers.