mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 01:13:23 -04:00
Fix logstash integration with monitoring (#65165)
This commit is contained in:
parent
46b91cc9fd
commit
5f314227d9
4 changed files with 10 additions and 10 deletions
|
@ -9,6 +9,7 @@
|
|||
],
|
||||
"optionalPlugins": [
|
||||
"home",
|
||||
"monitoring",
|
||||
"security"
|
||||
],
|
||||
"server": true,
|
||||
|
|
|
@ -31,16 +31,12 @@ import * as Breadcrumbs from './breadcrumbs';
|
|||
export const renderApp = async (
|
||||
core: CoreStart,
|
||||
{ basePath, element, setBreadcrumbs }: ManagementAppMountParams,
|
||||
isMonitoringEnabled: boolean,
|
||||
licenseService$: Observable<any>
|
||||
) => {
|
||||
const logstashLicenseService = await licenseService$.pipe(first()).toPromise();
|
||||
const clusterService = new ClusterService(core.http);
|
||||
const monitoringService = new MonitoringService(
|
||||
core.http,
|
||||
// When monitoring is migrated this should be fetched from monitoring's plugin contract
|
||||
core.injectedMetadata.getInjectedVar('monitoringUiEnabled'),
|
||||
clusterService
|
||||
);
|
||||
const monitoringService = new MonitoringService(core.http, isMonitoringEnabled, clusterService);
|
||||
const pipelinesService = new PipelinesService(core.http, monitoringService);
|
||||
const pipelineService = new PipelineService(core.http, pipelinesService);
|
||||
const upgradeService = new UpgradeService(core.http);
|
||||
|
|
|
@ -49,8 +49,9 @@ export class LogstashPlugin implements Plugin<void, void, SetupDeps> {
|
|||
mount: async params => {
|
||||
const [coreStart] = await core.getStartServices();
|
||||
const { renderApp } = await import('./application');
|
||||
const isMonitoringEnabled = 'monitoring' in plugins;
|
||||
|
||||
return renderApp(coreStart, params, logstashLicense$);
|
||||
return renderApp(coreStart, params, isMonitoringEnabled, logstashLicense$);
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -9,14 +9,14 @@ import { ROUTES, MONITORING } from '../../../common/constants';
|
|||
import { PipelineListItem } from '../../models/pipeline_list_item';
|
||||
|
||||
export class MonitoringService {
|
||||
constructor(http, monitoringUiEnabled, clusterService) {
|
||||
constructor(http, isMonitoringEnabled, clusterService) {
|
||||
this.http = http;
|
||||
this.monitoringUiEnabled = monitoringUiEnabled;
|
||||
this._isMonitoringEnabled = isMonitoringEnabled;
|
||||
this.clusterService = clusterService;
|
||||
}
|
||||
|
||||
isMonitoringEnabled() {
|
||||
return this.monitoringUiEnabled;
|
||||
return this._isMonitoringEnabled;
|
||||
}
|
||||
|
||||
getPipelineList() {
|
||||
|
@ -27,6 +27,8 @@ export class MonitoringService {
|
|||
return this.clusterService
|
||||
.loadCluster()
|
||||
.then(cluster => {
|
||||
// This API call should live within the Monitoring plugin
|
||||
// https://github.com/elastic/kibana/issues/63931
|
||||
const url = `${ROUTES.MONITORING_API_ROOT}/v1/clusters/${cluster.uuid}/logstash/pipeline_ids`;
|
||||
const now = moment.utc();
|
||||
const body = JSON.stringify({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue