[Log threshold] Use dataViewLazy during rule execution#215306
Merged
maryam-saeidi merged 17 commits intoelastic:mainfrom Apr 9, 2025
Merged
[Log threshold] Use dataViewLazy during rule execution#215306maryam-saeidi merged 17 commits intoelastic:mainfrom
maryam-saeidi merged 17 commits intoelastic:mainfrom
Conversation
adcoelho
approved these changes
Apr 7, 2025
jughosta
approved these changes
Apr 7, 2025
Contributor
jughosta
left a comment
There was a problem hiding this comment.
Data Discovery changes LGTM 👍
Great to see that we are increasing data view lazy usage in rules!
weltenwort
reviewed
Apr 7, 2025
Member
weltenwort
left a comment
There was a problem hiding this comment.
LGTM, logs UI code still seem to work well. Nicely done 👏
I left just a few style/architecture questions below 😇
x-pack/platform/plugins/shared/logs_shared/common/log_views/resolved_log_view.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/logs_shared/common/log_views/resolved_log_view.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/logs_shared/common/log_views/resolved_log_view.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/logs_shared/public/services/log_views/log_views_client.ts
Outdated
Show resolved
Hide resolved
markov00
approved these changes
Apr 8, 2025
fkanout
approved these changes
Apr 8, 2025
Contributor
💚 Build Succeeded
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
History
|
weltenwort
approved these changes
Apr 9, 2025
Member
weltenwort
left a comment
There was a problem hiding this comment.
Great performance improvement, thanks a lot!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
In this PR, we use dataViewLazy, which avoids calling _field_caps API (this logic was introduced in this PR).
Questions
No, we don't need to call _field_caps API in rule execution.
We decided to use DataViewLazy everywhere on the server side but convert it to an actual DataView on the client side due to the need for the fields.
🧪 How to test
Create a log threshold rule and check its execution in traces filtered for your

usernameas the environment. There should be one with your rule name:The timing for
_field_capswould be more if you replace thecreateDataViewLazywith thecreatefunction.