Skip to content

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

Open
@AWSHurneyt

Description

@AWSHurneyt

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    Status

    Bugs

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions