diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_inventory/multi_signal_inventory/table/no_entities_empty_state.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_inventory/multi_signal_inventory/table/no_entities_empty_state.tsx index 6e7296aa2eba2..af97ea3093aaf 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_inventory/multi_signal_inventory/table/no_entities_empty_state.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_inventory/multi_signal_inventory/table/no_entities_empty_state.tsx @@ -18,10 +18,8 @@ import { } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; import React from 'react'; - import { dashboardsLight } from '@kbn/shared-svg'; import useEffectOnce from 'react-use/lib/useEffectOnce'; -import { useApmPluginContext } from '../../../../../context/apm_plugin/use_apm_plugin_context'; import { useKibana } from '../../../../../context/kibana_context/use_kibana'; import { useLocalStorage } from '../../../../../hooks/use_local_storage'; import { ApmPluginStartDeps, ApmServices } from '../../../../../plugin'; @@ -33,9 +31,7 @@ import { } from '../../../../shared/add_data_buttons/buttons'; export function NoEntitiesEmptyState() { - const { core } = useApmPluginContext(); const { services } = useKibana(); - const { basePath } = core.http; const [userHasDismissedCallout, setUserHasDismissedCallout] = useLocalStorage( 'apm.uiNewExperienceCallout', false @@ -104,7 +100,6 @@ export function NoEntitiesEmptyState() { }} /> { reportButtonClick('collect_new_service_logs'); }} diff --git a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/apm_header_action_menu/add_data_context_menu.tsx b/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/apm_header_action_menu/add_data_context_menu.tsx index 5d2bb3e09e657..edee8c419eb33 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/apm_header_action_menu/add_data_context_menu.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/routing/app_root/apm_header_action_menu/add_data_context_menu.tsx @@ -76,7 +76,6 @@ export function AddDataContextMenu() { name: collectServiceLogs.name, href: basePath.prepend(collectServiceLogs.link), 'data-test-subj': 'apmAddDataCollectServiceLogs', - target: '_blank', onClick: () => { reportButtonClick('collect_new_service_logs'); }, diff --git a/x-pack/plugins/observability_solution/apm/public/components/shared/add_data_buttons/buttons.tsx b/x-pack/plugins/observability_solution/apm/public/components/shared/add_data_buttons/buttons.tsx index 9c57947bccdb9..b11e0d6e8e69d 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/shared/add_data_buttons/buttons.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/shared/add_data_buttons/buttons.tsx @@ -7,7 +7,6 @@ import React from 'react'; import { EuiButton } from '@elastic/eui'; import { i18n } from '@kbn/i18n'; -import { IBasePath } from '@kbn/core/public'; import { useKibana } from '../../../context/kibana_context/use_kibana'; import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; @@ -29,7 +28,7 @@ export const collectServiceLogs = { name: i18n.translate('xpack.apm.collect.service.logs.button', { defaultMessage: 'Collect new service logs', }), - link: '/app/observabilityOnboarding/?category=logs', + link: '/app/observabilityOnboarding/customLogs/?category=logs', }; export function AddApmData({ @@ -68,15 +67,15 @@ export function AssociateServiceLogs({ onClick }: { onClick?: () => void }) { ); } -export function CollectServiceLogs({ - basePath, - onClick, -}: { - basePath: IBasePath; - onClick?: () => void; -}) { +export function CollectServiceLogs({ onClick }: { onClick?: () => void }) { + const { core } = useApmPluginContext(); + const { basePath } = core.http; + const { + application: { navigateToUrl }, + } = useKibana().services; + function handleClick() { - window.open(basePath.prepend(collectServiceLogs.link), '_blank'); + navigateToUrl(basePath.prepend(collectServiceLogs.link)); onClick?.(); } return (