-
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] Fixes missing fields in the log entries search strategy #94443
[Logs UI] Fixes missing fields in the log entries search strategy #94443
Conversation
…es search strategy
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
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.
LGTM - thank you for the quick fix!
@@ -103,7 +107,7 @@ export const logEntriesSearchStrategyProvider = ({ | |||
params.size + 1, | |||
configuration.fields.timestamp, | |||
configuration.fields.tiebreaker, | |||
messageFormattingRules.requiredFields, | |||
getRequiredFields(configuration, messageFormattingRules, params.columns), |
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.
What do you think about branching between column overrides and config here? This would match the getLogEntryFromHit
signature more closely.
getRequiredFields(configuration, messageFormattingRules, params.columns), | |
getRequiredFields( | |
params.columns ?? configuration.logColumns, | |
messageFormattingRules | |
), | |
.map(getLogEntryFromHit(configuration.logColumns, messageFormattingRules)); | ||
.map( | ||
getLogEntryFromHit( | ||
request.params.columns ? request.params.columns : configuration.logColumns, |
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.
Nit alert! 😉
request.params.columns ? request.params.columns : configuration.logColumns, | |
request.params.columns ?? configuration.logColumns, |
const getRequiredFields = ( | ||
configuration: LogSourceConfigurationProperties, | ||
messageFormattingRules: CompiledLogMessageFormattingRule, | ||
columnOverrides?: LogSourceColumnConfiguration[] | ||
): string[] => { | ||
const columns = columnOverrides ? columnOverrides : configuration.logColumns; | ||
|
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.
(if we wanted to align the signatures as proposed above)
const getRequiredFields = ( | |
configuration: LogSourceConfigurationProperties, | |
messageFormattingRules: CompiledLogMessageFormattingRule, | |
columnOverrides?: LogSourceColumnConfiguration[] | |
): string[] => { | |
const columns = columnOverrides ? columnOverrides : configuration.logColumns; | |
const getRequiredFields = ( | |
columns: LogSourceColumnConfiguration[], | |
messageFormattingRules: CompiledLogMessageFormattingRule | |
): string[] => { |
After consulting with @Kerry350 I'll merge this as it is and defer the suggested changes to a follow-up. |
…4443) (#94523) Co-authored-by: Kerry Gallagher <[email protected]>
…4443) (#94522) Co-authored-by: Kerry Gallagher <[email protected]>
Summary
This fixes #94324. Fields from columns are now added to the log entries search strategy request. Log column overrides will also take precedence over those in the source configuration.