Skip to content

Commit

Permalink
chore(investigate): move behind feature flag (elastic#189290)
Browse files Browse the repository at this point in the history
  • Loading branch information
kdelemme authored Jul 26, 2024
1 parent 25960d2 commit 8fb9d64
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 140 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export const applicationUsageSchema = {
fleet: commonSchema,
integrations: commonSchema,
ingestManager: commonSchema,
investigate: commonSchema,
lens: commonSchema,
maps: commonSchema,
ml: commonSchema,
Expand Down
131 changes: 0 additions & 131 deletions src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -4325,137 +4325,6 @@
}
}
},
"investigate": {
"properties": {
"appId": {
"type": "keyword",
"_meta": {
"description": "The application being tracked"
}
},
"viewId": {
"type": "keyword",
"_meta": {
"description": "Always `main`"
}
},
"clicks_total": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application since we started counting them"
}
},
"clicks_7_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 7 days"
}
},
"clicks_30_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 30 days"
}
},
"clicks_90_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 90 days"
}
},
"minutes_on_screen_total": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen since we started counting them."
}
},
"minutes_on_screen_7_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 7 days"
}
},
"minutes_on_screen_30_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 30 days"
}
},
"minutes_on_screen_90_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 90 days"
}
},
"views": {
"type": "array",
"items": {
"properties": {
"appId": {
"type": "keyword",
"_meta": {
"description": "The application being tracked"
}
},
"viewId": {
"type": "keyword",
"_meta": {
"description": "The application view being tracked"
}
},
"clicks_total": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application sub view since we started counting them"
}
},
"clicks_7_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 7 days"
}
},
"clicks_30_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 30 days"
}
},
"clicks_90_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 90 days"
}
},
"minutes_on_screen_total": {
"type": "float",
"_meta": {
"description": "Minutes the application sub view is active and on-screen since we started counting them."
}
},
"minutes_on_screen_7_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 7 days"
}
},
"minutes_on_screen_30_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 30 days"
}
},
"minutes_on_screen_90_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 90 days"
}
}
}
}
}
}
},
"lens": {
"properties": {
"appId": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { css } from '@emotion/css';
import {
AppMountParameters,
AppStatus,
APP_WRAPPER_CLASS,
CoreSetup,
CoreStart,
Expand Down Expand Up @@ -41,28 +42,32 @@ export class InvestigateAppPlugin
>
{
logger: Logger;
config: ConfigSchema;

constructor(context: PluginInitializerContext<ConfigSchema>) {
this.logger = context.logger.get();
this.config = context.config.get();
}

setup(
coreSetup: CoreSetup<InvestigateAppStartDependencies, InvestigateAppPublicStart>,
pluginsSetup: InvestigateAppSetupDependencies
): InvestigateAppPublicSetup {
coreSetup.application.register({
id: INVESTIGATE_APP_ID,
title: i18n.translate('xpack.investigateApp.appTitle', {
defaultMessage: 'Observability AI Assistant',
defaultMessage: 'Observability Investigate',
}),
euiIconType: 'logoObservability',
appRoute: '/app/investigate',
category: DEFAULT_APP_CATEGORIES.observability,
status: this.config.enabled ? AppStatus.accessible : AppStatus.inaccessible,
visibleIn: [],
deepLinks: [
{
id: 'investigate',
title: i18n.translate('xpack.investigateApp.investigateDeepLinkTitle', {
defaultMessage: 'Investigate',
title: i18n.translate('xpack.investigateApp.newInvestigateDeepLinkTitle', {
defaultMessage: 'New investigation',
}),
path: '/new',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/

/* eslint-disable @typescript-eslint/no-empty-interface*/

export interface ConfigSchema {}
export interface ConfigSchema {
enabled: boolean;
}

export interface InvestigateAppSetupDependencies {
investigate: InvestigatePublicSetup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { schema, type TypeOf } from '@kbn/config-schema';

export const config = schema.object({
enabled: schema.boolean({ defaultValue: true }),
enabled: schema.boolean({ defaultValue: false }),
});

export type InvestigateAppConfig = TypeOf<typeof config>;
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,32 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import type { PluginInitializer, PluginInitializerContext } from '@kbn/core/server';
import { InvestigateAppConfig } from './config';

import type {
PluginConfigDescriptor,
PluginInitializer,
PluginInitializerContext,
} from '@kbn/core/server';
import type { InvestigateAppConfig } from './config';
import { InvestigateAppPlugin } from './plugin';
import type {
InvestigateAppServerSetup,
InvestigateAppServerStart,
InvestigateAppSetupDependencies,
InvestigateAppStartDependencies,
} from './types';
import { config as configSchema } from './config';

export type { InvestigateAppServerRouteRepository } from './routes/get_global_investigate_app_server_route_repository';

export type { InvestigateAppServerSetup, InvestigateAppServerStart };

export const config: PluginConfigDescriptor<InvestigateAppConfig> = {
schema: configSchema,
exposeToBrowser: {
enabled: true,
},
};

export const plugin: PluginInitializer<
InvestigateAppServerSetup,
InvestigateAppServerStart,
Expand Down

0 comments on commit 8fb9d64

Please sign in to comment.