opensearch-project / alerting

📟 Get notified when your data meets certain conditions by setting up monitors, alerts, and notifications
https://opensearch.org/docs/latest/monitoring-plugins/alerting/index/
Apache License 2.0
60 stars 102 forks source link

Clean up doc level queries on dry run #1430

Closed jowg-amazon closed 7 months ago

jowg-amazon commented 7 months ago

Issue #, if available:

1296

Description of changes: When a doc level monitor gets created from the UI every time a character is inputted in the query's value field, the front end sends an execute monitor call to the back end because of the alerting preview query functionality. It performs a monitor dry run at every key press. The queries are then indexed into the query index for the dry run but is not cleaned up afterwards.

This PR cleans up any monitors with an empty monitor_id "" i.e. the doc level queries created from a dry run.

CheckList:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check here.

opensearch-trigger-bot[bot] commented 7 months ago

The backport to 2.7 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/alerting/backport-2.7 2.7
# Navigate to the new working tree
pushd ../.worktrees/alerting/backport-2.7
# Create a new branch
git switch --create backport-1430-to-2.7
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a5a67aed00aea927e735af563f06615ac979ff2e
# Push it to GitHub
git push --set-upstream origin backport-1430-to-2.7
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/alerting/backport-2.7

Then, create a pull request where the base branch is 2.7 and the compare/head branch is backport-1430-to-2.7.

opensearch-trigger-bot[bot] commented 7 months ago

The backport to 2.5 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/alerting/backport-2.5 2.5
# Navigate to the new working tree
pushd ../.worktrees/alerting/backport-2.5
# Create a new branch
git switch --create backport-1430-to-2.5
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a5a67aed00aea927e735af563f06615ac979ff2e
# Push it to GitHub
git push --set-upstream origin backport-1430-to-2.5
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/alerting/backport-2.5

Then, create a pull request where the base branch is 2.5 and the compare/head branch is backport-1430-to-2.5.

opensearch-trigger-bot[bot] commented 7 months ago

The backport to 2.9 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/alerting/backport-2.9 2.9
# Navigate to the new working tree
pushd ../.worktrees/alerting/backport-2.9
# Create a new branch
git switch --create backport-1430-to-2.9
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a5a67aed00aea927e735af563f06615ac979ff2e
# Push it to GitHub
git push --set-upstream origin backport-1430-to-2.9
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/alerting/backport-2.9

Then, create a pull request where the base branch is 2.9 and the compare/head branch is backport-1430-to-2.9.

opensearch-trigger-bot[bot] commented 7 months ago

The backport to 2.11 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/alerting/backport-2.11 2.11
# Navigate to the new working tree
pushd ../.worktrees/alerting/backport-2.11
# Create a new branch
git switch --create backport-1430-to-2.11
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a5a67aed00aea927e735af563f06615ac979ff2e
# Push it to GitHub
git push --set-upstream origin backport-1430-to-2.11
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/alerting/backport-2.11

Then, create a pull request where the base branch is 2.11 and the compare/head branch is backport-1430-to-2.11.

opensearch-trigger-bot[bot] commented 7 months ago

The backport to 2.10 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/alerting/backport-2.10 2.10
# Navigate to the new working tree
pushd ../.worktrees/alerting/backport-2.10
# Create a new branch
git switch --create backport-1430-to-2.10
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a5a67aed00aea927e735af563f06615ac979ff2e
# Push it to GitHub
git push --set-upstream origin backport-1430-to-2.10
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/alerting/backport-2.10

Then, create a pull request where the base branch is 2.10 and the compare/head branch is backport-1430-to-2.10.

opensearch-trigger-bot[bot] commented 7 months ago

The backport to 2.6 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/alerting/backport-2.6 2.6
# Navigate to the new working tree
pushd ../.worktrees/alerting/backport-2.6
# Create a new branch
git switch --create backport-1430-to-2.6
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a5a67aed00aea927e735af563f06615ac979ff2e
# Push it to GitHub
git push --set-upstream origin backport-1430-to-2.6
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/alerting/backport-2.6

Then, create a pull request where the base branch is 2.6 and the compare/head branch is backport-1430-to-2.6.

opensearch-trigger-bot[bot] commented 7 months ago

The backport to 2.8 failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/alerting/backport-2.8 2.8
# Navigate to the new working tree
pushd ../.worktrees/alerting/backport-2.8
# Create a new branch
git switch --create backport-1430-to-2.8
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 a5a67aed00aea927e735af563f06615ac979ff2e
# Push it to GitHub
git push --set-upstream origin backport-1430-to-2.8
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/alerting/backport-2.8

Then, create a pull request where the base branch is 2.8 and the compare/head branch is backport-1430-to-2.8.