From d52cf928b2703e93b614227e5be031e4807afb69 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 9 Jul 2024 14:58:19 +0200 Subject: [PATCH] [8.15] [ML] Transform: Fix transform stats API call in the transform health alerting rule (#187586) (#187617) # Backport This will backport the following commits from `main` to `8.15`: - [[ML] Transform: Fix transform stats API call in the transform health alerting rule (#187586)](https://github.com/elastic/kibana/pull/187586) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Dima Arnautov Co-authored-by: Elastic Machine --- .../transform_health_rule_type/transform_health_service.test.ts | 1 + .../transform_health_rule_type/transform_health_service.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.test.ts b/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.test.ts index cbe68b096e09d..ff502c9fcdc2e 100644 --- a/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.test.ts +++ b/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.test.ts @@ -117,6 +117,7 @@ describe('transformHealthServiceProvider', () => { expect(esClient.transform.getTransformStats).toHaveBeenCalledTimes(1); expect(esClient.transform.getTransformStats).toHaveBeenNthCalledWith(1, { basic: true, + transform_id: '_all', }); const notStarted = result[0]; diff --git a/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.ts b/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.ts index 7ad2fdde6057d..939d4e01a6f1d 100644 --- a/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.ts +++ b/x-pack/plugins/transform/server/lib/alerting/transform_health_rule_type/transform_health_service.ts @@ -122,6 +122,7 @@ export function transformHealthServiceProvider({ await esClient.transform.getTransformStats({ // @ts-expect-error `basic` query option not yet in @elastic/elasticsearch basic: true, + transform_id: '_all', }) ).transforms as TransformStats[] ).filter((t) => transformIds.has(t.id));