Skip to content

Commit

Permalink
[Serverless Search] Remove unwanted alterting rule and connector types
Browse files Browse the repository at this point in the history
  • Loading branch information
sphilipse committed Jul 18, 2023
1 parent ce0e6b3 commit 540d3d7
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 6 deletions.
10 changes: 10 additions & 0 deletions config/serverless.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,15 @@

## Disable APM and Uptime, enable Enterprise Search
xpack.apm.enabled: false

xpack.cloudSecurityPosture.enabled: false
xpack.infra.enabled: false
xpack.observability.enabled: false
xpack.securitySolution.enabled: false
xpack.serverless.observability.enabled: false
xpack.uptime.enabled: false
enterpriseSearch.enabled: false
monitoring.ui.enabled: false

## Enable the Serverless Search plugin
xpack.serverless.search.enabled: true
Expand All @@ -16,3 +23,6 @@ xpack.serverless.plugin.developer.projectSwitcher.currentType: 'search'

# Specify in telemetry the project type
telemetry.labels.serverless: search

# Alerts config
xpack.actions.enabledActionTypes: ['.email', '.index', '.slack', '.jira', '.webhook', '.teams']
1 change: 1 addition & 0 deletions x-pack/plugins/infra/common/plugin_config_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface InfraConfig {
group_by_page_size: number;
};
};
enabled: boolean;
inventory: {
compositeSize: number;
};
Expand Down
8 changes: 8 additions & 0 deletions x-pack/plugins/infra/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export const config: PluginConfigDescriptor<InfraConfig> = {
group_by_page_size: schema.number({ defaultValue: 10_000 }),
}),
}),
enabled: schema.boolean({ defaultValue: true }),
inventory: schema.object({
compositeSize: schema.number({ defaultValue: 2000 }),
}),
Expand Down Expand Up @@ -154,6 +155,9 @@ export class InfraServerPlugin
}

setup(core: InfraPluginCoreSetup, plugins: InfraServerPluginSetupDeps) {
if (!this.config.enabled) {
return {} as InfraPluginSetup;
}
const framework = new KibanaFramework(core, this.config, plugins);
const sources = new InfraSources({
config: this.config,
Expand Down Expand Up @@ -259,6 +263,10 @@ export class InfraServerPlugin
}

start(core: CoreStart) {
if (!this.config.enabled) {
return {} as InfraPluginStart;
}

const inventoryViews = this.inventoryViews.start({
infraSources: this.libs.sources,
savedObjects: core.savedObjects,
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/serverless_search/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
"grokdebugger",
"management",
"ml",
"observabilityShared",
"painlessLab",
"searchprofiler",
"security",
Expand Down
7 changes: 6 additions & 1 deletion x-pack/plugins/serverless_search/public/layout/nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ const navigationTree: NavigationTreeDefinition = {
{
link: 'visualize',
},
{ link: 'observability-overview:alerts' },
{
link: 'management:triggersActions',
title: i18n.translate('xpack.serverlessSearch.nav.alerts', {
defaultMessage: 'Alerts',
}),
},
],
},
{
Expand Down
1 change: 0 additions & 1 deletion x-pack/plugins/serverless_search/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ export class ServerlessSearchPlugin
): ServerlessSearchPluginStart {
serverless.setProjectHome('/app/elasticsearch');
serverless.setSideNavComponent(createComponent(core, { serverless }));
observabilityShared.setIsSidebarEnabled(false);
management.setupCardsNavigation({
enabled: true,
hideLinksTo: [appIds.MAINTENANCE_WINDOWS],
Expand Down
13 changes: 10 additions & 3 deletions x-pack/plugins/synthetics/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,21 @@ export class Plugin implements PluginType {
private syntheticsService?: SyntheticsService;
private syntheticsMonitorClient?: SyntheticsMonitorClient;
private readonly telemetryEventsSender: TelemetryEventsSender;
private readonly config: UptimeConfig;

constructor(initializerContext: PluginInitializerContext<UptimeConfig>) {
this.initContext = initializerContext;
this.config = this.initContext.config.get();
this.logger = initializerContext.logger.get();
this.telemetryEventsSender = new TelemetryEventsSender(this.logger);
}

public setup(core: CoreSetup, plugins: SyntheticsPluginsSetupDependencies) {
const config = this.initContext.config.get<UptimeConfig>();
if (!this.config.enabled) {
return {};
}

savedObjectsAdapter.config = config;
savedObjectsAdapter.config = this.config;

this.logger = this.initContext.logger.get();
const { ruleDataService } = plugins.ruleRegistry;
Expand All @@ -69,7 +73,7 @@ export class Plugin implements PluginType {
});

this.server = {
config,
config: this.config,
router: core.http.createRouter(),
cloud: plugins.cloud,
stackVersion: this.initContext.env.packageInfo.version,
Expand Down Expand Up @@ -98,6 +102,9 @@ export class Plugin implements PluginType {
}

public start(coreStart: CoreStart, pluginsStart: SyntheticsPluginsStartDependencies) {
if (!this.config.enabled) {
return {};
}
this.savedObjectsClient = new SavedObjectsClient(
coreStart.savedObjects.createInternalRepository([syntheticsServiceApiKey.name])
);
Expand Down

0 comments on commit 540d3d7

Please sign in to comment.