forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Discover] Only show logs profiles for O11y solution view (elastic#19…
…9255) ## Summary This PR updates the current logs data source profiles and log document profile to only be active in the Observability solution view. It also restructures some folders to conform to the solution folder conventions in our docs. Lastly it restructures the functional tests so that the logs profiles tests only run for Observability serverless projects, and the core context awareness suite only tests example implementations. ### Checklist - [ ] 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/packages/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 - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] Any UI touched in this PR is usable by keyboard only (learn more about [keyboard accessibility](https://webaim.org/techniques/keyboard/)) - [ ] Any UI touched in this PR does not create any new axe failures (run axe in browser: [FF](https://addons.mozilla.org/en-US/firefox/addon/axe-devtools/), [Chrome](https://chrome.google.com/webstore/detail/axe-web-accessibility-tes/lhdoppojpmngadmnindnejefpokejbdd?hl=en-US)) - [ ] 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 renders correctly on smaller devices using a responsive layout. (You can test this [in your browser](https://www.browserstack.com/guide/responsive-testing-on-local-server)) - [ ] This was checked for [cross-browser compatibility](https://www.elastic.co/support/matrix#matrix_browsers) ### For maintainers - [ ] This was checked for breaking API changes and was [labeled appropriately](https://www.elastic.co/guide/en/kibana/master/contributing.html#_add_your_labels) - [ ] This will appear in the **Release Notes** and follow the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process) --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
be93259
commit a3be2c7
Showing
60 changed files
with
1,305 additions
and
1,622 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
10 changes: 10 additions & 0 deletions
10
...ublic/context_awareness/profile_providers/observability/logs_data_source_profile/index.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,10 @@ | ||
/* | ||
* 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". | ||
*/ | ||
|
||
export { createObservabilityLogsDataSourceProfileProviders } from './create_profile_providers'; |
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
85 changes: 85 additions & 0 deletions
85
...file_providers/observability/logs_data_source_profile/sub_profiles/create_resolve.test.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,85 @@ | ||
/* | ||
* 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 type { ContextWithProfileId } from '../../../../profile_service'; | ||
import { createEsqlDataSource } from '../../../../../../common/data_sources'; | ||
import { | ||
DataSourceCategory, | ||
DataSourceProfileProviderParams, | ||
RootContext, | ||
SolutionType, | ||
} from '../../../../profiles'; | ||
import { createResolve } from './create_resolve'; | ||
import { OBSERVABILITY_ROOT_PROFILE_ID } from '../../consts'; | ||
|
||
describe('createResolve', () => { | ||
const VALID_INDEX_PATTERN = 'valid'; | ||
const INVALID_INDEX_PATTERN = 'invalid'; | ||
const ROOT_CONTEXT: ContextWithProfileId<RootContext> = { | ||
profileId: OBSERVABILITY_ROOT_PROFILE_ID, | ||
solutionType: SolutionType.Observability, | ||
}; | ||
const RESOLUTION_MATCH = { | ||
isMatch: true, | ||
context: { category: DataSourceCategory.Logs }, | ||
}; | ||
const RESOLUTION_MISMATCH = { | ||
isMatch: false, | ||
}; | ||
const resolve = createResolve(VALID_INDEX_PATTERN); | ||
|
||
it('should match a valid index pattern', () => { | ||
const result = resolve({ | ||
rootContext: ROOT_CONTEXT, | ||
dataSource: createEsqlDataSource(), | ||
query: { esql: `FROM ${VALID_INDEX_PATTERN}` }, | ||
}); | ||
expect(result).toEqual(RESOLUTION_MATCH); | ||
}); | ||
|
||
it('should not match an invalid index pattern', () => { | ||
const result = resolve({ | ||
rootContext: ROOT_CONTEXT, | ||
dataSource: createEsqlDataSource(), | ||
query: { esql: `FROM ${INVALID_INDEX_PATTERN}` }, | ||
}); | ||
expect(result).toEqual(RESOLUTION_MISMATCH); | ||
}); | ||
|
||
it('should not match when the solution type is not Observability', () => { | ||
const params: Omit<DataSourceProfileProviderParams, 'rootContext'> = { | ||
dataSource: createEsqlDataSource(), | ||
query: { esql: `FROM ${VALID_INDEX_PATTERN}` }, | ||
}; | ||
expect( | ||
resolve({ | ||
...params, | ||
rootContext: ROOT_CONTEXT, | ||
}) | ||
).toEqual(RESOLUTION_MATCH); | ||
expect( | ||
resolve({ | ||
...params, | ||
rootContext: { profileId: 'other-root-profile', solutionType: SolutionType.Default }, | ||
}) | ||
).toEqual(RESOLUTION_MISMATCH); | ||
expect( | ||
resolve({ | ||
...params, | ||
rootContext: { profileId: 'other-root-profile', solutionType: SolutionType.Search }, | ||
}) | ||
).toEqual(RESOLUTION_MISMATCH); | ||
expect( | ||
resolve({ | ||
...params, | ||
rootContext: { profileId: 'other-root-profile', solutionType: SolutionType.Security }, | ||
}) | ||
).toEqual(RESOLUTION_MISMATCH); | ||
}); | ||
}); |
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
File renamed without changes.
Oops, something went wrong.