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] Add dataset-specific categorization warnings #75351

Conversation

weltenwort
Copy link
Member

@weltenwort weltenwort commented Aug 18, 2020

Summary

This adds dataset-specific categorization warnings for the categorization module. The warnings are displayed in call-outs on the relevant tabs as well as the job setup screens if a prior job with warnings exists. To that end this also changes the categorization job configuration to enable the partitioned categorization mode.

closes #60392

Previews

image

image

Implementation notes

This also replaces the locally defined setup fly-out on the categories tab with the shared fly-out. To avoid leaking the log rate analysis module into that tab the fly-out can now be configured with an allow-list of modules to display.

@elastic/kibana-operations and @elastic/ml-ui were tagged as codeowners on this PR because I fixed one line in the storybook configuration and updated one of the ml module definitions created for the Logs UI.

Testing

  • This PR includes several storybooks to render the warning call-out and setup view in various states. Run yarn storybook infra to build it.
  • The categorization job configuration changes will only take effect for new jobs. A call-out should be displayed to the user.
  • Getting the ML jobs into a "warn" state is tricky. One way would be to ingest mostly identical log message so only one category is created. At least 100 documents are required to trigger any warning.
  • flog is a useful tool to generate log entries. They can be ingested using filebeat with a processor config such as
    processors:
      - dissect:
          tokenizer: "<%{syslog_priority}>%{syslog_version} %{@timestamp} %{message}"
          field: "message"
          target_prefix: ""
          overwrite_keys: true
      - add_fields:
          target: "event"
          fields:
            dataset: "static.test"

@weltenwort weltenwort added 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 v7.10.0 labels Aug 18, 2020
@weltenwort weltenwort added this to the Logs UI 7.10 milestone Aug 18, 2020
@weltenwort weltenwort self-assigned this Aug 18, 2020
@weltenwort weltenwort marked this pull request as ready for review September 2, 2020 13:07
@weltenwort weltenwort requested review from a team as code owners September 2, 2020 13:07
@elasticmachine
Copy link
Contributor

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

Copy link
Contributor

@spalger spalger left a comment

Choose a reason for hiding this comment

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

Operations LGTM, just fixes the location of the infra storybook

Copy link
Contributor

@afgomez afgomez left a comment

Choose a reason for hiding this comment

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

Thanks for the adding the component to storybook! It was useful for the first pass 👍

I have a comment regarding the layout. When the description of an issue in a dataset is too long, it wraps to the next line. If a dataset has several issues it looks a bit chaotic.

Screenshot 2020-09-08 at 15 34 33

Would it make sense to group the warnings per dataset? Something like:

**first.dataset**
• The analysis couldn't extract more than a single category from the log messages.
• 95% of the categories only rarely have messages assigned to them.
• The ratio of categories per analyzed document is very high with 0.7.

**second.dataset**
• None of the extracted categories frequently have messages assigned to them.
• 70% of the categories won't have new messages assigned to them because they are overshadowed by less specific categories.

Copy link
Contributor

@afgomez afgomez left a comment

Choose a reason for hiding this comment

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

I did a first pass on the code. I left some small comments.

reasons: CategoryQualityWarningReason[];
}

export type QualityWarning = CategoryQualityWarning;
Copy link
Contributor

Choose a reason for hiding this comment

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

Was there a reason to keep this alias? Otherwise I think we can safely remove it.

Copy link
Member Author

@weltenwort weltenwort Sep 21, 2020

Choose a reason for hiding this comment

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

Well, the thinking was that the CategoryQualityWarning is just a special case. I wanted to make that clear in the consuming code that it shouldn't rely too strictly on the fact that no other warnings have been implemented.

Other warnings could be that buckets have been skipped due to delay, which can happen in any anomaly detection job.

Copy link
Contributor

@afgomez afgomez left a comment

Choose a reason for hiding this comment

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

Code looks alright! I found a crash on an API call (see comment below).

Since we are creating the types ourselves I wonder if there are other things we missed. Maybe the ML team has shared types that we can reuse.

@afgomez afgomez self-assigned this Sep 14, 2020
@afgomez afgomez self-requested a review September 15, 2020 12:45
@afgomez
Copy link
Contributor

afgomez commented Sep 15, 2020

I added patches for some of the comments I had.

Copy link
Contributor

@afgomez afgomez left a comment

Choose a reason for hiding this comment

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

I addressed the changes I requested... so I approve my own changes!

@weltenwort
Copy link
Member Author

@afgomez thanks for the review and the grouping suggestions. Unfortunately the margin-top pushes the content outside of the accordion, so I'll have to solve that differently:

image

@weltenwort
Copy link
Member Author

@afgomez I modified the DOM structure to use a definition list, which looks almost the same as your solution. But it doesn't have the margin problem and doesn't skip heading levels for accessibility.

I updated the preview in the description. Does this look good to you?

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

@kbn/optimizer bundle module count

id value diff baseline
infra 1193 +69 1124

async chunks size

id value diff baseline
infra 4.2MB +12.3KB 4.2MB

page load bundle size

id value diff baseline
infra 277.4KB +25.0B 277.3KB

distributable file count

id value diff baseline
default 45883 +5 45878

History

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

@weltenwort weltenwort merged commit 3f2e9f7 into elastic:master Sep 24, 2020
@weltenwort weltenwort deleted the logs-ui-per-partition-categorization-warnings branch September 24, 2020 15:02
weltenwort added a commit to weltenwort/kibana that referenced this pull request Sep 24, 2020
This adds dataset-specific categorization warnings for the categorization module. The warnings are displayed in call-outs on the relevant tabs as well as the job setup screens if a prior job with warnings exists. To that end this also changes the categorization job configuration to enable the partitioned categorization mode.

Co-authored-by: Alejandro Fernández Gómez <[email protected]>
weltenwort added a commit that referenced this pull request Sep 24, 2020
…#78437)

Backports the following commits to 7.x:
 - [Logs UI] Add dataset-specific categorization warnings (#75351)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Logs UI Logs UI feature release_note:enhancement Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.10.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Logs UI] Include the dataset information in categorization warning message
5 participants