diff --git a/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.test.ts b/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.test.ts index 5f241f3ee7f9b..836cafa8ac7af 100644 --- a/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.test.ts +++ b/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.test.ts @@ -20,9 +20,11 @@ describe('Cloud Plugin', () => { const setupPlugin = async ({ config = {}, isCloudEnabled = true, + isElasticStaffOwned = false, }: { config?: Partial; isCloudEnabled?: boolean; + isElasticStaffOwned?: boolean; }) => { const initContext = coreMock.createPluginInitializerContext(config); @@ -30,7 +32,7 @@ describe('Cloud Plugin', () => { const coreSetup = coreMock.createSetup(); - const cloud = { ...cloudMock.createSetup(), isCloudEnabled }; + const cloud = { ...cloudMock.createSetup(), isCloudEnabled, isElasticStaffOwned }; plugin.setup(coreSetup, { cloud }); @@ -61,6 +63,15 @@ describe('Cloud Plugin', () => { expect(coreSetup.analytics.registerShipper).not.toHaveBeenCalled(); }); + it('does set up FullStory when isCloudEnabled=true but the deployment is owned by an Elastician', async () => { + const { coreSetup } = await setupPlugin({ + config: { org_id: 'foo' }, + isCloudEnabled: true, + isElasticStaffOwned: true, + }); + expect(coreSetup.analytics.registerShipper).not.toHaveBeenCalled(); + }); + it('does not call initializeFullStory when org_id is undefined', async () => { const { coreSetup } = await setupPlugin({ config: {} }); expect(coreSetup.analytics.registerShipper).not.toHaveBeenCalled(); diff --git a/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.ts b/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.ts index 66adac5f5fc22..a248b27f93714 100755 --- a/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.ts +++ b/x-pack/plugins/cloud_integrations/cloud_full_story/public/plugin.ts @@ -37,6 +37,12 @@ export class CloudFullStoryPlugin implements Plugin { public setup(core: CoreSetup, { cloud }: CloudFullStorySetupDeps) { if (cloud.isCloudEnabled) { + if (cloud.isElasticStaffOwned) { + this.initializerContext.logger + .get() + .info('Skipping FullStory setup for a Elastic-owned deployments'); + return; + } this.setupFullStory({ analytics: core.analytics, basePath: core.http.basePath }).catch((e) => // eslint-disable-next-line no-console console.debug(`Error setting up FullStory: ${e.toString()}`)