diff --git a/x-pack/legacy/plugins/monitoring/server/telemetry_collection/__mocks__/fixtures/beats_stats_results.json b/x-pack/legacy/plugins/monitoring/server/telemetry_collection/__mocks__/fixtures/beats_stats_results.json index 584618057256a1..c9f0cf0a5e6ad2 100644 --- a/x-pack/legacy/plugins/monitoring/server/telemetry_collection/__mocks__/fixtures/beats_stats_results.json +++ b/x-pack/legacy/plugins/monitoring/server/telemetry_collection/__mocks__/fixtures/beats_stats_results.json @@ -12,6 +12,9 @@ "functions": { "count": 1 } + }, + "queue": { + "name": "mem" } } } @@ -27,6 +30,9 @@ "functions": { "count": 3 } + }, + "queue": { + "name": "mem" } } } @@ -53,6 +59,9 @@ "endpoints" : 1 }, "monitors" : 2 + }, + "queue": { + "name": "spool" } } } diff --git a/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_beats_stats.test.ts b/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_beats_stats.test.ts index 30888e1af3f533..310c01571c71db 100644 --- a/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_beats_stats.test.ts +++ b/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_beats_stats.test.ts @@ -110,6 +110,10 @@ describe('Get Beats Stats', () => { count: 0, names: [], }, + queue: { + mem: 0, + spool: 0, + }, architecture: { count: 0, architectures: [], @@ -142,6 +146,10 @@ describe('Get Beats Stats', () => { count: 1, names: ['firehose'], }, + queue: { + mem: 2, + spool: 1, + }, architecture: { count: 1, architectures: [ @@ -198,6 +206,10 @@ describe('Get Beats Stats', () => { count: 0, names: [], }, + queue: { + mem: 0, + spool: 0, + }, architecture: { count: 0, architectures: [], diff --git a/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_beats_stats.ts b/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_beats_stats.ts index 975a3bfee6333c..e817c402e22cca 100644 --- a/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_beats_stats.ts +++ b/x-pack/legacy/plugins/monitoring/server/telemetry_collection/get_beats_stats.ts @@ -29,6 +29,10 @@ const getBaseStats = () => ({ count: 0, names: [], }, + queue: { + mem: 0, + spool: 0, + }, architecture: { count: 0, architectures: [], @@ -69,6 +73,9 @@ export interface BeatsStats { names: string[]; count: number; }; + queue?: { + name?: string; + }; heartbeat?: HeartbeatBase; functionbeat?: { functions?: { @@ -107,6 +114,9 @@ export interface BeatsBaseStats { count: number; names: string[]; }; + queue: { + [queueType: string]: number; + }; architecture: { count: number; architectures: BeatsArchitecture[]; @@ -215,6 +225,11 @@ export function processResults( clusters[clusterUuid].module.count += stateModule.count; } + const stateQueue = hit._source.beats_state?.state?.queue?.name; + if (stateQueue !== undefined) { + clusters[clusterUuid].queue[stateQueue] += 1; + } + const heartbeatState = hit._source.beats_state?.state?.heartbeat; if (heartbeatState !== undefined) { if (!clusters[clusterUuid].hasOwnProperty('heartbeat')) { @@ -325,6 +340,7 @@ async function fetchBeatsByType( 'hits.hits._source.beats_stats.metrics.libbeat.output.type', 'hits.hits._source.beats_state.state.input', 'hits.hits._source.beats_state.state.module', + 'hits.hits._source.beats_state.state.queue', 'hits.hits._source.beats_state.state.host', 'hits.hits._source.beats_state.state.heartbeat', 'hits.hits._source.beats_state.beat.type',