diff --git a/x-pack/plugins/licensing/server/routes/index.ts b/x-pack/plugins/licensing/server/routes/index.ts index 99dadf284dcdba..16065d8e19adc5 100644 --- a/x-pack/plugins/licensing/server/routes/index.ts +++ b/x-pack/plugins/licensing/server/routes/index.ts @@ -19,5 +19,5 @@ export function registerRoutes( registerInfoRoute(router); registerFeatureUsageRoute(router, getStartServices); registerRegisterFeatureRoute(router, featureUsageSetup); - registerNotifyFeatureUsageRoute(router, getStartServices); + registerNotifyFeatureUsageRoute(router); } diff --git a/x-pack/plugins/licensing/server/routes/internal/notify_feature_usage.ts b/x-pack/plugins/licensing/server/routes/internal/notify_feature_usage.ts index 8d4c57c396e658..ec70472574be3f 100644 --- a/x-pack/plugins/licensing/server/routes/internal/notify_feature_usage.ts +++ b/x-pack/plugins/licensing/server/routes/internal/notify_feature_usage.ts @@ -4,13 +4,9 @@ * you may not use this file except in compliance with the Elastic License. */ import { schema } from '@kbn/config-schema'; -import { IRouter, StartServicesAccessor } from 'src/core/server'; -import { LicensingPluginStart } from '../../types'; +import { IRouter } from 'src/core/server'; -export function registerNotifyFeatureUsageRoute( - router: IRouter, - getStartServices: StartServicesAccessor<{}, LicensingPluginStart> -) { +export function registerNotifyFeatureUsageRoute(router: IRouter) { router.post( { path: '/internal/licensing/feature_usage/notify', @@ -22,10 +18,9 @@ export function registerNotifyFeatureUsageRoute( }, }, async (context, request, response) => { - const [, , { featureUsage }] = await getStartServices(); const { featureName, lastUsed } = request.body; - featureUsage.notifyUsage(featureName, lastUsed); + context.licensing.featureUsage.notifyUsage(featureName, lastUsed); return response.ok({ body: {