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

[Log Explorer] Include title and icon in installed packages API #160935

Closed
weltenwort opened this issue Jun 29, 2023 · 1 comment
Closed

[Log Explorer] Include title and icon in installed packages API #160935

weltenwort opened this issue Jun 29, 2023 · 1 comment
Assignees
Labels
Feature:LogsExplorer Logs Explorer feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services

Comments

@weltenwort
Copy link
Member

weltenwort commented Jun 29, 2023

📓 Summary

The API that paginates through the installed integrations currently only includes its name, but not the title or icons from the package manifest. Currently the dataset selector shows the name, which is not well formatted. In addition, the <PackageIcon> component it contains has to perform inefficient per-package queries to fetch the icons. We want to improve on both problems by including these data right in the API response.

✔️ Acceptance criteria

  • The "installed packages" route at ${EPM_ROOT}/packages/installed includes the following fields:
    • title: string as specified in the integration's package manifest
    • icons: PackageSpecIcon[] as specified in the integration's package manifest
  • If possible, the route handler performs at most one more query to fetch all the manifests at once.
  • The dataset selector uses the title to display the integration name.
  • The dataset selector uses the icons list to pre-populate the <PackageIcon>'s icons list to avoid an API call.

💡 Implementation hints

  • We want to use the PackageSpecIcon so the array can be passed to the <PackageIcon> component in the icons prop.
  • The package manifests are stored as saved object's of type epm-packages-assets in the data_utf8 field. They can be filtered for using a terms query on the asset_path fields assuming we know the package name and version. If there is a library helper in the fleet plugin to find these asset saved objects we should try to use it.
  • The manifest is in yaml format, which needs to be parsed safely and robustly.
@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 labels Jun 29, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI)

@Kerry350 Kerry350 self-assigned this Jun 30, 2023
Kerry350 added a commit that referenced this issue Jul 13, 2023
## Summary

Implements #160935.

This PR adds the `title` and `icons` (also `description` since it was
there) properties to the installed packages API, these are extracted
from the matching manifest assets (so that we don't have to call the
registry, and can query for multiple items at once). Discover has also
been updated to use these new properties.

List:

<img width="343" alt="Screenshot 2023-07-12 at 17 13 52"
src="https://github.com/elastic/kibana/assets/471693/6929b17d-5317-4332-96ea-0ee85c19aebe">

With selection:

<img width="319" alt="Screenshot 2023-07-12 at 17 14 10"
src="https://github.com/elastic/kibana/assets/471693/550d050f-5b33-42d9-9139-99164d64a770">

I've made this robust against a matching manifest asset not being found
- I don't think this is actually possible, but just incase.

## Testing

- When accessing the log explorer profile within Discover pretty titles
should be displayed in the dataset selector
- When accessing the log explorer profile within Discover icons should
be displayed in the dataset selector

---------

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
@gbamparop gbamparop added Feature:LogsExplorer Logs Explorer feature and removed Feature:Logs UI Logs UI feature labels Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:LogsExplorer Logs Explorer feature Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services
Projects
None yet
Development

No branches or pull requests

4 participants