From ebc5d274d0c5f2cc7ecf00284e6059c9af53f9de Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Tue, 5 May 2020 13:28:40 -0700 Subject: [PATCH] Per telemetry team feedback, rename usageCollection telemetry mapping name to simpler 'app_search' - since their mapping already nests under 'kibana.plugins' - note: I left the savedObjects name with the '_telemetry' suffix, as there very well may be a use case for top-level generic 'app_search' saved objects --- .../server/collectors/app_search/telemetry.test.ts | 6 +++--- .../server/collectors/app_search/telemetry.ts | 2 +- .../server/saved_objects/app_search/telemetry.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x-pack/plugins/enterprise_search/server/collectors/app_search/telemetry.test.ts b/x-pack/plugins/enterprise_search/server/collectors/app_search/telemetry.test.ts index f6028284f3d00..144f22236ec4e 100644 --- a/x-pack/plugins/enterprise_search/server/collectors/app_search/telemetry.test.ts +++ b/x-pack/plugins/enterprise_search/server/collectors/app_search/telemetry.test.ts @@ -48,7 +48,7 @@ describe('App Search Telemetry Usage Collector', () => { expect(registerStub).toHaveBeenCalledTimes(1); expect(makeUsageCollectorStub).toHaveBeenCalledTimes(1); - expect(makeUsageCollectorStub.mock.calls[0][0].type).toBe('app_search_kibana_telemetry'); + expect(makeUsageCollectorStub.mock.calls[0][0].type).toBe('app_search'); }); }); @@ -108,8 +108,8 @@ describe('App Search Telemetry Usage Collector', () => { }); expect(savedObjectsRepoStub.incrementCounter).toHaveBeenCalledWith( - 'app_search_kibana_telemetry', - 'app_search_kibana_telemetry', + 'app_search_telemetry', + 'app_search_telemetry', 'ui_clicked.button' ); expect(response).toEqual({ success: true }); diff --git a/x-pack/plugins/enterprise_search/server/collectors/app_search/telemetry.ts b/x-pack/plugins/enterprise_search/server/collectors/app_search/telemetry.ts index 302e9843488e1..c95fc641144e1 100644 --- a/x-pack/plugins/enterprise_search/server/collectors/app_search/telemetry.ts +++ b/x-pack/plugins/enterprise_search/server/collectors/app_search/telemetry.ts @@ -24,7 +24,7 @@ export const registerTelemetryUsageCollector = ({ savedObjects, }: Dependencies) => { const telemetryUsageCollector = usageCollection.makeUsageCollector({ - type: AS_TELEMETRY_NAME, + type: 'app_search', fetch: async () => fetchTelemetryMetrics(savedObjects), }); usageCollection.registerCollector(telemetryUsageCollector); diff --git a/x-pack/plugins/enterprise_search/server/saved_objects/app_search/telemetry.ts b/x-pack/plugins/enterprise_search/server/saved_objects/app_search/telemetry.ts index 614492bcf6510..28f7d2b45b9f6 100644 --- a/x-pack/plugins/enterprise_search/server/saved_objects/app_search/telemetry.ts +++ b/x-pack/plugins/enterprise_search/server/saved_objects/app_search/telemetry.ts @@ -6,7 +6,7 @@ import { SavedObjectsType } from 'src/core/server'; -export const AS_TELEMETRY_NAME = 'app_search_kibana_telemetry'; +export const AS_TELEMETRY_NAME = 'app_search_telemetry'; export interface ITelemetrySavedObject { ui_viewed: {