diff --git a/x-pack/legacy/plugins/license_management/public/register_route.ts b/x-pack/legacy/plugins/license_management/public/register_route.ts index 994a888ac020a..0fe29b543be5b 100644 --- a/x-pack/legacy/plugins/license_management/public/register_route.ts +++ b/x-pack/legacy/plugins/license_management/public/register_route.ts @@ -52,7 +52,7 @@ if (licenseManagementUiEnabled) { }; const initializeTelemetry = ($injector: any) => { - const telemetryEnabled = $injector.get('telemetryEnabled'); + const telemetryEnabled = npStart.core.injectedMetadata.getInjectedVar('telemetryEnabled'); const Private = $injector.get('Private'); const telemetryOptInProvider = Private(TelemetryOptInProvider); setTelemetryOptInService(telemetryOptInProvider);