-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Register Logs UI Locators #155156
[Logs UI] Register Logs UI Locators #155156
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced with Functional Tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replaced with Functional Tests
…register-logs-ui-kibana-locators
…register-logs-ui-kibana-locators
…register-logs-ui-kibana-locators
…register-logs-ui-kibana-locators
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the requested changes. The split registration we talked about also looks good 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the requested changes. The split registration we talked about also looks good 👌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the requested changes. The split registration we talked about also looks good 👌
(Sorry for the approval spam, GitHub wasn't responding when I clicked approve 🙈) |
💛 Build succeeded, but was flaky
Failed CI StepsMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
Unknown metric groupsAPI count
async chunk count
ESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
## Summary Closes #104855 This PR creates 2 registered locators: 1. Logs Locator 2. Node Logs Locator With these 2 locators, we now have a typed navigation to the logs UI which also redirects to Discover in serverless mode. ## Testing ### Normal behaviour When Kibana is used as always then on any navigation to the logs UI, the user will be redirected to the stream UI. All links to `link-to` routes should still behave as before. - Launch the Kibana dev environment with `yarn start` - Navigate to Hosts UI - Click the logs tab - Add a filter text in the search bar - Click on the Open in Logs link - Verify that navigation to the Stream view and the state is maintained https://user-images.githubusercontent.com/11225826/234514430-ddc1ffaa-0cb2-4f2a-84e9-6c6230937d9f.mov ### Serverless behaviour When Kibana is used in serverless mode, we want to redirect any user landing to Logs UI to the Discover page - Launch the Kibana dev environment with `yarn serverless-oblt` - Navigate to Hosts UI - Click the logs tab - Add a filter text in the search bar - Click on the Open in Logs link - Verify to be redirected to Discover and that the state is maintained https://user-images.githubusercontent.com/11225826/234514454-dfb2774e-d6f1-4f4c-ba10-77815dc1ae9d.mov ### Next Steps A separate PR will be created to fulfill the below AC - All usages of link-to routes in other apps are replaced with usage of the appropriate locator.
part of #157985 ## 📝 Summary After implementing [infra locators](#155156) to allow navigation to the logs UI we need to replace all usages of the old link-to routes so that we have strongly typed navigation to the logs UI. This PR focuses on replacing `link-to` usages in the Monitoring plugin. ## ✅ Testing 1. Navigate to Stack Monitoring 2. Choose any of the clusters from the list 3. Click logs under Elasticsearch 4. Scroll to the Recent Log Entries section 5. click on the Logs link `Visit Logs to dive deeper.` https://github.com/elastic/kibana/assets/11225826/b54da395-4693-4588-a8a3-6b05fdfed1c5 --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
part of #157985 ## 📝 Summary After implementing [infra locators](#155156) to allow navigation to the logs UI we need to replace all usages of the old link-to routes so that we have strongly typed navigation to the logs UI. This PR focuses on replacing `link-to` usages in the APM plugin. ## ✅ Testing 1. Navigate to APM -> Services 2. Follow video below to navigate to where the logs links are located 3. Links should behave as before and maintain navigation params https://github.com/elastic/kibana/assets/11225826/c631ea31-c5d9-4d05-9219-7b208daf2c37
part of #157985 ## 📝 Summary After implementing [infra locators](#155156) to allow navigation to the logs UI we need to replace all usages of the old link-to routes so that we have strongly typed navigation to the logs UI. This PR focuses on replacing `link-to` usages in the Infra Public plugin. ## ✅ Testing A) 1. Navigate to Observability -> Infrastructure -> Inventory 2. Choose any of the Host from the waffle 3. Click logs tab 4. Click open in logs link B) 1. Navigate to Observability -> Infrastructure -> Inventory 2. Switch to table view 3. Click any of the Host from the table 4. Click Host Logs https://github.com/elastic/kibana/assets/11225826/6646c496-1760-4788-9532-b318487070d1
closes [#157985](#157985) ## 📝 Summary This PR moves the previously implemented [infra locators](#155156) to infra common and replaces the last usage of `link-to` routes in the infra public with the appropriate locator. ## ✅ Testing 1. Navigate to Observability Alerts 2. Create a new Log Threshold Rule that should fire 3. Open the alert details flyout 4. Click on the `View in app` button 5. Should correctly navigate to Stream view or Discover in case of serverless. * All other links to Logs should still work properly as before as well https://github.com/elastic/kibana/assets/11225826/9af85ea6-5fdd-4505-9707-6489b760f311
Closes #185711 ## Summary This change fixes #185711, but while working on that I also realised that we should move away from using hardcoded urls. So this PR does two things: - Displays the button only when the user has `authz.fleet.readAgents` privilege - Refactors the button functionality to use the new locators that take care of linking to the observability logs/discover app ### Why the refactor While testing this button, I noticed that the functionality was broken in some cases, that's because we were manually routing the urls to Logs UI/Discover apps based if we are in serverless or not. I found a PR that already implements this functionality: #155156 I also found #154145 that takes care of the redirect to the correct app. So I'm replacing the current manual functionality with these utilities so that `getLogsLocatorsFromUrlService` takes care of where the open in logs button should link. ### ESS https://github.com/elastic/kibana/assets/16084106/3f0760c9-3afb-4793-a3af-317f625b36d7 https://github.com/elastic/kibana/assets/16084106/3436cf5a-36c9-425d-a114-e116ddaa1a03 ### Serverless https://github.com/elastic/kibana/assets/16084106/84176f09-96a4-4932-9508-5f7682d03aae --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
…ic#187871) Closes elastic#185711 ## Summary This change fixes elastic#185711, but while working on that I also realised that we should move away from using hardcoded urls. So this PR does two things: - Displays the button only when the user has `authz.fleet.readAgents` privilege - Refactors the button functionality to use the new locators that take care of linking to the observability logs/discover app ### Why the refactor While testing this button, I noticed that the functionality was broken in some cases, that's because we were manually routing the urls to Logs UI/Discover apps based if we are in serverless or not. I found a PR that already implements this functionality: elastic#155156 I also found elastic#154145 that takes care of the redirect to the correct app. So I'm replacing the current manual functionality with these utilities so that `getLogsLocatorsFromUrlService` takes care of where the open in logs button should link. ### ESS https://github.com/elastic/kibana/assets/16084106/3f0760c9-3afb-4793-a3af-317f625b36d7 https://github.com/elastic/kibana/assets/16084106/3436cf5a-36c9-425d-a114-e116ddaa1a03 ### Serverless https://github.com/elastic/kibana/assets/16084106/84176f09-96a4-4932-9508-5f7682d03aae --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> (cherry picked from commit 696bb88)
…#187871) (#188000) # Backport This will backport the following commits from `main` to `8.15`: - [[Fleet] Display view in logs button when logs app is available (#187871)](#187871) <!--- Backport version: 9.4.3 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Cristina Amico","email":"criamico@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-07-10T15:17:31Z","message":"[Fleet] Display view in logs button when logs app is available (#187871)\n\nCloses https://github.com/elastic/kibana/issues/185711\r\n\r\n## Summary\r\nThis change fixes #185711, but\r\nwhile working on that I also realised that we should move away from\r\nusing hardcoded urls. So this PR does two things:\r\n- Displays the button only when the user has `authz.fleet.readAgents`\r\nprivilege\r\n- Refactors the button functionality to use the new locators that take\r\ncare of linking to the observability logs/discover app\r\n\r\n### Why the refactor\r\nWhile testing this button, I noticed that the functionality was broken\r\nin some cases, that's because we were manually routing the urls to Logs\r\nUI/Discover apps based if we are in serverless or not.\r\n\r\nI found a PR that already implements this functionality:\r\nhttps://github.com//pull/155156\r\nI also found #154145 that takes\r\ncare of the redirect to the correct app.\r\nSo I'm replacing the current manual functionality with these utilities\r\nso that `getLogsLocatorsFromUrlService` takes care of where the open in\r\nlogs button should link.\r\n\r\n\r\n\r\n### ESS\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/16084106/3f0760c9-3afb-4793-a3af-317f625b36d7\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/16084106/3436cf5a-36c9-425d-a114-e116ddaa1a03\r\n\r\n### Serverless\r\n\r\nhttps://github.com/elastic/kibana/assets/16084106/84176f09-96a4-4932-9508-5f7682d03aae\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"696bb88d7c33eebfeabec6064ea8a97a2e2bb1bb","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:Fleet","v8.15.0","v8.16.0"],"title":"[Fleet] Display view in logs button when logs app is available","number":187871,"url":"https://github.com/elastic/kibana/pull/187871","mergeCommit":{"message":"[Fleet] Display view in logs button when logs app is available (#187871)\n\nCloses https://github.com/elastic/kibana/issues/185711\r\n\r\n## Summary\r\nThis change fixes #185711, but\r\nwhile working on that I also realised that we should move away from\r\nusing hardcoded urls. So this PR does two things:\r\n- Displays the button only when the user has `authz.fleet.readAgents`\r\nprivilege\r\n- Refactors the button functionality to use the new locators that take\r\ncare of linking to the observability logs/discover app\r\n\r\n### Why the refactor\r\nWhile testing this button, I noticed that the functionality was broken\r\nin some cases, that's because we were manually routing the urls to Logs\r\nUI/Discover apps based if we are in serverless or not.\r\n\r\nI found a PR that already implements this functionality:\r\nhttps://github.com//pull/155156\r\nI also found #154145 that takes\r\ncare of the redirect to the correct app.\r\nSo I'm replacing the current manual functionality with these utilities\r\nso that `getLogsLocatorsFromUrlService` takes care of where the open in\r\nlogs button should link.\r\n\r\n\r\n\r\n### ESS\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/16084106/3f0760c9-3afb-4793-a3af-317f625b36d7\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/16084106/3436cf5a-36c9-425d-a114-e116ddaa1a03\r\n\r\n### Serverless\r\n\r\nhttps://github.com/elastic/kibana/assets/16084106/84176f09-96a4-4932-9508-5f7682d03aae\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"696bb88d7c33eebfeabec6064ea8a97a2e2bb1bb"}},"sourceBranch":"main","suggestedTargetBranches":["8.15"],"targetPullRequestStates":[{"branch":"8.15","label":"v8.15.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/187871","number":187871,"mergeCommit":{"message":"[Fleet] Display view in logs button when logs app is available (#187871)\n\nCloses https://github.com/elastic/kibana/issues/185711\r\n\r\n## Summary\r\nThis change fixes #185711, but\r\nwhile working on that I also realised that we should move away from\r\nusing hardcoded urls. So this PR does two things:\r\n- Displays the button only when the user has `authz.fleet.readAgents`\r\nprivilege\r\n- Refactors the button functionality to use the new locators that take\r\ncare of linking to the observability logs/discover app\r\n\r\n### Why the refactor\r\nWhile testing this button, I noticed that the functionality was broken\r\nin some cases, that's because we were manually routing the urls to Logs\r\nUI/Discover apps based if we are in serverless or not.\r\n\r\nI found a PR that already implements this functionality:\r\nhttps://github.com//pull/155156\r\nI also found #154145 that takes\r\ncare of the redirect to the correct app.\r\nSo I'm replacing the current manual functionality with these utilities\r\nso that `getLogsLocatorsFromUrlService` takes care of where the open in\r\nlogs button should link.\r\n\r\n\r\n\r\n### ESS\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/16084106/3f0760c9-3afb-4793-a3af-317f625b36d7\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/16084106/3436cf5a-36c9-425d-a114-e116ddaa1a03\r\n\r\n### Serverless\r\n\r\nhttps://github.com/elastic/kibana/assets/16084106/84176f09-96a4-4932-9508-5f7682d03aae\r\n\r\n---------\r\n\r\nCo-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>\r\nCo-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>","sha":"696bb88d7c33eebfeabec6064ea8a97a2e2bb1bb"}}]}] BACKPORT--> Co-authored-by: Cristina Amico <criamico@users.noreply.github.com>
Summary
Closes #104855
This PR creates 2 registered locators:
With these 2 locators, we now have a typed navigation to the logs UI which also redirects to Discover in serverless mode.
Testing
Normal behaviour
When Kibana is used as always then on any navigation to the logs UI, the user will be redirected to the stream UI.
All links to
link-to
routes should still behave as before.yarn start
Screen.Recording.2023-04-26.at.10.13.02.mov
Serverless behaviour
When Kibana is used in serverless mode, we want to redirect any user landing to Logs UI to the Discover page
yarn serverless-oblt
Screen.Recording.2023-04-26.at.10.15.52.mov
Next Steps
A separate PR will be created to fulfill the below AC