-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Discover] Add a default "All logs" temporary data view in the Observ…
…ability 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)
- Loading branch information
1 parent
e758f32
commit bf9d344
Showing
58 changed files
with
1,393 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/platform/packages/shared/kbn-es-query/src/filters/helpers/update_filter_references.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the "Elastic License | ||
* 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side | ||
* Public License v 1"; you may not use this file except in compliance with, at | ||
* your election, the "Elastic License 2.0", the "GNU Affero General Public | ||
* License v3.0 only", or the "Server Side Public License, v 1". | ||
*/ | ||
|
||
import { Filter } from '..'; | ||
|
||
export function updateFilterReferences( | ||
filters: Filter[], | ||
fromDataView: string, | ||
toDataView: string | undefined | ||
) { | ||
return (filters || []).map((filter) => { | ||
if (filter.meta.index === fromDataView) { | ||
return { | ||
...filter, | ||
meta: { | ||
...filter.meta, | ||
index: toDataView, | ||
}, | ||
}; | ||
} else { | ||
return filter; | ||
} | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.