From 11acd0169af965ee64c15cdb027113ff6171b9de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Rica=20Pais=20da=20Silva?= Date: Wed, 18 Sep 2024 12:33:07 +0200 Subject: [PATCH] [8.15] [Infra] Add observability feature id to host request (#192898) (#193260) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Backport This will backport the following commits from `main` to `8.15`: - [[Infra] Add observability feature id to host request (#192898)](https://github.com/elastic/kibana/pull/192898) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) \n\n### Questions ?\nPlease refer to the [Backport tool\ndocumentation](https://github.com/sqren/backport)\n\n\n\nCo-authored-by: Gonçalo Rica Pais da Silva "}}]}] BACKPORT--> --- .../server/routes/infra/lib/host/get_hosts_alerts_count.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/observability_solution/infra/server/routes/infra/lib/host/get_hosts_alerts_count.ts b/x-pack/plugins/observability_solution/infra/server/routes/infra/lib/host/get_hosts_alerts_count.ts index 5a32423d62ee1..b6cfef2cbc397 100644 --- a/x-pack/plugins/observability_solution/infra/server/routes/infra/lib/host/get_hosts_alerts_count.ts +++ b/x-pack/plugins/observability_solution/infra/server/routes/infra/lib/host/get_hosts_alerts_count.ts @@ -6,6 +6,7 @@ */ import { kqlQuery, termQuery, termsQuery } from '@kbn/observability-plugin/server'; +import { observabilityFeatureId } from '@kbn/observability-shared-plugin/common'; import { ALERT_RULE_PRODUCER, ALERT_STATUS, @@ -48,7 +49,7 @@ export async function getHostsAlertsCount({ query: { bool: { filter: [ - ...termQuery(ALERT_RULE_PRODUCER, INFRA_ALERT_FEATURE_ID), + ...termsQuery(ALERT_RULE_PRODUCER, INFRA_ALERT_FEATURE_ID, observabilityFeatureId), ...termQuery(ALERT_STATUS, ALERT_STATUS_ACTIVE), ...termsQuery(BUCKET_KEY, ...hostNamesShortList), ...rangeQuery,