From ee007220d2dd1b0619f25e813fe4cde8334ed1a9 Mon Sep 17 00:00:00 2001 From: Kate Patticha Date: Mon, 29 May 2023 22:41:38 +0200 Subject: [PATCH] Fallback to the default space --- x-pack/plugins/apm/server/routes/service_groups/route.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/apm/server/routes/service_groups/route.ts b/x-pack/plugins/apm/server/routes/service_groups/route.ts index 934c6ca03376e..e2fedd8fda1e4 100644 --- a/x-pack/plugins/apm/server/routes/service_groups/route.ts +++ b/x-pack/plugins/apm/server/routes/service_groups/route.ts @@ -6,6 +6,7 @@ */ import * as t from 'io-ts'; +import { DEFAULT_SPACE_ID } from '@kbn/spaces-plugin/common'; import Boom from '@hapi/boom'; import datemath from '@kbn/datemath'; import { apmServiceGroupMaxNumberOfServices } from '@kbn/observability-plugin/common'; @@ -186,7 +187,7 @@ const serviceGroupCountsRoute = createApmServerRoute({ apmAlertsClient, context, logger, - spaceId: activeSpace?.id, + spaceId: activeSpace?.id ?? DEFAULT_SPACE_ID, }), ]); const serviceGroupCounts = serviceGroups.reduce(