Skip to content

Commit

Permalink
use es client provided from start contract
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed May 25, 2020
1 parent 39a1cba commit 77d9d9b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/plugins/telemetry/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ export class TelemetryPlugin implements Plugin {
const config$ = this.config$;
const isDev = this.isDev;

registerCollection(telemetryCollectionManager, elasticsearch.dataClient);
const router = http.createRouter();

registerRoutes({
Expand All @@ -109,6 +108,7 @@ export class TelemetryPlugin implements Plugin {
this.logger.warn('Unable to update legacy telemetry configs.');
}

registerCollection(telemetryCollectionManager, core.elasticsearch.legacy.client);
this.fetcherTask.start(core, { telemetryCollectionManager });
}

Expand Down
12 changes: 6 additions & 6 deletions x-pack/plugins/telemetry_collection_xpack/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@
*/

import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from 'kibana/server';
import { TelemetryCollectionManagerPluginSetup } from 'src/plugins/telemetry_collection_manager/server';
import { TelemetryCollectionManagerPluginStart } from 'src/plugins/telemetry_collection_manager/server';
import { getClusterUuids, getLocalLicense } from '../../../../src/plugins/telemetry/server';
import { getStatsWithXpack } from './telemetry_collection';

interface TelemetryCollectionXpackDepsSetup {
telemetryCollectionManager: TelemetryCollectionManagerPluginSetup;
telemetryCollectionManager: TelemetryCollectionManagerPluginStart;
}

export class TelemetryCollectionXpackPlugin implements Plugin {
constructor(initializerContext: PluginInitializerContext) {}

public setup(core: CoreSetup, { telemetryCollectionManager }: TelemetryCollectionXpackDepsSetup) {
public setup(core: CoreSetup) {}

public start(core: CoreStart, { telemetryCollectionManager }: TelemetryCollectionXpackDepsSetup) {
telemetryCollectionManager.setCollection({
esCluster: core.elasticsearch.dataClient,
esCluster: core.elasticsearch.legacy.client,
title: 'local_xpack',
priority: 1,
statsGetter: getStatsWithXpack,
clusterDetailsGetter: getClusterUuids,
licenseGetter: getLocalLicense,
});
}

public start(core: CoreStart) {}
}

0 comments on commit 77d9d9b

Please sign in to comment.