Skip to content

Conversation

@toepkerd
Copy link
Collaborator

@toepkerd toepkerd commented Oct 31, 2025

Description

Delete Monitor functionality and V1/V2 API separation measures

Related Issues

#1880

Check List

  • [Y] New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • [Y] Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

val scheduledJob = ScheduledJob.parse(xcp, getResponse.id, getResponse.version)

validateMonitorV1(scheduledJob)?.let {
actionListener.onFailure(AlertingException.wrap(it))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improve the exception thrown that the user is using the wrong delete api. Please do the same for the other v1 apis

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update the error message given to users to more explicitly state that the wrong API was used and make it more actionable, etc

}
}

fun getEmptySearchResponse(): SearchResponse {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these functions not used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functions are moved from TransportSearchMonitorAction to AlertingV2Utils. This logic isn't actually being deleted. Previous PRs included this util function in AlertingV2Utils, and this later PR catches up to delete it from where it came from.

}

// Checks if the exception is caused by an IndexNotFoundException (directly or nested).
private fun isIndexNotFoundException(e: Exception): Boolean {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this not used?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The functions are moved from TransportSearchMonitorAction to AlertingV2Utils. This logic isn't actually being deleted. Previous PRs included this util function in AlertingV2Utils, and this later PR catches up to delete it from where it came from.

val scheduledJob = ScheduledJob.parse(xcp, getResponse.id, getResponse.version)

AlertingV2Utils.validateMonitorV2(scheduledJob)?.let {
actionListener.onFailure(AlertingException.wrap(it))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should inform that the user needs to use the v1 api to delete

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will update the error message given to users to more explicitly state that the wrong API was used and make it more actionable, etc

Copy link
Collaborator

@AWSHurneyt AWSHurneyt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking:
My only comment is that it seems like separating some of these API into versions for V1 and V2 seems to just make managing the plugin assets via API more complex for customers.

Considering the assets these API interact with (V1 and V2 monitors) are all stored in the same index, and each asset has a unique ID, requiring customers to call different API in order to delete/get the asset via that ID seems overly complex. The V1/V2 split SearchMonitor API could probably be accomplished by using a filter either in the query, or a query param in the URI.

@toepkerd toepkerd merged commit fd151de into opensearch-project:main Nov 1, 2025
19 of 20 checks passed
@toepkerd toepkerd deleted the ppl-review branch November 2, 2025 18:32
opensearch-trigger-bot bot pushed a commit that referenced this pull request Nov 3, 2025
* PPL Alerting: Delete Monitor, More V1/V2 Separation

Signed-off-by: Dennis Toepker <[email protected]>

* making v1 v2 separation error messaging more actionable

Signed-off-by: Dennis Toepker <[email protected]>

---------

Signed-off-by: Dennis Toepker <[email protected]>
Co-authored-by: Dennis Toepker <[email protected]>
(cherry picked from commit fd151de)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
toepkerd pushed a commit that referenced this pull request Nov 3, 2025
* PPL Alerting: Delete Monitor, More V1/V2 Separation



* making v1 v2 separation error messaging more actionable



---------



(cherry picked from commit fd151de)

Signed-off-by: Dennis Toepker <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Dennis Toepker <[email protected]>
toepkerd added a commit to toepkerd/alerting that referenced this pull request Nov 9, 2025
…ct#1968)

* PPL Alerting: Delete Monitor, More V1/V2 Separation

Signed-off-by: Dennis Toepker <[email protected]>

* making v1 v2 separation error messaging more actionable

Signed-off-by: Dennis Toepker <[email protected]>

---------

Signed-off-by: Dennis Toepker <[email protected]>
Co-authored-by: Dennis Toepker <[email protected]>
toepkerd added a commit that referenced this pull request Nov 10, 2025
* PPL Alerting: Delete Monitor, More V1/V2 Separation



* making v1 v2 separation error messaging more actionable



---------

Signed-off-by: Dennis Toepker <[email protected]>
Co-authored-by: Dennis Toepker <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants