+
+ {i18n.translate('xpack.apm.settings.schema.confirm.descriptionText', {
+ defaultMessage:
+ 'If you have custom dashboards, machine learning jobs, or source maps that use classic APM indices, you must reconfigure them for data streams. Stack monitoring is not currently supported with Fleet-managed APM.',
+ })}
+
+ {!hasUnsupportedConfigs && (
+
+ {i18n.translate(
+ 'xpack.apm.settings.schema.confirm.unsupportedConfigs.descriptionText',
+ {
+ defaultMessage: `Compatible custom apm-server.yml user settings will be moved to Fleet Server settings for you. We'll let you know which settings are incompatible before removing them.`,
+ }
+ )}
+
+ )}
+
+
+ {i18n.translate(
+ 'xpack.apm.settings.schema.confirm.irreversibleWarning.message',
+ {
+ defaultMessage: `It might temporarily affect your APM data collection while the migration is in progress. The process of migrating should only take a few minutes.`,
+ }
+ )}
+
+
+
+ {hasUnsupportedConfigs && (
+ <>
+
+
+ {unsupportedConfigs
+ .map(({ key, value }) => `${key}: ${JSON.stringify(value)}`)
+ .join('\n')}
+
+
+
+ {i18n.translate(
+ 'xpack.apm.settings.schema.confirm.apmServerSettingsCloudLinkText',
+ { defaultMessage: 'Go to APM Server settings in Cloud' }
+ )}
+
+
+
+
+ >
+ )}
+
+ {
+ setIsConfirmChecked(e.target.checked);
+ }}
+ disabled={isLoading}
+ />
+
+
+ );
+}
diff --git a/x-pack/plugins/apm/public/components/app/Settings/schema/index.tsx b/x-pack/plugins/apm/public/components/app/Settings/schema/index.tsx
new file mode 100644
index 0000000000000..fee072470f05a
--- /dev/null
+++ b/x-pack/plugins/apm/public/components/app/Settings/schema/index.tsx
@@ -0,0 +1,137 @@
+/*
+ * 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 React, { useState } from 'react';
+import { i18n } from '@kbn/i18n';
+import { NotificationsStart } from 'kibana/public';
+import { SchemaOverview } from './schema_overview';
+import { ConfirmSwitchModal } from './confirm_switch_modal';
+import { FETCH_STATUS, useFetcher } from '../../../../hooks/use_fetcher';
+import {
+ callApmApi,
+ APIReturnType,
+} from '../../../../services/rest/createCallApmApi';
+import { useApmPluginContext } from '../../../../context/apm_plugin/use_apm_plugin_context';
+
+type FleetMigrationCheckResponse = APIReturnType<'GET /api/apm/fleet/migration_check'>;
+
+export function Schema() {
+ const { toasts } = useApmPluginContext().core.notifications;
+ const [isSwitchActive, setIsSwitchActive] = useState(false);
+ const [isLoadingMigration, setIsLoadingMigration] = useState(false);
+ const [isLoadingConfirmation, setIsLoadingConfirmation] = useState(false);
+ const [unsupportedConfigs, setUnsupportedConfigs] = useState<
+ Array<{ key: string; value: any }>
+ >([]);
+
+ const {
+ refetch,
+ data = {} as FleetMigrationCheckResponse,
+ status,
+ } = useFetcher(
+ (callApi) => callApi({ endpoint: 'GET /api/apm/fleet/migration_check' }),
+ [],
+ { preservePreviousData: false }
+ );
+ const isLoading = status !== FETCH_STATUS.SUCCESS;
+ const cloudApmMigrationEnabled = !!data.cloud_apm_migration_enabled;
+ const hasCloudAgentPolicy = !!data.has_cloud_agent_policy;
+ const hasCloudApmPackagePolicy = !!data.has_cloud_apm_package_policy;
+ const hasRequiredRole = !!data.has_required_role;
+ return (
+ <>
+