Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a search monitors tool. Utilizes the added
getMonitor()
&searchMonitors()
fns exposed by the alerting interface in common utils. These were refactored from the alerting plugin -> common utils plugin. See related PRs for details:opensearch-project/common-utils#566
opensearch-project/alerting#1305
Based on the passed parameters, the tool will execute either the get monitor transport action, or search monitors transport action. The get monitor action is straightforward, and just takes in a monitor ID. The search monitors action takes in DSL to query the system index containing the monitor info. The tool handles the query generation logic to prevent the agent from generating it, which would likely be error prone and need advanced prompt engineering. Various params (all optional) are available to pass to the tool's
run()
function to generate a query (see here for an example generated query).The amount of parameters and/or the default values may be changed later on depending on agent performance and accuracy. For example, too much parameter tuning may lead to messy or invalid results.
Additionally, further integration testing will need to be done to validate different alerting-related questions input to the agent that will have this tool associated to it.
Issues Resolved
Closes #1545
Check List
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.