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

[Infrastructure UI] urlStateStorage is missing when integrating LogsStream #154030

Closed
tonyghiani opened this issue Mar 30, 2023 · 1 comment · Fixed by #154061
Closed

[Infrastructure UI] urlStateStorage is missing when integrating LogsStream #154030

tonyghiani opened this issue Mar 30, 2023 · 1 comment · Fixed by #154061
Assignees
Labels
bug Fixes for quality problems that affect the customer experience Feature:Metrics UI Metrics UI feature Feature:ObsHosts Hosts feature within Observability Team:Infra Monitoring UI - DEPRECATED DEPRECATED - Label for the Infra Monitoring UI team. Use Team:obs-ux-infra_services

Comments

@tonyghiani
Copy link
Contributor

tonyghiani commented Mar 30, 2023

📓 Summary

When integrating the LogsStream into a different context, the page renders the following error urlStateStorage.get is not a function, with no chance to retrieve the logs entries correctly.

It may be related to the new changes introduced with #152933

The following screenshot refers to the Logs tab on the Hosts View page, but it also affects all the features using the LogStream component.

Screenshot 2023-03-30 at 10 58 39

The cause for this issue seems to be a missing provider KbnUrlStateStorageFromRouterProvider for the external consumers of the LogStream component.
Inside the infra plugin we have it at the Logs page level, while the other consumer is missing it.

✔️ Acceptance criteria

  • Should correctly render the logs entries.

👨‍💻 Implementation Hints

We could provide the proxy component LogStream with the missing provider KbnUrlStateStorageFromRouterProvider, this should allow any consumer to have the required dependency.

@tonyghiani tonyghiani added bug Fixes for quality problems that affect the customer experience 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 Feature:ObsHosts Hosts feature within Observability labels Mar 30, 2023
@elasticmachine
Copy link
Contributor

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

@tonyghiani tonyghiani changed the title [Infrastructure UI] Hosts View logs tab broken bacause urlStateStorage is missing [Infrastructure UI] urlStateStorage is missing when integrating LogsStream Mar 30, 2023
tonyghiani added a commit that referenced this issue Mar 30, 2023
## 📓 Summary

Closes #147691 

- Test hosts table content.
- Test to verify the search results hosts to propagate the filter to
other sections.
- Test Logs tab existence, to add a test for logs content once
#154030 is resolved.

---------

Co-authored-by: Marco Antonio Ghiani <[email protected]>
@Kerry350 Kerry350 self-assigned this Mar 30, 2023
jgowdyelastic pushed a commit to jgowdyelastic/kibana that referenced this issue Mar 30, 2023
…54026)

## 📓 Summary

Closes elastic#147691 

- Test hosts table content.
- Test to verify the search results hosts to propagate the filter to
other sections.
- Test Logs tab existence, to add a test for logs content once
elastic#154030 is resolved.

---------

Co-authored-by: Marco Antonio Ghiani <[email protected]>
Kerry350 added a commit that referenced this issue Mar 31, 2023
…54061)

## Summary

This fixes #154030 (and other
uses of the Log Stream embeddable component).

The embeddable component calls `useLogView()` directly, and this causes
issues with context dependencies for URL syncing from the consumers.

This PR makes the URL actions / services optional within the machine. 

Uses:

- `<LogViewProvider />` used for all main Logs pages (stream, anomalies,
categories) has full URL syncing ✅
- `<LogViewProvider />` used within our Logs alert editor does not have
URL syncing (not needed) ❌
- `useLogView()` as used by the embeddable component does not have URL
syncing ❌
- `useLogView()` as used by `RedirectToNodeLogs` does not have URL
syncing (not needed, URL syncing kicks in after redirect) ❌

The default / pure implementation of `initializeFromUrl` just does a
`send({ type: 'INITIALIZED_FROM_URL', logViewReference: null })` as the
state machine needs to transition to it's `initialized` state and is
already set up to use the initial context reference if there's no
reference obtained from the URL.

Examples:

![Screenshot 2023-03-30 at 15 23
48](https://user-images.githubusercontent.com/471693/228867868-b526c4b2-bec8-47cb-8e7c-c3da2dd6c803.png)

![Screenshot 2023-03-30 at 15 24
39](https://user-images.githubusercontent.com/471693/228867889-c7451f84-415c-45f9-ae96-e6908d60409c.png)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience Feature:Metrics UI Metrics UI feature Feature:ObsHosts Hosts feature within Observability 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.

3 participants