From 29cf062282cf30971e41582a61f43abb2e4fd014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Fern=C3=A1ndez=20G=C3=B3mez?= Date: Tue, 30 Jun 2020 10:16:25 +0200 Subject: [PATCH] Prevent kibana from crashing on initial load --- x-pack/plugins/infra/kibana.json | 4 +--- x-pack/plugins/infra/public/plugin.ts | 12 +++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/x-pack/plugins/infra/kibana.json b/x-pack/plugins/infra/kibana.json index 4e23f1985d450..e5ce1b1cd96f8 100644 --- a/x-pack/plugins/infra/kibana.json +++ b/x-pack/plugins/infra/kibana.json @@ -13,9 +13,7 @@ "alerts", "triggers_actions_ui" ], - "optionalPlugins": [ - "ml" - ], + "optionalPlugins": ["ml", "observability"], "server": true, "ui": true, "configPath": ["xpack", "infra"] diff --git a/x-pack/plugins/infra/public/plugin.ts b/x-pack/plugins/infra/public/plugin.ts index c3f1adf94b066..1b28945320bb6 100644 --- a/x-pack/plugins/infra/public/plugin.ts +++ b/x-pack/plugins/infra/public/plugin.ts @@ -30,11 +30,13 @@ export class Plugin implements InfraClientPluginClass { pluginsSetup.triggers_actions_ui.alertTypeRegistry.register(getLogsAlertType()); pluginsSetup.triggers_actions_ui.alertTypeRegistry.register(createMetricThresholdAlertType()); - pluginsSetup.observability.dashboard.register({ - appName: 'infra_logs', - hasData: getLogsHasDataFetcher(core.getStartServices), - fetchData: getLogsOverviewDataFetcher(core.getStartServices), - }); + if (pluginsSetup.observability) { + pluginsSetup.observability.dashboard.register({ + appName: 'infra_logs', + hasData: getLogsHasDataFetcher(core.getStartServices), + fetchData: getLogsOverviewDataFetcher(core.getStartServices), + }); + } core.application.register({ id: 'logs',