Skip to content

Commit

Permalink
[7.8] Fix logstash integration with monitoring (elastic#65165) (elast…
Browse files Browse the repository at this point in the history
  • Loading branch information
joshdover committed May 6, 2020
1 parent 138303d commit 52ad59b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions x-pack/plugins/logstash/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
],
"optionalPlugins": [
"home",
"monitoring",
"security"
],
"server": true,
Expand Down
8 changes: 2 additions & 6 deletions x-pack/plugins/logstash/public/application/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/logstash/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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$);
},
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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({
Expand Down

0 comments on commit 52ad59b

Please sign in to comment.