From 500e598f8223e69e8664fc2910050635c00911c1 Mon Sep 17 00:00:00 2001 From: Constance Chen Date: Thu, 2 Jul 2020 13:29:59 -0700 Subject: [PATCH] Fix telemetry type complaint - I don't really understand why this works but ok --- .../server/collectors/app_search/telemetry.ts | 22 ++++++++++++++----- .../saved_objects/app_search/telemetry.ts | 16 -------------- 2 files changed, 16 insertions(+), 22 deletions(-) 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 7ac2e7062b3ab..4fd49f19a6420 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 @@ -12,11 +12,7 @@ import { } from 'src/core/server'; import { UsageCollectionSetup } from 'src/plugins/usage_collection/server'; -import { - AS_TELEMETRY_NAME, - ITelemetrySavedObject, - appSearchTelemetrySchema, -} from '../../saved_objects/app_search/telemetry'; +import { AS_TELEMETRY_NAME, ITelemetrySavedObject } from '../../saved_objects/app_search/telemetry'; /** * Register the telemetry collector @@ -30,7 +26,21 @@ export const registerTelemetryUsageCollector = ( type: 'app_search', fetch: async () => fetchTelemetryMetrics(savedObjects), isReady: () => true, - schema: appSearchTelemetrySchema, + schema: { + ui_viewed: { + setup_guide: { type: 'long' }, + engines_overview: { type: 'long' }, + }, + ui_error: { + cannot_connect: { type: 'long' }, + no_as_account: { type: 'long' }, + }, + ui_clicked: { + create_first_engine_button: { type: 'long' }, + header_launch_button: { type: 'long' }, + engine_table_link: { type: 'long' }, + }, + }, }); 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 4b7f8e731482e..995a11f195f7e 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 @@ -24,22 +24,6 @@ export interface ITelemetrySavedObject { }; } -export const appSearchTelemetrySchema = { - ui_viewed: { - setup_guide: { type: 'long' }, - engines_overview: { type: 'long' }, - }, - ui_error: { - cannot_connect: { type: 'long' }, - no_as_account: { type: 'long' }, - }, - ui_clicked: { - create_first_engine_button: { type: 'long' }, - header_launch_button: { type: 'long' }, - engine_table_link: { type: 'long' }, - }, -}; - export const appSearchTelemetryType: SavedObjectsType = { name: AS_TELEMETRY_NAME, hidden: false,