[Synthetics] Fix breadcrumbs in serverless#176947
[Synthetics] Fix breadcrumbs in serverless#176947justinkambic merged 16 commits intoelastic:mainfrom
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
13e314f to
7264ac9
Compare
tonyghiani
left a comment
There was a problem hiding this comment.
Code review only, deeplinks-observability changes LGTM.
|
Pinging @elastic/obs-ux-infra_services-team (Team:obs-ux-infra_services) |
There was a problem hiding this comment.
@crespocarlos I liked what @justinkambic is doing here. He's abstracting the setBreadcrumbs during kibana start to be either serverless or stateful kibana.
Clients don't care where they are, they just know how to add its value to the breadcrumbs.
I see the exact same code being written in different ways all over our plugins. Maybe this is a good thing to export to a common place.
There was a problem hiding this comment.
Yeah, this is very nice and more interesting than the other approaches I saw in the codebase.
At first, I thought about following a similar path, but I didn't want to change the useBreadcrumbs in the observabilty_shared at this moment.
Especially because by doing that, we're overriding the default serverless breadcrumbs feature, which observes the navigation tree config in the serverless-* plugins and sets the breadcrumbs automatically. If we do the same in the observability_shared we need to make sure everything that depends on it still works as expected
There was a problem hiding this comment.
In the case of Synthetics there is a good deal of custom-rolled breadcrumb logic and my motivation was to avoid touching that as much as possible.
This was nice because the API is very similar between chrome.setBreadcrumbs and the Serverless plugin's version; in the case of Synthetics it was a simple drop-in replacement.
shahzad31
left a comment
There was a problem hiding this comment.
Obs UX Changes LGTM !!
|
Hi 👋 Sorry if you were unnecessarily pinged. 🔔 |
…n. Reference serverless/chrome `setBreadcrumbs` helper based on environment.
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
Resolves https://github.com/elastic/synthetics-dev/issues/289.
The Synthetics plugin now consumes the Serverless breadcrumbs API when Kibana is running in Serverless mode.
This patch will re-use all the Synthetics plugin's existing breadcrumb logic, with some minor modifications. At plugin start time, Synthetics will detect if Kibana is stateful or stateless, and either assign the
serverless.setBreadcrumbsorcore.chrome.setBreadcrumbsfunction to the props that get propagated to theSyntheticsSettingsContext. The breadcrumb hooks in the React code will now reference this field, rather than directly pullingchrome.setBreadrumbsfrom the Kibana services object as it did before.This patch also introduces a new deep link for the Settings page, and adds an associated object to the Observability project nav tree.
One other thing to note is that this patch will also require Synthetics to add the
serverlessplugin as a dependency in itskibana.jsonfile.Checklist
Delete any items that are not applicable to this PR.
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
For maintainers