-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Logs UI] Fix initial selection of log threshold alert condition field if missing from mapping #86488
[Logs UI] Fix initial selection of log threshold alert condition field if missing from mapping #86488
Conversation
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried locally with the kibana_sample_logs
index and it works as intended.
I have one observation: the first state, when no field is selected, looks "broken". As a user I wasn't sure what I was supposed to do, only that there was some invisible error after "WITH". Maybe it makes sense to pre-select the first field to show... something?
Other than that LGTM!
Yeah, I'm unsure about that. While selecting the first available field wouldn't be too hard, coming up with a valid default value would be some effort. It would have to be different for the different types ( |
💭 Or we could render " |
@afgomez what do you think about this? |
@afgomez given the various changes, would you mind having another look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still LGTM :) Thanks for adding the extra sentence for the empty field case 🙇
💚 Build SucceededMetrics [docs]Async chunks
Distributable file count
Page load bundle
History
To update your PR or re-run it, just comment with: |
…d if missing from mapping (elastic#86488) This avoid selecting the `log.level` field as the default in log threshold alerts if it is not present in the mapping of at least one source index.
This fixes a bug introduced with #86488, which prevents the user from changing the log threshold alert type to `ratio`.
…87563) This fixes a bug introduced with elastic#86488, which prevents the user from changing the log threshold alert type to `ratio`.
Summary
This avoid selecting the
log.level
field as the default in log threshold alerts if it is not present in the mapping of at least one source index.fixes #84414
Previews
Implementation notes
While following the code paths leading to the error I noticed the assumptions about the prop types passed to the alert expression editor are unvalidated. They were not tied to the actual prop types and therefore didn't cause the compiler to warn. By using the upstream alerting types in combination with an io-ts decoder this tries to make sure the types are sound both at compile- and runtime.