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] Visual Editor Monitor is saved as Extraction Query Monitor #1123

Closed
xluo-aws opened this issue Oct 10, 2024 · 4 comments
Closed

[BUG] Visual Editor Monitor is saved as Extraction Query Monitor #1123

xluo-aws opened this issue Oct 10, 2024 · 4 comments
Labels
bug Something isn't working untriaged

Comments

@xluo-aws
Copy link
Member

What is the bug?
I'm testing on future playground with a remote data source using 2.17.1 version. Create a visual editor monitor but it's saved as Extraction Query monitor. Main has the same issue

How can one reproduce the bug?
Steps to reproduce the behavior:

  1. Go to '...'
  2. Select a workspace with Alert feature
  3. Create a monitor using visual editor
  4. Once the monitor is created, the monitor definition type becomes Extraction query.

What is the expected behavior?
The monitor definition type should remain as visual editor

What is your host/environment?

  • Version [OS2.17.1]
  • Plugins [Alert]

Do you have any screenshots?
If applicable, add screenshots to help explain your problem.

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

@xluo-aws xluo-aws added bug Something isn't working untriaged labels Oct 10, 2024
@AWSHurneyt
Copy link
Collaborator

AWSHurneyt commented Oct 10, 2024

@xluo-aws I wasn't able to reproduce the issue using the playground link you provided above. I created hurneyt-test monitor which shows visual graph on the details page, and the edit page shows the visual editor display.

I also was not able to reproduce this issue on the current opensearchproject/2.17.1 docker image.

Screenshot 2024-10-10 at 11 58 55 AM

Screenshot 2024-10-10 at 12 00 05 PM

@AWSHurneyt
Copy link
Collaborator

I was able to reproduce the issue in the playground link provided above by adjusting the workspace/datasource. Troubleshooting now.

@AWSHurneyt
Copy link
Collaborator

After some troubleshooting locally, it looks like the backend is not returning the ui_metadata field of the monitor JSON. If a monitor is created by curl commands/devtools, we do not require the user to supply the ui_metadata, and the frontend will use the extraction query editor when the ui_metadata is not present. Continuing to troubleshoot why this field is not being sent to the frontend.
Screenshot 2024-10-10 at 7 08 21 PM

@songkant-aws
Copy link
Contributor

songkant-aws commented Oct 11, 2024

Backend ui_metadata is probably excluded based on 'User-Agent' header: https://github.com/opensearch-project/alerting/blob/main/alerting/src/main/kotlin/org/opensearch/alerting/util/RestHandlerUtils.kt#L20-L25.
The backend only includes ui_metadata only if the node server requests to opensearch 'User-Agent' header contain 'Opensearch-Dashboards'. However, MDSClient may not have it.

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

No branches or pull requests

3 participants