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

[Logs UI] Fixes missing fields in the log entries search strategy #94443

Merged

Conversation

Kerry350
Copy link
Contributor

@Kerry350 Kerry350 commented Mar 11, 2021

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.

Screenshot 2021-03-11 at 11 38 51

@Kerry350 Kerry350 added bug Fixes for quality problems that affect the customer experience v8.0.0 Feature:Logs UI Logs UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services release_note:skip Skip the PR/issue when compiling release notes v7.12.0 v7.13.0 labels Mar 11, 2021
@Kerry350 Kerry350 requested a review from a team March 11, 2021 15:33
@Kerry350 Kerry350 self-assigned this Mar 11, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui)

@weltenwort weltenwort self-requested a review March 11, 2021 15:46
Copy link
Member

@weltenwort weltenwort left a 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),
Copy link
Member

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.

Suggested change
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,
Copy link
Member

Choose a reason for hiding this comment

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

Nit alert! 😉

Suggested change
request.params.columns ? request.params.columns : configuration.logColumns,
request.params.columns ?? configuration.logColumns,

Comment on lines +259 to +265
const getRequiredFields = (
configuration: LogSourceConfigurationProperties,
messageFormattingRules: CompiledLogMessageFormattingRule,
columnOverrides?: LogSourceColumnConfiguration[]
): string[] => {
const columns = columnOverrides ? columnOverrides : configuration.logColumns;

Copy link
Member

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)

Suggested change
const getRequiredFields = (
configuration: LogSourceConfigurationProperties,
messageFormattingRules: CompiledLogMessageFormattingRule,
columnOverrides?: LogSourceColumnConfiguration[]
): string[] => {
const columns = columnOverrides ? columnOverrides : configuration.logColumns;
const getRequiredFields = (
columns: LogSourceColumnConfiguration[],
messageFormattingRules: CompiledLogMessageFormattingRule
): string[] => {

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

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

cc @Kerry350

@weltenwort weltenwort added the auto-backport Deprecated - use backport:version if exact versions are needed label Mar 12, 2021
@weltenwort
Copy link
Member

After consulting with @Kerry350 I'll merge this as it is and defer the suggested changes to a follow-up.

@kibanamachine
Copy link
Contributor

💚 Backport successful

7.12 / #94522
7.x / #94523

Successful backport PRs will be merged automatically after passing CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed bug Fixes for quality problems that affect the customer experience Feature:Logs UI Logs UI feature release_note:skip Skip the PR/issue when compiling release notes Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.12.0 v7.13.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Logs UI] container.name column value doesn't get returned in log stream lookup
4 participants