-
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.
[8.12] [ObsUX] Add UI Setting for controling Profiling visibility in …
…Infra (#173294) (#173661) # Backport This will backport the following commits from `main` to `8.12`: - [[ObsUX] Add UI Setting for controling Profiling visibility in Infra (#173294)](#173294) <!--- Backport version: 8.9.7 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Mykola Harmash","email":"[email protected]"},"sourceCommit":{"committedDate":"2023-12-19T15:48:35Z","message":"[ObsUX] Add UI Setting for controling Profiling visibility in Infra (#173294)\n\nCloses https://github.com/elastic/kibana/issues/173154\r\n\r\nAdds a UI setting to control Infra+Profiling integration from Kibana's\r\nAdvanced Settings as well as from the Infra Settings screen.\r\n\r\nNote that the plugin config feature flag is still there because I\r\nrealized we need it to disable Profiling integration in serverless.\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/793851/2a5ace9d-9e18-49a4-be95-c722f24072a7\r\n\r\n### How to test\r\n\r\n* Make sure profiling is enabled in `kibana.dev.yml`\r\n```\r\nxpack.profiling.enabled: true\r\n```\r\n* Start kibana in traditional mode, go to Infra Settings\r\n* Make sure there is the new toggle for Profiling integration and it's\r\non\r\n* Go to one of your host's details and make sure you see the profiling\r\ntab\r\n* Toggle the Profiling integration setting off and check that the tap in\r\nhost details is not visible\r\n\r\n* Start kibana in serverless mode\r\n* Make sure there is no new setting neither in Infra Settings nor in\r\nAdvanced Settings\r\n* Make sure Profiling tab is not visible in host details\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"c62790773374a8eeb47c0398c285148004442d60","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v8.12.0","Team:obs-ux-infra_services","Team:obs-ux-management","v8.13.0"],"number":173294,"url":"https://github.com/elastic/kibana/pull/173294","mergeCommit":{"message":"[ObsUX] Add UI Setting for controling Profiling visibility in Infra (#173294)\n\nCloses https://github.com/elastic/kibana/issues/173154\r\n\r\nAdds a UI setting to control Infra+Profiling integration from Kibana's\r\nAdvanced Settings as well as from the Infra Settings screen.\r\n\r\nNote that the plugin config feature flag is still there because I\r\nrealized we need it to disable Profiling integration in serverless.\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/793851/2a5ace9d-9e18-49a4-be95-c722f24072a7\r\n\r\n### How to test\r\n\r\n* Make sure profiling is enabled in `kibana.dev.yml`\r\n```\r\nxpack.profiling.enabled: true\r\n```\r\n* Start kibana in traditional mode, go to Infra Settings\r\n* Make sure there is the new toggle for Profiling integration and it's\r\non\r\n* Go to one of your host's details and make sure you see the profiling\r\ntab\r\n* Toggle the Profiling integration setting off and check that the tap in\r\nhost details is not visible\r\n\r\n* Start kibana in serverless mode\r\n* Make sure there is no new setting neither in Infra Settings nor in\r\nAdvanced Settings\r\n* Make sure Profiling tab is not visible in host details\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"c62790773374a8eeb47c0398c285148004442d60"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","labelRegex":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","labelRegex":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/173294","number":173294,"mergeCommit":{"message":"[ObsUX] Add UI Setting for controling Profiling visibility in Infra (#173294)\n\nCloses https://github.com/elastic/kibana/issues/173154\r\n\r\nAdds a UI setting to control Infra+Profiling integration from Kibana's\r\nAdvanced Settings as well as from the Infra Settings screen.\r\n\r\nNote that the plugin config feature flag is still there because I\r\nrealized we need it to disable Profiling integration in serverless.\r\n\r\n\r\n\r\nhttps://github.com/elastic/kibana/assets/793851/2a5ace9d-9e18-49a4-be95-c722f24072a7\r\n\r\n### How to test\r\n\r\n* Make sure profiling is enabled in `kibana.dev.yml`\r\n```\r\nxpack.profiling.enabled: true\r\n```\r\n* Start kibana in traditional mode, go to Infra Settings\r\n* Make sure there is the new toggle for Profiling integration and it's\r\non\r\n* Go to one of your host's details and make sure you see the profiling\r\ntab\r\n* Toggle the Profiling integration setting off and check that the tap in\r\nhost details is not visible\r\n\r\n* Start kibana in serverless mode\r\n* Make sure there is no new setting neither in Infra Settings nor in\r\nAdvanced Settings\r\n* Make sure Profiling tab is not visible in host details\r\n\r\n---------\r\n\r\nCo-authored-by: Kibana Machine <[email protected]>","sha":"c62790773374a8eeb47c0398c285148004442d60"}}]}] BACKPORT--> Co-authored-by: Mykola Harmash <[email protected]>
- Loading branch information
1 parent
9456432
commit ba30fb7
Showing
14 changed files
with
150 additions
and
18 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
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
21 changes: 21 additions & 0 deletions
21
x-pack/plugins/infra/public/hooks/use_profiling_integration_setting.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,21 @@ | ||
/* | ||
* 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; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { useUiSetting } from '@kbn/kibana-react-plugin/public'; | ||
import { enableInfrastructureProfilingIntegration } from '@kbn/observability-plugin/common'; | ||
import { usePluginConfig } from '../containers/plugin_config_context'; | ||
|
||
export function useProfilingIntegrationSetting(): boolean { | ||
const { | ||
featureFlags: { profilingEnabled }, | ||
} = usePluginConfig(); | ||
const isProfilingUiSettingEnabled = useUiSetting<boolean>( | ||
enableInfrastructureProfilingIntegration | ||
); | ||
|
||
return profilingEnabled && isProfilingUiSettingEnabled; | ||
} |
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