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

Add lazy loading to Infra AlertTypes #66190

Closed
gmmorris opened this issue May 12, 2020 · 2 comments · Fixed by #67654
Closed

Add lazy loading to Infra AlertTypes #66190

gmmorris opened this issue May 12, 2020 · 2 comments · Fixed by #67654
Assignees
Labels
chore Feature:Alerting Feature:Logs UI Logs UI feature Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Milestone

Comments

@gmmorris
Copy link
Contributor

Hey team,
In the Alerting team we've been addressing an issue where Kibana is forced to pre-load a bunch of React components at startup that aren't actually needed until the Alerting UI or flyout are opened: #65678 (Once this PR is merged)

Sadly, this requires changes in how the AlertTypes are actually registered by solutions and so we'd ask that, when you have capacity to do so, you make a small change in how you register your alerts.

In the case of Infra looks like we have three AlertTypes that need to change:

Luckily, changing your AlertType to load lazily is relatively straight forward and you can look at the built-in IndexThreshold AlertType as an example:

  1. Export your Expression component as a default export - as this is a hard requirement for lazy loading.

  2. Pass an React.LazyExoticComponent to the AlertType instead of the regular React.FC

That's about it.
Thanks 😊

@gmmorris gmmorris added Feature:Alerting Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services labels May 12, 2020
@elasticmachine
Copy link
Contributor

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

@weltenwort
Copy link
Member

This will be fixed by #67654

@weltenwort weltenwort added this to the Logs UI 7.9 milestone Jun 8, 2020
@weltenwort weltenwort moved this from Chores to In progress in Logs UI Backlog Jun 8, 2020
@weltenwort weltenwort self-assigned this Jun 8, 2020
@weltenwort weltenwort moved this from Chores to In progress in [INACTIVE] Metrics / Red Team Backlog Jun 8, 2020
Logs UI Backlog automation moved this from In progress to Done Jun 9, 2020
[INACTIVE] Metrics / Red Team Backlog automation moved this from In progress to Done Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Feature:Alerting Feature:Logs UI Logs UI feature Feature:Metrics UI Metrics UI feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants