diff --git a/x-pack/plugins/monitoring/server/telemetry_collection/register_monitoring_collection.ts b/x-pack/plugins/monitoring/server/telemetry_collection/register_monitoring_collection.ts index beb7a24ecce6d..c009a17083332 100644 --- a/x-pack/plugins/monitoring/server/telemetry_collection/register_monitoring_collection.ts +++ b/x-pack/plugins/monitoring/server/telemetry_collection/register_monitoring_collection.ts @@ -18,11 +18,8 @@ export function registerMonitoringCollection( const legacyCluster: Cluster = { callWithRequest: async (req: any, endpoint: string, params: any) => cluster.asScoped(req).callAsCurrentUser(endpoint, params), - callWithInternalUser: () => { - throw new Error( - 'callWithInternalUser is not supported in this context. Please use `callWithRequest`' - ); - }, + callWithInternalUser: (endpoint: string, params: any) => + cluster.callAsInternalUser(endpoint, params), }; telemetryCollectionManager.setCollection({ esCluster: legacyCluster,