Skip to content

[BUG] Anomaly detection features count locked at 5 #1016

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

Open
MCdeamon7 opened this issue Nov 16, 2023 · 12 comments · May be fixed by #1031
Open

[BUG] Anomaly detection features count locked at 5 #1016

MCdeamon7 opened this issue Nov 16, 2023 · 12 comments · May be fixed by #1031
Assignees
Labels
bug Something isn't working

Comments

@MCdeamon7
Copy link

ISSUE
The documentation say that plugins.anomaly_detection.max_anomaly_features can be increased up to 10, (and is limiting but better than nothing)
I increased it to 10 via DevTools:
PUT /_cluster/settings
{
"persistent" : {
"plugins": {
"anomaly_detection": {
"max_anomaly_features": "10"
}
}
}
}
And GET /_cluster/settings/ tell me that is actually persistent even after shutting down the docker compose and bringing it back up.
But at the moment I try to insert the feature in the anomaly detection job in the dashboard, the maximum is locked at 5.

To Reproduce
Steps to reproduce the behavior:

  1. Go to DevTools in dashboard
  2. send and past the previous command
  3. go to anomaly detection
    5.try to set more than 5 features.

Host/Environment (please complete the following information):

  • OS: [Linux Manjaro]
  • Deployment: Docker compose
  • Version [latest]

Additional context
Sorry for my broken English, I'm Italian but trying to improve.

@MCdeamon7 MCdeamon7 added bug Something isn't working untriaged labels Nov 16, 2023
@msfroh
Copy link

msfroh commented Nov 16, 2023

@opensearch-project/admin -- Can we please move this to https://github.com/opensearch-project/anomaly-detection ?

@gaiksaya gaiksaya transferred this issue from opensearch-project/OpenSearch Nov 16, 2023
@kaituo
Copy link
Collaborator

kaituo commented Nov 22, 2023

@MCdeamon7, this is indeed a bug. We provided support for backend, but the frontend hardcoded the number 5. Will put it in our backlog.

@kaituo kaituo removed the untriaged label Nov 22, 2023
@quangdutran
Copy link

Hi @kaituo this seems not too complicated for new contributor, should I try to work on it?

@kaituo
Copy link
Collaborator

kaituo commented Apr 14, 2025

@quangdutran Yes.

@quangdutran
Copy link

@opensearch-project/admin -- Can we move this issue to: https://github.com/opensearch-project/anomaly-detection-dashboards-plugin

It is FE issue

@zelinh zelinh transferred this issue from opensearch-project/anomaly-detection Apr 22, 2025
@andrross
Copy link
Member

Catch All Triage - 1

@andrross
Copy link
Member

@quangdutran Are you still working on this? I've assigned the issue to you, but if you're not working on it I'll remove you as the assignee. Thanks!

@quangdutran
Copy link

Yes @andrross I am still working on it but kinda struggle a bit with how to call the cluster setting API from BE. Is there any existing pattern to call the API or existing cluster setting variable that I can make use of?

@amitgalitz
Copy link
Member

Yes @andrross I am still working on it but kinda struggle a bit with how to call the cluster setting API from BE. Is there any existing pattern to call the API or existing cluster setting variable that I can make use of?

Do you mean calling the cluster setting API from the ad dashboards frontend code? Or do you mean simply calling and changing the setting from a curl/postman command?

@quangdutran
Copy link

Hi @amitgalitz I know that we are hard code the value here.

So my first idea is to call the API /_cluster/settings from BE to get the maximum features, then save to the constant. But this won't reflect when the limit is changed again. So better to call the API where-ever this constant is being used.

For example in Features, I dont really know how to call the API from here. ClusterInfo seems to be something useful but it does not contain that much information about feature limit.

If there is already a piece of code that do similar getting cluster setting, would you mind advice me pls

@amitgalitz
Copy link
Member

Hi @amitgalitz I know that we are hard code the value here.

So my first idea is to call the API /_cluster/settings from BE to get the maximum features, then save to the constant. But this won't reflect when the limit is changed again. So better to call the API where-ever this constant is being used.

For example in Features, I dont really know how to call the API from here. ClusterInfo seems to be something useful but it does not contain that much information about feature limit.

If there is already a piece of code that do similar getting cluster setting, would you mind advice me pls

So we don't have code specifically calling cluster settings in the AD Dashboards repo but there are similar examples in other opensearch dashboards plugins like alerting: https://github.com/opensearch-project/alerting-dashboards-plugin/blob/217bf4ddb31c786dd0c25f4e66d88fa7e63802e4/public/pages/utils/helpers.js#L103

What we need to do is make an api call to the cluster settings like we do other API calls in AD, we have some examples of calling opensearch APIs like cluster health or remote info https://github.com/opensearch-project/anomaly-detection-dashboards-plugin/blob/main/server/routes/opensearch.ts#L556

You can follow the pattern of other API calls and add a cluster setting call while also referencing how its done in alerting, we then want to call this method and use the number of features from the setting instead of a hard coded value.

@quangdutran quangdutran linked a pull request May 5, 2025 that will close this issue
4 tasks
@quangdutran
Copy link

Hi @amitgalitz could you help me to review the PR? A couple of notes:

  • I am not sure how to write UT test for this feature. If there is a sample, appreciate if you could show me.
  • The documentation for this is not necessary I guess.
  • Manual test seems ok

Image

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

Successfully merging a pull request may close this issue.

6 participants