Commit 68559b8
authored
[Infra UI] Migrate route: Infrastructure → Hosts (
Closes #287801
## Summary
Hosts already lives in the project side nav. This PR moves that page
onto the shared Kibana `AppHeader` and stops copying Chrome Next’s
compatibility Back.
### What changes
- **Title + no Back.** AppHeader title is **Hosts**. There is no “Back
to Infrastructure inventory.” Hosts is a side-nav destination; Chrome
Next showed Back only because breadcrumbs treated Inventory as a parent.
Solution view loses that Back as well — that is the agreed IA, not a
Hosts-page regression.
- **Search stays in the body.** Filters, date picker, KPI cards, and the
table sit under the header. They do not move into the title row.
- **Actions move to the AppHeader menu.** Anomaly detection, Alerts,
Settings, Inspect, and Add data leave the old chrome strip.
- **Onboarding keeps the header.** A cluster with no host metrics still
shows AppHeader. The Add-data card is the body. Search and table stay
hidden.
- **A failed has-data check keeps the table.** Blocking or 5xxing `GET
/api/metrics/source/hasData?source=host` must not swap a live page for
onboarding. Onboarding is only when that call succeeds and `hasData` is
false. The existing “Error while fetching resource” toast still appears.
- **Source / remote-cluster errors keep the header.** AppHeader still
shows Alerts / More / Add data. The error is a compact centered card in
the remaining pane, not a full-width banner.
### Implementation notes
- Do not pass `noDataConfig` / `onboardingFlow` into
`InfraPageTemplate`. That path unmounts `header`.
- `showOnboarding` is `isSuccess(status) && !hasData`. Failure and
pending stay on the table path (`hasDataOverride`).
- `UnifiedSearchProvider` and `HostsTimeRangeMetadataProvider` wrap the
template so a gate flip cannot tear down search subscriptions.
- `/hosts` is appended to `METRICS_HEADER_PORTAL_EXCLUDED_PATHS` so the
old `HeaderMenuPortal` does not mount a second action menu.
- Menu EBT comes from the shared `useMetricsAppHeaderMenu` helper (after
#289317). Hosts is the first Add data `detail: host`
(`showHostsOnboarding`). Inventory / Explorer stay `detail: infra`.
- Inspect moves into AppHeader **More**, still gated by
`observability:enableInspectEsQueries` (default off). Overflow shots
below were captured with the setting on.
### Solution view
| | Before (Chrome Next) | After (App Header) |
|:--|:--:|:--:|
| No data view | 
| 
|
| Hosts view | 
| 
|
| Source error | 
| 
|
| Has-data failure | 
| 
|
Overflow after (Settings, Inspect, Feedback;
`observability:enableInspectEsQueries` on):

### Classic view
| | Before (Chrome Next) | After (App Header) |
|:--|:--:|:--:|
| No data view | 
| 
|
| Hosts view | 
| 
|
| Source error | 
| 
|
| Has-data failure | 
| 
|
Overflow after (Settings, Inspect, Feedback;
`observability:enableInspectEsQueries` on):

## How to test
Repeat **every** step below in **both**:
- **Solution view**: `/s/oblt/app/metrics/hosts` (create a space `oblt`
with **Solution view: Observability** if it does not exist)
- **Classic view**: Default space `/app/metrics/hosts`
1. Start with the **no-data** screen. Confirm one Hosts header
(AppHeader title **Hosts**, no back) and the onboarding card in the body
(“Detect and resolve problems with your hosts”, **Add data**). Search
bar and table stay hidden.
2. Then check **AppHeader menu** items:
- **Anomaly detection**
- **Alerts** tray
- **Settings** (under More)
- **Inspect** (under More) after enabling **Inspect ES queries** in
Advanced Settings (`observability:enableInspectEsQueries`). Same gate as
the old chrome `InspectorHeaderLink`; default is off. Do not treat a
missing inline Inspect as a drop.
- **Add data** (onboarding category **host**; after #289317,
`data-ebt-detail="host"`)
3. Scan for layout discrepancies or distortion: doubled chrome menus,
clipped title, header not full-width, overlapping breadcrumbs, missing
border.
4. With data: search, filters, KPI cards, and the hosts table stay
**under** the header, not in the title. If the table is empty after
ingest, set the date picker to **Last 24 hours** and **Schema** to
**Elastic System Integration** (synthtrace host metrics are ECS).
5. **Do not expect** linked pages to already use AppHeader unless their
PR has merged. Metrics Explorer, Settings, and Host details
(`/app/metrics/detail/:type/:node`) are **separate PRs**. Opening those
destinations from this page is expected to still show classic chrome
until their PR lands. Host details and nested tabs are tested only in
the Detail PR.
6. Confirm the **source-error** state (block the
`/api/metrics/source/default` request URL segment in DevTools → Network
→ Request blocking to simulate a failed data-source load; use a wildcard
such as `*/api/metrics/source/default*` so it also matches
`/s/oblt/...`, and do not block `hasData`). AppHeader still shows Alerts
/ More / Add data. The error callout is a compact centered card in the
remaining pane, not a full-width banner under the header.
7. Confirm a failed **has-data** call (block
`*/api/metrics/source/hasData*`) keeps search + table. Do not show the
onboarding card. On `main` that failure currently swaps in onboarding.
<details>
<summary>Checklist</summary>
- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/docs/extend/kibana/contributing/workflow/how-we-use-github#release-notes)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
</details>
<details>
<summary>Identify risks</summary>
Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.
- **Risk**: People used to the compatibility Back will look for it.
**Mitigation**: called out here; Hosts remains in the side nav.
- **Risk**: Reviewers open Inventory / Settings / Detail from Hosts and
think those pages should already show AppHeader. **Mitigation**: testing
disclaimer above.
- **Risk**: Passing `noDataConfig` unmounts AppHeader. **Mitigation**:
onboarding is body-only (`HostsOnboardingPage`); source-error keeps
`header` on `InfraPageTemplate`.
- **Risk**: A failed has-data refresh used to replace a live table with
onboarding. **Mitigation**: `showOnboarding` is success && !hasData;
search providers wrap the template.
- **Risk**: Reviewers miss Inspect because it is overflow +
setting-gated. **Mitigation**: how-to-test step 2 and overflow recapture
with the setting on.
- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
</details>
## Release note
The Hosts page now uses the shared Kibana app header./app/metrics/hosts) to AppHeader / AppMenu (#287736)1 parent 20cbdc5 commit 68559b8
6 files changed
Lines changed: 325 additions & 29 deletions
File tree
- x-pack/solutions/observability/plugins/infra/public/pages/metrics
- header
- hosts
- components
- hooks
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | | - | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
Lines changed: 35 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
Lines changed: 181 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
0 commit comments