mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[APM][Profiling] Adding feature flag to enable profiling integration (#163823)
<img width="1493" alt="Screenshot 2023-08-14 at 3 11 13 PM" src="6bafa1e3
-7075-4779-92ae-35ab30436255"> When Profiling is initiated but feature flag is not enabled: <img width="381" alt="Screenshot 2023-08-14 at 3 17 14 PM" src="fb4821b9
-2bcc-4a7d-bd77-b200e3d43892"> When Profiling is initiated and feature flag is enabled: <img width="369" alt="Screenshot 2023-08-14 at 3 18 59 PM" src="cf8ed7c6
-77ee-48e7-bf82-7fc2a7101d6b">
This commit is contained in:
parent
ab133a7727
commit
309666acc2
8 changed files with 36 additions and 4 deletions
|
@ -549,6 +549,10 @@ export const stackManagementSchema: MakeSchemaFrom<UsageStats> = {
|
|||
type: 'boolean',
|
||||
_meta: { description: 'Non-default value of setting.' },
|
||||
},
|
||||
'observability:apmEnableProfilingIntegration': {
|
||||
type: 'boolean',
|
||||
_meta: { description: 'Non-default value of setting.' },
|
||||
},
|
||||
'observability:apmEnableCriticalPath': {
|
||||
type: 'boolean',
|
||||
_meta: { description: 'Non-default value of setting.' },
|
||||
|
|
|
@ -150,6 +150,7 @@ export interface UsageStats {
|
|||
'observability:apmServiceInventoryOptimizedSorting': boolean;
|
||||
'observability:apmTraceExplorerTab': boolean;
|
||||
'observability:apmEnableCriticalPath': boolean;
|
||||
'observability:apmEnableProfilingIntegration': boolean;
|
||||
'securitySolution:enableGroupedNav': boolean;
|
||||
'securitySolution:showRelatedIntegrations': boolean;
|
||||
'visualization:visualize:legacyGaugeChartsLibrary': boolean;
|
||||
|
|
|
@ -9870,6 +9870,12 @@
|
|||
"description": "Non-default value of setting."
|
||||
}
|
||||
},
|
||||
"observability:apmEnableProfilingIntegration": {
|
||||
"type": "boolean",
|
||||
"_meta": {
|
||||
"description": "Non-default value of setting."
|
||||
}
|
||||
},
|
||||
"observability:apmEnableCriticalPath": {
|
||||
"type": "boolean",
|
||||
"_meta": {
|
||||
|
|
|
@ -19,6 +19,7 @@ import {
|
|||
apmEnableServiceMetrics,
|
||||
apmEnableContinuousRollups,
|
||||
enableAgentExplorerView,
|
||||
apmEnableProfilingIntegration,
|
||||
} from '@kbn/observability-plugin/common';
|
||||
import { isEmpty } from 'lodash';
|
||||
import React from 'react';
|
||||
|
@ -37,6 +38,7 @@ const apmSettingsKeys = [
|
|||
apmEnableServiceMetrics,
|
||||
apmEnableContinuousRollups,
|
||||
enableAgentExplorerView,
|
||||
apmEnableProfilingIntegration,
|
||||
];
|
||||
|
||||
export function GeneralSettings() {
|
||||
|
|
|
@ -6,10 +6,15 @@
|
|||
*/
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { apmEnableProfilingIntegration } from '@kbn/observability-plugin/common';
|
||||
import { useApmPluginContext } from '../context/apm_plugin/use_apm_plugin_context';
|
||||
|
||||
export function useProfilingPlugin() {
|
||||
const { plugins } = useApmPluginContext();
|
||||
const { plugins, core } = useApmPluginContext();
|
||||
const isProfilingIntegrationEnabled = core.uiSettings.get<boolean>(
|
||||
apmEnableProfilingIntegration,
|
||||
false
|
||||
);
|
||||
const [isProfilingPluginInitialized, setIsProfilingPluginInitialized] =
|
||||
useState<boolean | undefined>();
|
||||
|
||||
|
@ -28,8 +33,10 @@ export function useProfilingPlugin() {
|
|||
|
||||
return {
|
||||
isProfilingPluginInitialized,
|
||||
profilingLocators: isProfilingPluginInitialized
|
||||
? plugins.profiling?.locators
|
||||
: undefined,
|
||||
profilingLocators:
|
||||
isProfilingIntegrationEnabled && isProfilingPluginInitialized
|
||||
? plugins.profiling?.locators
|
||||
: undefined,
|
||||
isProfilingIntegrationEnabled,
|
||||
};
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ export {
|
|||
apmEnableContinuousRollups,
|
||||
enableCriticalPath,
|
||||
syntheticsThrottlingEnabled,
|
||||
apmEnableProfilingIntegration,
|
||||
} from './ui_settings_keys';
|
||||
|
||||
export {
|
||||
|
|
|
@ -26,3 +26,4 @@ export const apmEnableServiceMetrics = 'observability:apmEnableServiceMetrics';
|
|||
export const apmEnableContinuousRollups = 'observability:apmEnableContinuousRollups';
|
||||
export const syntheticsThrottlingEnabled = 'observability:syntheticsThrottlingEnabled';
|
||||
export const enableLegacyUptimeApp = 'observability:enableLegacyUptimeApp';
|
||||
export const apmEnableProfilingIntegration = 'observability:apmEnableProfilingIntegration';
|
||||
|
|
|
@ -29,6 +29,7 @@ import {
|
|||
enableInfrastructureHostsView,
|
||||
syntheticsThrottlingEnabled,
|
||||
enableLegacyUptimeApp,
|
||||
apmEnableProfilingIntegration,
|
||||
} from '../common/ui_settings_keys';
|
||||
|
||||
const betaLabel = i18n.translate('xpack.observability.uiSettings.betaLabel', {
|
||||
|
@ -364,6 +365,15 @@ export const uiSettings: Record<string, UiSettings> = {
|
|||
schema: schema.boolean(),
|
||||
requiresPageReload: true,
|
||||
},
|
||||
[apmEnableProfilingIntegration]: {
|
||||
category: [observabilityFeatureId],
|
||||
name: i18n.translate('xpack.observability.apmEnableProfilingIntegration', {
|
||||
defaultMessage: 'Enable Universal Profiling integration in APM',
|
||||
}),
|
||||
value: false,
|
||||
schema: schema.boolean(),
|
||||
requiresPageReload: false,
|
||||
},
|
||||
};
|
||||
|
||||
function throttlingDocsLink({ href }: { href: string }) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue