diff --git a/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/index.tsx b/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/index.tsx index 627c314bf72e6..a92d781e3dd7c 100644 --- a/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/index.tsx +++ b/x-pack/plugins/observability_solution/apm/public/components/app/service_dashboards/index.tsx @@ -40,12 +40,14 @@ import { useDashboardFetcher } from '../../../hooks/use_dashboards_fetcher'; import { useTimeRange } from '../../../hooks/use_time_range'; import { APM_APP_LOCATOR_ID } from '../../../locator/service_detail_locator'; import { useApmPluginContext } from '../../../context/apm_plugin/use_apm_plugin_context'; +import { useApmServiceContext } from '../../../context/apm_service/use_apm_service_context'; +import { isLogsOnlySignal } from '../../../utils/get_signal_type'; export interface MergedServiceDashboard extends SavedApmCustomDashboard { title: string; } -export function ServiceDashboards({ checkForEntities = false }: { checkForEntities?: boolean }) { +export function ServiceDashboards() { const { path: { serviceName }, query: { environment, kuery, rangeFrom, rangeTo, dashboardId }, @@ -53,6 +55,10 @@ export function ServiceDashboards({ checkForEntities = false }: { checkForEntiti '/services/{serviceName}/dashboards', '/mobile-services/{serviceName}/dashboards' ); + const { serviceEntitySummary, serviceEntitySummaryStatus } = useApmServiceContext(); + const checkForEntities = serviceEntitySummary?.dataStreamTypes + ? isLogsOnlySignal(serviceEntitySummary.dataStreamTypes) + : false; const [dashboard, setDashboard] = useState(); const [serviceDashboards, setServiceDashboards] = useState([]); const [currentDashboard, setCurrentDashboard] = useState(); @@ -150,7 +156,7 @@ export function ServiceDashboards({ checkForEntities = false }: { checkForEntiti return ( - {status === FETCH_STATUS.LOADING ? ( + {status === FETCH_STATUS.LOADING || serviceEntitySummaryStatus === FETCH_STATUS.LOADING ? ( } title={