Skip to content

Commit

Permalink
[PURIFY] usageCollector removal of ui metrics reporting (#10) (#18)
Browse files Browse the repository at this point in the history
* [PURIFY] Removes telemetry publishing and telemetry section from advanced settings (#10)

* Restore kibana file for data plugin

* [PURIFY] Remove usageCollector and its reporting post reqs (#10)

* Revert "Restore kibana file for data plugin"

This reverts commit bb5ed918dc5dbb87b6888f119bf1868e615988a7.

* Removes unused member variable that stops kibana from building

Co-authored-by: Ubuntu <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
2 people authored and peternied committed Mar 13, 2021
1 parent 261e0c0 commit be86547
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 40 deletions.
17 changes: 4 additions & 13 deletions .i18nrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@
"interpreter": "src/legacy/core_plugins/interpreter",
"kbn": "src/legacy/core_plugins/kibana",
"kbnDocViews": "src/legacy/core_plugins/kbn_doc_views",
"management": [
"src/legacy/core_plugins/management",
"src/plugins/management"
],
"management": ["src/legacy/core_plugins/management", "src/plugins/management"],
"maps_legacy": "src/plugins/maps_legacy",
"indexPatternManagement": "src/plugins/index_pattern_management",
"advancedSettings": "src/plugins/advanced_settings",
Expand All @@ -42,10 +39,7 @@
"security": "src/plugins/security_oss",
"server": "src/legacy/server",
"statusPage": "src/legacy/core_plugins/status_page",
"telemetry": [
"src/plugins/telemetry",
"src/plugins/telemetry_management_section"
],
"telemetry": ["src/plugins/telemetry", "src/plugins/telemetry_management_section"],
"tileMap": "src/plugins/tile_map",
"timelion": ["src/plugins/timelion", "src/plugins/vis_type_timelion"],
"uiActions": "src/plugins/ui_actions",
Expand All @@ -60,11 +54,8 @@
"visTypeXy": "src/plugins/vis_type_xy",
"visualizations": "src/plugins/visualizations",
"visualize": "src/plugins/visualize",
"apmOss": "src/plugins/apm_oss",
"usageCollection": "src/plugins/usage_collection"
"apmOss": "src/plugins/apm_oss"
},
"exclude": [
"src/legacy/ui/ui_render/ui_render_mixin.js"
],
"exclude": ["src/legacy/ui/ui_render/ui_render_mixin.js"],
"translations": []
}
6 changes: 3 additions & 3 deletions packages/kbn-analytics/src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class Reporter {
checkInterval: number;
private interval?: NodeJS.Timer;
private lastAppId?: string;
private http: ReportHTTP;
// private http: ReportHTTP;
private reportManager: ReportManager;
private storageManager: ReportStorageManager;
private readonly applicationUsage: ApplicationUsage;
Expand All @@ -48,8 +48,8 @@ export class Reporter {
private started = false;

constructor(config: ReporterConfig) {
const { http, storage, debug, checkInterval = 90000, storageKey = 'analytics' } = config;
this.http = http;
const { storage, debug, checkInterval = 90000, storageKey = 'analytics' } = config;
// this.http = http;
this.checkInterval = checkInterval;
this.applicationUsage = new ApplicationUsage();
this.storageManager = new ReportStorageManager(storageKey, storage);
Expand Down
16 changes: 4 additions & 12 deletions src/plugins/data/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,8 @@
"version": "kibana",
"server": true,
"ui": true,
"requiredPlugins": [
"expressions",
"uiActions"
],
"optionalPlugins": ["usageCollection"],
"requiredPlugins": ["expressions", "uiActions"],
"optionalPlugins": [],
"extraPublicDirs": ["common", "common/utils/abort_utils"],
"requiredBundles": [
"usageCollection",
"kibanaUtils",
"kibanaReact",
"inspector"
]
}
"requiredBundles": ["kibanaUtils", "kibanaReact", "inspector"]

Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { SEARCH_EVENT_TYPE, SearchUsageCollector } from './types';
import { METRIC_TYPE } from '@kbn/analytics';
import { from } from 'rxjs';

describe('Search Usage Collector', () => {
describe.skip('Search Usage Collector', () => {
let mockCoreSetup: MockedKeys<CoreSetup>;
let mockUsageCollectionSetup: Setup;
let usageCollector: SearchUsageCollector;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/data/public/search/collectors/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
* under the License.
*/

export { createUsageCollector } from './create_usage_collector';
// export { createUsageCollector } from './create_usage_collector';
export { SEARCH_EVENT_TYPE, SearchUsageCollector } from './types';
4 changes: 2 additions & 2 deletions src/plugins/data/public/search/search_interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
ISearchOptions,
ES_SEARCH_STRATEGY,
} from '../../common';
import { SearchUsageCollector } from './collectors';
// import { SearchUsageCollector } from './collectors';
import { SearchTimeoutError, PainlessError, isPainlessError, TimeoutErrorMode } from './errors';
import { toMountPoint } from '../../../kibana_react/public';

Expand All @@ -38,7 +38,7 @@ export interface SearchInterceptorDeps {
uiSettings: CoreSetup['uiSettings'];
startServices: Promise<[CoreStart, any, unknown]>;
toasts: ToastsSetup;
usageCollector?: SearchUsageCollector;
// usageCollector?: SearchUsageCollector;
}

export class SearchInterceptor {
Expand Down
17 changes: 9 additions & 8 deletions src/plugins/data/public/search/search_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ import { getCallMsearch } from './legacy';
import { AggsService, AggsStartDependencies } from './aggs';
import { IndexPatternsContract } from '../index_patterns/index_patterns';
import { ISearchInterceptor, SearchInterceptor } from './search_interceptor';
import { SearchUsageCollector, createUsageCollector } from './collectors';
import { UsageCollectionSetup } from '../../../usage_collection/public';
// import { SearchUsageCollector, createUsageCollector } from './collectors';
// import { UsageCollectionSetup } from '../../../usage_collection/public';
import { esdsl, esRawResponse } from './expressions';
import { ExpressionsSetup } from '../../../expressions/public';
import { ConfigSchema } from '../../config';
Expand All @@ -50,7 +50,7 @@ import { aggShardDelay } from '../../common/search/aggs/buckets/shard_delay_fn';
/** @internal */
export interface SearchServiceSetupDependencies {
expressions: ExpressionsSetup;
usageCollection?: UsageCollectionSetup;
// usageCollection?: UsageCollectionSetup;
}

/** @internal */
Expand All @@ -63,15 +63,16 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> {
private readonly aggsService = new AggsService();
private readonly searchSourceService = new SearchSourceService();
private searchInterceptor!: ISearchInterceptor;
private usageCollector?: SearchUsageCollector;
// private usageCollector?: SearchUsageCollector;

constructor(private initializerContext: PluginInitializerContext<ConfigSchema>) {}

public setup(
{ http, getStartServices, notifications, uiSettings }: CoreSetup,
{ expressions, usageCollection }: SearchServiceSetupDependencies
// { expressions, usageCollection }: SearchServiceSetupDependencies
{ expressions }: SearchServiceSetupDependencies
): ISearchSetup {
this.usageCollector = createUsageCollector(getStartServices, usageCollection);
// this.usageCollector = createUsageCollector(getStartServices, usageCollection);

/**
* A global object that intercepts all searches and provides convenience methods for cancelling
Expand All @@ -82,7 +83,7 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> {
http,
uiSettings,
startServices: getStartServices(),
usageCollector: this.usageCollector!,
usageCollector: undefined, // this.usageCollector!,
});

expressions.registerFunction(esdsl);
Expand All @@ -100,7 +101,7 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> {

return {
aggs,
usageCollector: this.usageCollector!,
usageCollector: undefined, // this.usageCollector!,
__enhance: (enhancements: SearchEnhancements) => {
this.searchInterceptor = enhancements.searchInterceptor;
},
Expand Down
File renamed without changes.

0 comments on commit be86547

Please sign in to comment.