Describe the issue:
Hi everyone,
I’m working on a system that uses OpenSearch alerting monitors (from the _plugins/_alerting/monitors endpoint) to detect conditions and send alerts via Slack and PagerDuty destinations. Everything works fine in terms of triggering alerts — users get messages as expected.
However, I’m trying to visualize multiple historical alerts on a timeline in my frontend UI. Right now, I’m querying the .opendistro-alerting-alert* indices, but I only see a limited number of recent alerts (10 by default) and not the complete history of every alert that has ever been triggered for a specific monitor (rule).
Configuration:
- Does OpenSearch store all historical alert events by default?
- Or are they overwritten/limited by retention policies?
- If not, what’s the best practice to persist every triggered alert?
- I heard that using a webhook action in the monitor that stores events into a custom index could work — is that the recommended approach?
- How can I structure my monitor’s action to store every alert execution (with trigger metadata) into a custom index for long-term reporting?
- Any examples or best practices would be very helpful.
Relevant Logs or Screenshots:
Current Setup:
- OpenSearch 2.x
- Using monitors with query-level triggers
- Alerts go to Slack/PagerDuty
- Want to build a timeline chart in UI showing all times a trigger was fired (not just the latest alert)
Thanks in advance to anyone who can clarify this!
Let me know if you need more context or code.