Skip to content

Commit

Permalink
Fix telemetry type complaint
Browse files Browse the repository at this point in the history
- I don't really understand why this works but ok
  • Loading branch information
cee-chen committed Jul 2, 2020
1 parent 64bcf9b commit 500e598
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 500e598

Please sign in to comment.