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] Period (.) at the beginning or end of a trigger name resets trigger conditions when editing monitor #203

Closed
AWSHurneyt opened this issue Mar 30, 2022 · 5 comments
Labels
bug Something isn't working v2.0.0

Comments

@AWSHurneyt
Copy link
Collaborator

Describe the bug
Having a . at the beginning or end of a trigger name causes the trigger condition values to reset when editing the monitor in the UX.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Create monitor
  2. Define a Per query monitor
  3. Create a trigger with a name that includes a . as the first or last character; e.g., .trigger or trigger.
  4. Create the monitor
  5. Go to the edit monitor page
  6. The trigger condition will reset to the default values of IS ABOVE 10000

Expected behavior
The UX should display the configured trigger condition; not the defaults.

Plugins
Alerting and alertingDashboards.

Screenshots
If applicable, add screenshots to help explain your problem.

Host/Environment (please complete the following information):

  • OS: IOS
  • Version 10.15.7

Additional context
Related issues from the ODFE alerting plugin repo:
opendistro-for-elasticsearch/alerting-kibana-plugin#152
opendistro-for-elasticsearch/alerting-kibana-plugin#199
opendistro-for-elasticsearch/alerting-kibana-plugin#207

@AWSHurneyt AWSHurneyt added bug Something isn't working untriaged labels Mar 30, 2022
@AWSHurneyt
Copy link
Collaborator Author

Per bucket monitors do not seem to have this same issue.

@AWSHurneyt
Copy link
Collaborator Author

Defining a per query monitor using the extraction query editor doesn't seem to have this issue either.

@AWSHurneyt
Copy link
Collaborator Author

Tracked the issue to formikToTrigger::formikToTriggerUiMetadataand triggerToFormik::queryLevelTriggerToFormik.

The _set() call on line 153 in formikToTriggerUiMetadata was removing the .s at the ends of the trigger name in the uiMetadata. In addition, the _.get() calls starting at line 49 in queryLevelTriggerToFormik were not factoring the . into their logic. This is likely due to the dot notation used for the path parameter of the _.get() and _.set() functions.

Implemented a fix that passes testing using trigger names like .trigger, trigger., ..trigger.., and .trigger.name..

@dblock
Copy link
Member

dblock commented Apr 18, 2022

Is this fixed @AWSHurneyt, still 2.0?

@AWSHurneyt
Copy link
Collaborator Author

Is this fixed @AWSHurneyt, still 2.0?

Yes, just merged the fix in today. I'll close this issue.

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

No branches or pull requests

2 participants