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

[AO] Update the design of Threshold rule creation form #163313

Conversation

fkanout
Copy link
Contributor

@fkanout fkanout commented Aug 7, 2023

Summary

Fixes #162768
Fixes #162544

After update

Screenshot 2023-08-09 at 17 53 44

@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!)

@fkanout fkanout self-assigned this Aug 10, 2023
@fkanout fkanout added release_note:skip Skip the PR/issue when compiling release notes Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.10.0 labels Aug 10, 2023
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The metrics_row_with_agg file handles what this one was doing.

expect(valueMatch).toBeTruthy();
});

it('should render a helpText for the of expression', async () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This test is no longer relevant as we removed its related code, the OF expression

@fkanout fkanout marked this pull request as ready for review August 10, 2023 13:04
@fkanout fkanout requested a review from a team as a code owner August 10, 2023 13:04
@elasticmachine
Copy link
Contributor

Pinging @elastic/actionable-observability (Team: Actionable Observability)

@@ -20,7 +20,7 @@ export const LABEL_LABEL = i18n.translate(
export const LABEL_HELP_MESSAGE = i18n.translate(
'xpack.observability.threshold.rule.alertFlyout.customEquationEditor.labelHelpMessage',
Copy link
Member

@maryam-saeidi maryam-saeidi Aug 10, 2023

Choose a reason for hiding this comment

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

Make sure to rename the id or remove the related translations manually, as it is not clear when changing the defaultMessage, the related translations will be updated. (link)

Update: I asked for an update in the thread that I shared, and I got an answer, no need to change anything :)

@fkanout fkanout requested a review from maryam-saeidi August 10, 2023 14:19
@fkanout fkanout requested review from a team as code owners August 11, 2023 09:30
@maryam-saeidi
Copy link
Member

maryam-saeidi commented Aug 11, 2023

I am first checking the UI locally, I will check the code later.
The initial state of the rule at the creation time has a lot of red fields that need to be selected by the user, but it is not clear why there is an issue. What we can do is to have some meaningful default values similar to what we have in elasticsearch query:

Threshold rule Elasticsearch query rule
image image

We can use Document count as the default aggregation and add a default number for IS ABOVE.

Also, for the Document count aggregation, I don't know how user will be able to figure out they can also add a filter:
image
Is it possible to make Document count in one line?

@maciejforcone, what do you think?

cc @katrin-freihofner

@maryam-saeidi
Copy link
Member

When adding the second condition, the position of the delete icon is a bit off.

First condition Second condition Design
image image image

@maciejforcone In the design, we don't have a delete icon for the first condition, don't we want to give the user the option to delete the first condition instead of the second if they want to?

@maryam-saeidi
Copy link
Member

maryam-saeidi commented Aug 11, 2023

@maciejforcone Should we show the default equation in the EQUATION row?

Update
I see we have it in design:

@maryam-saeidi
Copy link
Member

maryam-saeidi commented Aug 11, 2023

@fkanout I noticed when the delete button is added, the aggregation width gets smaller, and there is a jump:

Current version

Screen.Recording.2023-08-11.at.17.06.06.mov

Design

Also, I am missing the divider between conditions according to design:

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.

Overall looks good, nice job! 👏🏻

Added some questions and comments :)

<EuiSpacer size="xs" />
<EuiExpression
data-test-subj="customEquation"
description={'Equation'}
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to translate this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added the i18n

/>
);
});
const metricRows = customMetrics?.map((row) => (
Copy link
Member

Choose a reason for hiding this comment

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

Nice! 🧹

)}
{criticalThresholdExpression}
</StyledExpressionRow>
<StyledExpressionRow style={{ gap: aggType !== 'custom' ? 24 : 12 }} />

{aggType === Aggregators.CUSTOM && (
Copy link
Member

Choose a reason for hiding this comment

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

Is this condition still needed, or can we get rid f it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deleted

@fkanout fkanout removed request for a team August 11, 2023 15:58
@fkanout
Copy link
Contributor Author

fkanout commented Aug 11, 2023

@maciejforcone Should we show the default equation in the EQUATION row?

**Update** I see we have it in design:

@maryam-saeidi, It's already there, but maybe you don't have the last version of the PR branch.

Screenshot 2023-08-11 at 18 18 19 Screenshot 2023-08-11 at 18 18 32

@fkanout fkanout enabled auto-merge (squash) August 11, 2023 16:33
Copy link
Member

@simianhacker simianhacker left a comment

Choose a reason for hiding this comment

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

LGTM

@fkanout fkanout dismissed maryam-saeidi’s stale review August 11, 2023 17:18

Addressed your code related comments. UI/UX questions and comments (tweaks) could be done in a follow up PRs.

@fkanout fkanout merged commit 2093a1f into elastic:main Aug 11, 2023
@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
observability 420 419 -1

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.0MB 1.0MB -628.0B

History

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

cc @fkanout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team: Actionable Observability - DEPRECATED For Observability Alerting and SLOs use "Team:obs-ux-management", for AIops "Team:obs-knowledge" v8.10.0
Projects
None yet
7 participants