From 52418adee344e58123a96ef52347b5876c36b371 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Ferna=CC=81ndez=20Haro?= Date: Tue, 27 Apr 2021 15:18:05 +0200 Subject: [PATCH] Fix types issues --- .../telemetry/server/telemetry_collection/get_kibana.ts | 2 +- .../server/telemetry_collection/get_stats_with_xpack.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/telemetry/server/telemetry_collection/get_kibana.ts b/src/plugins/telemetry/server/telemetry_collection/get_kibana.ts index b1ee2d1267ea6..3f1966901544a 100644 --- a/src/plugins/telemetry/server/telemetry_collection/get_kibana.ts +++ b/src/plugins/telemetry/server/telemetry_collection/get_kibana.ts @@ -27,7 +27,7 @@ export interface KibanaUsageStats { }; }; - [plugin: string]: unknown; + [plugin: string]: Record; } export function handleKibanaStats( diff --git a/x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_stats_with_xpack.ts b/x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_stats_with_xpack.ts index 30bcd19007c0d..3adc5bc9f2eac 100644 --- a/x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_stats_with_xpack.ts +++ b/x-pack/plugins/telemetry_collection_xpack/server/telemetry_collection/get_stats_with_xpack.ts @@ -45,7 +45,9 @@ export const getStatsWithXpack: StatsGetter = async fu }) .reduce((acc, stats) => { // Concatenate the telemetry reported via monitoring as additional payloads instead of reporting it inside of stack_stats.kibana.plugins.monitoringTelemetry - const monitoringTelemetry = stats.stack_stats.kibana?.plugins?.monitoringTelemetry?.stats; + const monitoringTelemetry = stats.stack_stats.kibana?.plugins?.monitoringTelemetry?.stats as + | TelemetryAggregatedStats[] + | undefined; if (monitoringTelemetry) { delete stats.stack_stats.kibana!.plugins.monitoringTelemetry; }