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 analysis tab #41879

Closed
weltenwort opened this issue Jul 24, 2019 · 4 comments
Closed

[Logs UI] Add analysis tab #41879

weltenwort opened this issue Jul 24, 2019 · 4 comments
Assignees
Labels
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.4.0

Comments

@weltenwort
Copy link
Member

weltenwort commented Jul 24, 2019

Summary

After the Logs UI will have gained a top-level tab bar in #39071, the tab for the new ML-based log analysis screen needs to be added there.

Acceptance criteria

  • Under certain conditions an "Analysis" tab is present to the right of the "Stream" tab, but to the left of the "Settings" tab.
  • The tab is only present if the cluster has the required license and the user has the necessary permissions to use the categorization ML feature.
  • The tab's content depends on the existence of the jobs defined by the Machine Learning module (see the implementation notes below):
  • Failure scenarios
    • failed to get capabilities → hide tab

Implementation notes

  • The /api/ml/ml_capabilities API provides details about the user's capabilities. According to @jasonrhodes's research, the capabilities.canCreateJob is probably the best capability to use as a visibility criterion.
  • The existence and integrity of the jobs can be determined using the /api/ml/jobs/jobs_summary api, which takes a list of job ids as arguments:
    route({
    method: 'POST',
    path: '/api/ml/jobs/jobs_summary',
    handler(request) {
    const callWithRequest = callWithRequestFactory(elasticsearchPlugin, request);
    const { jobsSummary } = jobServiceProvider(callWithRequest);
    const { jobIds } = request.payload;
    return jobsSummary(jobIds)
    .catch(resp => wrapError(resp));
    },
    config: {
    ...commonRouteConfig
    }
    });

    The job ids used by this integration module are deterministically derived from the space id and the source id.
@weltenwort weltenwort added 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.4.0 labels Jul 24, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-logs-ui

@spong
Copy link
Member

spong commented Aug 2, 2019

Here's how the SIEM team ended up implementing the ml_capabilities checks in case this is of any (re)use :)

[SIEM] Adds Machine Learning Permissions to hide or show UI elements based on the permissions

There's also some custom ML API error parsing for displaying errors in toasts that might be useful as well. Feel free to reach out to myself or @FrankHassanabad as we just went through this for SIEM -- happy to chat about the things we encountered along the way.

@weltenwort
Copy link
Member Author

That's very helpful, thank you!

@Kerry350
Copy link
Contributor

Kerry350 commented Aug 5, 2019

@spong Thanks for the above, that'll be very useful 👌

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 Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services v7.4.0
Projects
None yet
Development

No branches or pull requests

5 participants