kibana/test
Davis McPhee bf9d34465e
[Discover] Add a default "All logs" temporary data view in the Observability Solution view (#205991)
## Summary

This PR adds an "All logs" ad hoc (temporary) data view to the Discover
Observability root profile based on the central log sources setting,
allowing quick access to logs (with the most up to date log sources)
without needing to first manually create a data view:
![CleanShot 2025-01-22 at 17 47
19@2x](https://github.com/user-attachments/assets/2c03ec79-0cf9-414e-8883-130599989c25)

To support this, a new `getDefaultAdHocDataViews` extension point has
been added to Discover, allowing profiles to specify an array of ad hoc
data view specs would should be created by default when the profile is
resolved, and automatically cleaned up when the profile changes or the
user leaves Discover.

Resolves #201669.
Resolves #189166.

### Notes

- The "All logs" ad hoc data view should only appear when using the
Observability Solution view (in any deployment type).
- Data view specs returned from `getDefaultAdHocDataViews` must include
consistent IDs across resolutions in order for Discover to manage them
correctly (e.g. to find and reload the data view after a page refresh).
Situations where we'd expect a change in ID (e.g. when saving to a
Discover session) are handled internally by Discover.
- To avoid a breaking change, the returned ad hoc data views have no
impact on the default data view shown when navigating to Discover. If
any persisted data views exist, one of them will be used as the default.
If no persisted data views exist, the first entry of the array returned
by `getDefaultAdHocDataViews` will be used as the default.
- We still want to notify users in Discover when they have no ES data at
all, and prompt them to install integrations. For this reason, the "no
data" page is still shown in Discover even if there are default profile
ad hoc data views (unlike if there are persisted data views, in which
case we use the default and hide the "no data" page).
- When saving a Discover session that uses a default profile ad hoc data
view, the data view will be copied on save as `{DATA_VIEW_NAME} (copy)`.
This allows us to assign a unique ID to the version that gets saved with
the Discover session, and avoids having to choose between the profile
data view or the embedded data view when reopening the session, which
has drawbacks:
- If choosing the profile data view, the Discover session may display
incorrectly if the log sources setting changed since it was saved, and
the user would no longer be able to view the session as it was intended
without first modifying the setting to the expected value.
- If choosing the embedded data view, the replacement shown after
opening the Discover session may not reflect the latest log sources
setting until a new session is started, and there would be no way for
the user to migrate the session to use the latest version of the profile
data view.

### Checklist

- [x] 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
- [x] [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.
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
2025-01-29 11:04:32 -04:00
..
accessibility [Console] UX Improvements for phase 2 (#190698) 2024-09-17 16:35:20 +03:00
analytics Add filters option to ftr_helper api (#196886) 2024-10-23 19:18:05 +02:00
api_integration [Search] Remove calls to enterprise search config (#206971) 2025-01-24 12:41:21 -06:00
common Additional prototype pollution protections (#206073) 2025-01-28 23:00:43 +01:00
examples Remove bfetch explorer example plugin (#204284) 2024-12-16 10:28:58 -07:00
functional [Discover] Add a default "All logs" temporary data view in the Observability Solution view (#205991) 2025-01-29 11:04:32 -04:00
harden Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
health_gateway Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
interactive_setup_api_integration fix(tests, interactive setup): switch interactive setup tests config to non-deprecated secure_password setting (#205208) 2024-12-27 17:51:43 +01:00
interactive_setup_functional fix(tests, interactive setup): switch interactive setup tests config to non-deprecated secure_password setting (#205208) 2024-12-27 17:51:43 +01:00
interpreter_functional Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
node_roles_functional Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
package [CI / FIPS] Convert smoke tests to use FIPS agent (#186858) 2024-06-26 12:55:51 -07:00
plugin_functional Additional prototype pollution protections (#206073) 2025-01-28 23:00:43 +01:00
scripts [ci] Remove jenkins config (#173745) 2023-12-21 12:09:43 -06:00
server_integration Set HTTP2 as default is SSL is enabled and add deprecation log if SSL is not enabled or protocol is set to HTTP1 (#204384) 2025-01-03 10:21:32 +01:00
ui_capabilities/newsfeed_err Adds AGPL 3.0 license (#192025) 2024-09-06 19:02:41 -06:00
kibana.jsonc Sustainable Kibana Architecture: Categorise straightforward packages (#199630) 2024-11-22 10:33:25 +01:00
tsconfig.json Disable log stream and settings pages (#203996) 2024-12-19 11:07:46 +00:00