OpenSearch Alerts Timing Edge Case

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
Amazon OpenSearch Service v2.9

Describe the issue:
We’re currently using OpenSearch Alerts to get notified for the number of documents that were ingested each minute. The alert runs on an interval of 1m. We were concerned about timing edge cases since this could lead to inaccurate results. To address this, we rounded down to the beginning of the current minute and the beginning of the last minute. My question is, can there be an issue for an alert that was created at the edge of the minute?

Normal Working Case
So if my alert runs at 09:43:50am, my reverse query will send results between 09:42:00-09:43:00 as expected.
If my next alert runs at 09:44:51am (off by 1s due to some delay), my reverse query will send results between 09:43:00-09:44:00 as expected.

Edge Case
If my alert runs at 09:43:59am, my reverse query will send results between 09:42:00-09:43:00.
If my next alert runs at 09:45:00 (off by 1s due to some delay), my reverse query will send results between 09:44:00-09:45:00.
This skips the documents received between 09:43:00-09:44:00.

Is there anyway to avoid this?

Configuration:
Per Query Monitor
Interval: 1m

"bool": {
    "must": [
        {
            "range": {
                "ingestionDateTime": {
                    "gte": "now-60s/m",
                    "lt": "now/m"
                }
            }
        }
    ]
}

Relevant Logs or Screenshots:
N/A

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.