From a55a9e5074057628196ab287cd9cf8b22fced2c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Ferna=CC=81ndez=20Haro?= Date: Tue, 29 Sep 2020 18:52:26 +0100 Subject: [PATCH] [Usage Collection] [schema] `actions` --- x-pack/.telemetryrc.json | 1 - .../server/usage/actions_usage_collector.ts | 7 ++++++ .../schema/xpack_plugins.json | 24 +++++++++++++++++++ 3 files changed, 31 insertions(+), 1 deletion(-) diff --git a/x-pack/.telemetryrc.json b/x-pack/.telemetryrc.json index 9140dbdaf00ae..a7c60da0efdce 100644 --- a/x-pack/.telemetryrc.json +++ b/x-pack/.telemetryrc.json @@ -2,7 +2,6 @@ "output": "plugins/telemetry_collection_xpack/schema/xpack_plugins.json", "root": "plugins/", "exclude": [ - "plugins/actions/server/usage/actions_usage_collector.ts", "plugins/alerts/server/usage/alerts_usage_collector.ts", "plugins/apm/server/lib/apm_telemetry/index.ts", "plugins/infra/server/usage/usage_collector.ts", diff --git a/x-pack/plugins/actions/server/usage/actions_usage_collector.ts b/x-pack/plugins/actions/server/usage/actions_usage_collector.ts index aa546e08ea1ba..966ca75ef9a46 100644 --- a/x-pack/plugins/actions/server/usage/actions_usage_collector.ts +++ b/x-pack/plugins/actions/server/usage/actions_usage_collector.ts @@ -16,6 +16,13 @@ export function createActionsUsageCollector( return usageCollection.makeUsageCollector({ type: 'actions', isReady: () => true, + schema: { + count_total: { type: 'long' }, + count_active_total: { type: 'long' }, + // TODO: Find out all the possible values for DYNAMIC_KEY or reformat into an array + count_by_type: { DYNAMIC_KEY: { type: 'long' } }, + count_active_by_type: { DYNAMIC_KEY: { type: 'long' } }, + }, fetch: async () => { try { const doc = await getLatestTaskState(await taskManager); diff --git a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json index 9acffa1f6c78e..0196ef1d7fcb0 100644 --- a/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json +++ b/x-pack/plugins/telemetry_collection_xpack/schema/xpack_plugins.json @@ -1,5 +1,29 @@ { "properties": { + "actions": { + "properties": { + "count_total": { + "type": "long" + }, + "count_active_total": { + "type": "long" + }, + "count_by_type": { + "properties": { + "DYNAMIC_KEY": { + "type": "long" + } + } + }, + "count_active_by_type": { + "properties": { + "DYNAMIC_KEY": { + "type": "long" + } + } + } + } + }, "canvas": { "properties": { "workpads": {