Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Refactor GetAlerts API to not throw 404 NOT_FOUND errors #872

Open
AWSHurneyt opened this issue Feb 27, 2024 · 3 comments
Open

[BUG] Refactor GetAlerts API to not throw 404 NOT_FOUND errors #872

AWSHurneyt opened this issue Feb 27, 2024 · 3 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@AWSHurneyt
Copy link
Collaborator

What is the bug?
The GetAlerts API throws a 404 NOT_FOUND error when there are no detectors for the specified detectorType.
https://github.com/opensearch-project/security-analytics/blob/main/src/main/java/org/opensearch/securityanalytics/transport/TransportGetAlertsAction.java#L126

This can cause a built-up of 4xx errors on clusters that make regular/repeated calls to that API.

What is the expected behavior?
Rather than throw an error, the GetAlerts API could be refactored to instead return an empty list when there are no detectors defined for the specified detectorType.

@AWSHurneyt AWSHurneyt added bug Something isn't working good first issue Good for newcomers untriaged and removed untriaged labels Feb 27, 2024
@shanjare2002
Copy link

Hey can I do this

@AWSHurneyt
Copy link
Collaborator Author

@shanjare2002
Sure! Feel free to raise a PR.

riysaxen-amzn pushed a commit to riysaxen-amzn/security-analytics that referenced this issue Mar 25, 2024
…#872)

* Added 2.7 release notes.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Added 2.7 release notes.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

* Added 2.7 release notes.

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>

---------

Signed-off-by: AWSHurneyt <hurneyt@amazon.com>
(cherry picked from commit 6e94ee23ba9967d95afb1fe075457abd949c1688)

Co-authored-by: AWSHurneyt <hurneyt@amazon.com>
@eirsep
Copy link
Member

eirsep commented Mar 29, 2024

@shanjare2002 are you fixing this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
Development

No branches or pull requests

3 participants