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

Unable to add trigger to an alerting monitor for Monitor defining method as "anomaly detector" #1196

Open
sonu1311 opened this issue Jan 29, 2025 · 10 comments
Labels
bug Something isn't working

Comments

@sonu1311
Copy link

sonu1311 commented Jan 29, 2025

What is the bug?
I cannot create a trigger for my alert monitor configured for the anomaly detector. It tells me that "No features have been added to this anomaly detector," but per the screenshots provided here, I do have one configured.
In my debugging so far, it seems this log line in the dashboard pod could be the reason
statusCode":400,"req":{"url":"/api/alerting/detectors/6wlts5QBQ09GuqQB4YyT/results?startTime=1737573868672&endTime=1738178668672&preview=true"
as it's logged every time I click to add a trigger on the screen.

How can one reproduce the bug?

  1. Have a anomaly detector configured with a feature enabled
  2. Try to create a alerting monitor and choose anomaly detector as montitor defined method.
  3. Click on add trigger and the message come on the ui stating "No features have been added to this anomaly detector" and dashboard logs has that 400 http status get request.

What is the expected behavior?
It should let me add the trigger condition based on the feature I've in the anomaly detector.
What is your host/environment?

  • Linux
  • OpenSearch - 2.18
  • Plugins - Anomaly and alerting

Do you have any screenshots?

Image

Image

Do you have any additional context?
Add any other context about the problem.

@sonu1311 sonu1311 added bug Something isn't working untriaged labels Jan 29, 2025
@sonu1311 sonu1311 changed the title Unable to add trigger to an alerting monitor for monitor "anomaly detector" Unable to add trigger to an alerting monitor for Monitor defining method as "anomaly detector" Jan 29, 2025
@kaituo
Copy link
Contributor

kaituo commented Feb 5, 2025

I fixed this bug before: #502

@kaituo
Copy link
Contributor

kaituo commented Feb 5, 2025

pinged @amitgalitz to take a look.

@sonu1311
Copy link
Author

@kaituo, thank you for the reply. As mentioned in the ticket, the status code is 400, which generally means a bad request. I am running with demo security in setup, so not sure if that is playing any part in this.

@kaituo
Copy link
Contributor

kaituo commented Feb 11, 2025

@sonu1311 not sure. Assigned my teammate @siddharthabingi Siddhartha Bingi to take a look.

@siddharthabingi
Copy link

siddharthabingi commented Feb 12, 2025

When calling the API /api/alerting/detectors/<<detector-id>>/results?startTime=1737573868672&endTime=1738178668672&preview=true, the error was observed [request query.startTime]: definition for this key is missing. This occurs because the startTime and endTime parameters are not included in the validation schema for the query parameters in the route definition for AD (for 2.18).

Previously, this PR which was raised for Bug fix and mds support for AD Plugin APIs changed the query schema from schema.any() to query: createValidateQuerySchema(dataSourceEnabled) now the /.../startTime&endTime do not seem to be allowed.

@siddharthabingi
Copy link

@kaituo This bug has already been fixed in #1126 , but it needs to be backported to the 2.x

@kaituo
Copy link
Contributor

kaituo commented Feb 12, 2025

@siddharthabingi nice. Can you backport to 2.x and 2.19 branch (cc @AWSHurneyt )? Also, this breaks because we don't have IT. Can you add an IT in https://github.com/opensearch-project/alerting-dashboards-plugin/tree/main/cypress/integration ?

@AWSHurneyt
Copy link
Collaborator

@kaituo to clarify, this is the fix, correct? Looks like it's already in the 2.x branch
b62c1ad

Generated 2.19 backport PR
#1208

@kaituo
Copy link
Contributor

kaituo commented Feb 13, 2025

@AWSHurneyt Yes. Can you help review the 2.19 backport? This breaks AD alerting UI from 2.15~2.19. The backport will help ensure AOS 2.19 get the fix.

@krisfreedain
Copy link
Member

Catch All Triage - 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants