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

[Custom Threshold Rule] Fix custom threshold deletion/update #171919

Closed
wants to merge 4 commits into from

Conversation

shahzad31
Copy link
Contributor

@shahzad31 shahzad31 commented Nov 24, 2023

Summary

Fix custom threshold deletion/update !!

Set id in expression items to make sure uniqueness

Fixes #171623

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • /oblt-deploy-serverless : Deploy a serverless Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@shahzad31 shahzad31 added the release_note:skip Skip the PR/issue when compiling release notes label Nov 24, 2023
@shahzad31 shahzad31 marked this pull request as ready for review November 24, 2023 14:31
@shahzad31 shahzad31 requested a review from a team as a code owner November 24, 2023 14:31
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
observability 1.1MB 1.1MB +251.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

Copy link
Member

@maryam-saeidi maryam-saeidi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked metric threshold and we don't have this issue there, can we use a similar approach without adding an id to the rule's saved object and API? Since rule creation API is used by SRE, I rather not add extra fields there if it is not necessary.

Screen.Recording.2023-11-27.at.08.23.52.mov

@@ -75,6 +75,7 @@ export function thresholdRuleType(
threshold: schema.arrayOf(schema.number()),
comparator: oneOfLiterals(Object.values(Comparator)),
timeUnit: schema.string(),
id: schema.maybe(schema.string()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change, we are adding an id to the rule's saved object and our create/update API just for using it in UI, which I don't think is a good idea. Can we handle it only on the UI side without adding a field to the rule's saved object?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

id is only used in UI and isn't a required field when let's say user is using an API.

@botelastic botelastic bot added the Team:obs-ux-management Observability Management User Experience Team label Nov 28, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@maryam-saeidi
Copy link
Member

@shahzad31 I noticed that the issue only happens for the aggregation and equation section and I fixed it by making sure these sections will re-render if deletion happens. Here is the fix: #172187

@shahzad31
Copy link
Contributor Author

closing in favor of #172187

@shahzad31 shahzad31 closed this Nov 29, 2023
@shahzad31 shahzad31 deleted the remove-condition-issue branch November 29, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team:obs-ux-management Observability Management User Experience Team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Custom threshold] Bug in removing conditions
5 participants