From d3094b71beb27ab95eb513f623b258c2ff7d49d0 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 28 Nov 2024 04:49:05 +1100 Subject: [PATCH 1/9] [8.17] Revert "[dashboard] fix Reset dashboard breaks panel state when ran after editor edits (#201687)" (#201902) (#202019) # Backport This will backport the following commits from `main` to `8.17`: - [Revert "[dashboard] fix Reset dashboard breaks panel state when ran after editor edits (#201687)" (#201902)](https://github.com/elastic/kibana/pull/201902) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Jon --- .../dashboard_container/embeddable/create/create_dashboard.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts b/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts index d5314c274531f..2510f2e015dfb 100644 --- a/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts +++ b/src/plugins/dashboard/public/dashboard_container/embeddable/create/create_dashboard.ts @@ -362,6 +362,7 @@ export const initializeDashboard = async ({ hidePanelTitles: panelToUpdate.explicitInput.hidePanelTitles, }; if (embeddableService.reactEmbeddableRegistryHasKey(incomingEmbeddable.type)) { + panelToUpdate.explicitInput = { id: panelToUpdate.explicitInput.id }; runtimePanelsToRestore[incomingEmbeddable.embeddableId] = nextRuntimeState; } else { panelToUpdate.explicitInput = nextRuntimeState; From 29aec64423e797d083d188c264bb7d39ee11a3b5 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 28 Nov 2024 04:59:42 +1100 Subject: [PATCH 2/9] [8.17] [ResponseOps][Rules]The rule row actions in the rules table are displayed incorrectly on smaller screens (#201912) (#202023) 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.17`: - [[ResponseOps][Rules]The rule row actions in the rules table are displayed incorrectly on smaller screens (#201912)](https://github.com/elastic/kibana/pull/201912) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Georgiana-Andreea Onoleață --- .../sections/rules_list/components/rules_list_table.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list_table.tsx b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list_table.tsx index 88f22f9687ea6..b325e7fd70a44 100644 --- a/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list_table.tsx +++ b/x-pack/plugins/triggers_actions_ui/public/application/sections/rules_list/components/rules_list_table.tsx @@ -720,7 +720,7 @@ export const RulesListTable = (props: RulesListTableProps) => { ), sortable: true, truncateText: false, - width: '10%', + width: '100px', 'data-test-subj': 'rulesTableCell-status', render: (_enabled: boolean | undefined, rule: RuleTableItem) => { return renderRuleStatusDropdown(rule); From a4b919479a733a6a97b2b35b49f99bed5589f3fa Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 28 Nov 2024 06:59:44 +1100 Subject: [PATCH 3/9] [8.17] [Security Solution][Expandable flyout] - remove unused code (#201477) (#202047) # Backport This will backport the following commits from `main` to `8.17`: - [[Security Solution][Expandable flyout] - remove unused code (#201477)](https://github.com/elastic/kibana/pull/201477) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Philippe Oberti --- .../kbn-expandable-flyout/__mocks__/index.tsx | 29 ------------------ packages/kbn-expandable-flyout/index.ts | 1 - .../src/with_provider.test.tsx | 30 ------------------- .../src/with_provider.tsx | 26 ---------------- .../public/common/mock/expandable_flyout.tsx | 16 ---------- .../table_field_value_cell.test.tsx | 5 ---- .../shared/components/preview_link.test.tsx | 5 ---- 7 files changed, 112 deletions(-) delete mode 100644 packages/kbn-expandable-flyout/src/with_provider.test.tsx delete mode 100644 packages/kbn-expandable-flyout/src/with_provider.tsx diff --git a/packages/kbn-expandable-flyout/__mocks__/index.tsx b/packages/kbn-expandable-flyout/__mocks__/index.tsx index 37d8975351e55..75da56c9eb814 100644 --- a/packages/kbn-expandable-flyout/__mocks__/index.tsx +++ b/packages/kbn-expandable-flyout/__mocks__/index.tsx @@ -7,37 +7,8 @@ * License v3.0 only", or the "Server Side Public License, v 1". */ -import React from 'react'; import type { IStorage } from '@kbn/kibana-utils-plugin/public'; -export const useExpandableFlyoutApi = jest.fn(() => ({ - openFlyout: jest.fn(), - closeFlyout: jest.fn(), - openPanels: jest.fn(), - openRightPanel: jest.fn(), - openLeftPanel: jest.fn(), - openPreviewPanel: jest.fn(), - closeRightPanel: jest.fn(), - closeLeftPanel: jest.fn(), - closePreviewPanel: jest.fn(), - closePanels: jest.fn(), - previousPreviewPanel: jest.fn(), -})); - -export const useExpandableFlyoutState = jest.fn(); - -export const ExpandableFlyoutProvider = jest.fn(({ children }: React.PropsWithChildren<{}>) => { - return <>{children}; -}); - -export const withExpandableFlyoutProvider = ( - Component: React.ComponentType -) => { - return (props: T) => { - return ; - }; -}; - export const ExpandableFlyout = jest.fn(); export const localStorageMock = (): IStorage => { diff --git a/packages/kbn-expandable-flyout/index.ts b/packages/kbn-expandable-flyout/index.ts index f06be45a68914..5816b6673dbc1 100644 --- a/packages/kbn-expandable-flyout/index.ts +++ b/packages/kbn-expandable-flyout/index.ts @@ -15,7 +15,6 @@ export { useExpandableFlyoutState } from './src/hooks/use_expandable_flyout_stat export { type FlyoutPanels as ExpandableFlyoutState } from './src/store/state'; export { ExpandableFlyoutProvider } from './src/provider'; -export { withExpandableFlyoutProvider } from './src/with_provider'; export type { ExpandableFlyoutProps } from './src'; export type { FlyoutPanelProps, PanelPath, ExpandableFlyoutApi } from './src/types'; diff --git a/packages/kbn-expandable-flyout/src/with_provider.test.tsx b/packages/kbn-expandable-flyout/src/with_provider.test.tsx deleted file mode 100644 index de9f831a5db8f..0000000000000 --- a/packages/kbn-expandable-flyout/src/with_provider.test.tsx +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import { render } from '@testing-library/react'; -import { useExpandableFlyoutApi } from './hooks/use_expandable_flyout_api'; -import React from 'react'; -import { withExpandableFlyoutProvider } from './with_provider'; - -const TestComponent = () => { - useExpandableFlyoutApi(); - - return
; -}; - -describe('withExpandableFlyoutProvider', () => { - it('should throw when rendered without Expandable Provider', () => { - expect(() => render()).toThrow(); - }); - - it('should not throw when rendered with Expandable Provider', () => { - const TestComponentWithProvider = withExpandableFlyoutProvider(TestComponent); - expect(() => render()).not.toThrow(); - }); -}); diff --git a/packages/kbn-expandable-flyout/src/with_provider.tsx b/packages/kbn-expandable-flyout/src/with_provider.tsx deleted file mode 100644 index d4fcca19d1bac..0000000000000 --- a/packages/kbn-expandable-flyout/src/with_provider.tsx +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one - * or more contributor license agreements. Licensed under the "Elastic License - * 2.0", the "GNU Affero General Public License v3.0 only", and the "Server Side - * Public License v 1"; you may not use this file except in compliance with, at - * your election, the "Elastic License 2.0", the "GNU Affero General Public - * License v3.0 only", or the "Server Side Public License, v 1". - */ - -import React from 'react'; -import { ComponentType } from 'react'; -import { ExpandableFlyoutContextProviderProps } from './context'; -import { ExpandableFlyoutProvider } from './provider'; - -export const withExpandableFlyoutProvider = ( - Component: ComponentType, - expandableProviderProps?: ExpandableFlyoutContextProviderProps -) => { - return (props: Props) => { - return ( - - - - ); - }; -}; diff --git a/x-pack/plugins/security_solution/public/common/mock/expandable_flyout.tsx b/x-pack/plugins/security_solution/public/common/mock/expandable_flyout.tsx index a987e99a67d0e..69cd24e4ff453 100644 --- a/x-pack/plugins/security_solution/public/common/mock/expandable_flyout.tsx +++ b/x-pack/plugins/security_solution/public/common/mock/expandable_flyout.tsx @@ -5,8 +5,6 @@ * 2.0. */ -import React from 'react'; - export const createExpandableFlyoutApiMock = () => ({ closeFlyout: jest.fn(), closeLeftPanel: jest.fn(), @@ -18,17 +16,3 @@ export const createExpandableFlyoutApiMock = () => ({ openPreviewPanel: jest.fn(), openRightPanel: jest.fn(), }); - -export const createExpandableFlyoutMock = () => { - return { - useExpandableFlyoutApi: jest.fn().mockReturnValue(createExpandableFlyoutApiMock()), - useExpandableFlyoutState: jest.fn(), - ExpandableFlyoutProvider: ({ children }: React.PropsWithChildren<{}>) => <>{children}, - withExpandableFlyoutProvider: (Component: React.ComponentType) => { - return (props: T) => { - return ; - }; - }, - ExpandableFlyout: jest.fn(), - }; -}; diff --git a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx index 8de7c909548b0..ee680f1061621 100644 --- a/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/document_details/right/components/table_field_value_cell.test.tsx @@ -22,11 +22,6 @@ import { createTelemetryServiceMock } from '../../../../common/lib/telemetry/tel jest.mock('@kbn/expandable-flyout', () => ({ useExpandableFlyoutApi: jest.fn(), ExpandableFlyoutProvider: ({ children }: React.PropsWithChildren<{}>) => <>{children}, - withExpandableFlyoutProvider: (Component: React.ComponentType) => { - return (props: T) => { - return ; - }; - }, })); const mockedTelemetry = createTelemetryServiceMock(); diff --git a/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.test.tsx b/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.test.tsx index c1dfc456f40ce..f1dedc18d3b1c 100644 --- a/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.test.tsx +++ b/x-pack/plugins/security_solution/public/flyout/shared/components/preview_link.test.tsx @@ -34,11 +34,6 @@ jest.mock('../../../common/lib/kibana', () => { jest.mock('@kbn/expandable-flyout', () => ({ useExpandableFlyoutApi: jest.fn(), ExpandableFlyoutProvider: ({ children }: React.PropsWithChildren<{}>) => <>{children}, - withExpandableFlyoutProvider: (Component: React.ComponentType) => { - return (props: T) => { - return ; - }; - }, })); const renderPreviewLink = (field: string, value: string, dataTestSuj?: string) => From 78f4d9bed2cf9f7f501ac78fcabaf5e136cc564d Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 27 Nov 2024 15:58:57 -0600 Subject: [PATCH 4/9] [8.17] Update docker.elastic.co/wolfi/chainguard-base:latest Docker digest to 32f06b1 (main) (#201734) (#201827) #201734 Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> --- src/dev/build/tasks/os_packages/docker_generator/run.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dev/build/tasks/os_packages/docker_generator/run.ts b/src/dev/build/tasks/os_packages/docker_generator/run.ts index 186360c03e805..be9fe9f12512d 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/run.ts +++ b/src/dev/build/tasks/os_packages/docker_generator/run.ts @@ -51,7 +51,7 @@ export async function runDockerGenerator( */ if (flags.baseImage === 'wolfi') baseImageName = - 'docker.elastic.co/wolfi/chainguard-base:latest@sha256:32099b99697d9da842c1ccacdbef1beee05a68cddb817e858d7656df45ed4c93'; + 'docker.elastic.co/wolfi/chainguard-base:latest@sha256:32f06b169bb4b0f257fbb10e8c8379f06d3ee1355c89b3327cb623781a29590e'; let imageFlavor = ''; if (flags.baseImage === 'ubi') imageFlavor += `-ubi`; From 60865a1194403d7929650134a4b628e9d6387339 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 28 Nov 2024 09:01:59 +1100 Subject: [PATCH 5/9] [8.17] Remove mention of (secure) settings qualifier from docs (#201900) (#202076) # Backport This will backport the following commits from `main` to `8.17`: - [Remove mention of (secure) settings qualifier from docs (#201900)](https://github.com/elastic/kibana/pull/201900) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Brad White --- docs/setup/secure-settings.asciidoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/setup/secure-settings.asciidoc b/docs/setup/secure-settings.asciidoc index 63d0465db9a0a..4dc80b097b694 100644 --- a/docs/setup/secure-settings.asciidoc +++ b/docs/setup/secure-settings.asciidoc @@ -8,8 +8,8 @@ keystore, and the `kibana-keystore` tool to manage the settings in the keystore. [NOTE] ==== * Run all commands as the user who runs {kib}. -* Only the settings with the `(Secure)` qualifier should be stored in the keystore. - Unsupported, extraneous or invalid JSON-string settings cause {kib} to fail to start up. +* Any valid {kib} setting can be stored in the keystore securely. + Unsupported, extraneous or invalid settings will cause {kib} to fail to start up. ==== [float] From 5db0ac6935abb09625074dbdd0a5081801dd6dae Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 27 Nov 2024 16:30:38 -0600 Subject: [PATCH 6/9] [8.17][ironbank] Upgrade ubi to 9.5 (#202064) --- .../os_packages/docker_generator/templates/ironbank/Dockerfile | 2 +- .../docker_generator/templates/ironbank/hardening_manifest.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/Dockerfile b/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/Dockerfile index f7849bff06ead..9993381fb4332 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/Dockerfile +++ b/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/Dockerfile @@ -4,7 +4,7 @@ ################################################################################ ARG BASE_REGISTRY=registry1.dso.mil ARG BASE_IMAGE=ironbank/redhat/ubi/ubi9 -ARG BASE_TAG=9.4 +ARG BASE_TAG=9.5 FROM ${BASE_REGISTRY}/${BASE_IMAGE}:${BASE_TAG} as prep_files diff --git a/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/hardening_manifest.yaml b/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/hardening_manifest.yaml index d1d76367b4ec3..aeec80010809c 100644 --- a/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/hardening_manifest.yaml +++ b/src/dev/build/tasks/os_packages/docker_generator/templates/ironbank/hardening_manifest.yaml @@ -11,7 +11,7 @@ tags: # Build args passed to Dockerfile ARGs args: BASE_IMAGE: 'redhat/ubi/ubi9' - BASE_TAG: "9.4" + BASE_TAG: "9.5" # Docker image labels labels: org.opencontainers.image.title: 'kibana' From b719f99e09dc23a419e5b6ee8227bdc3bce90db3 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 28 Nov 2024 10:44:00 +1100 Subject: [PATCH 7/9] [8.17] [Security Solution] Fix code scanning alert no. 469: Prototype-polluting function (#201712) (#202081) # Backport This will backport the following commits from `main` to `8.17`: - [[Security Solution] Fix code scanning alert no. 469: Prototype-polluting function (#201712)](https://github.com/elastic/kibana/pull/201712) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Kevin Qualters <56408403+kqualters-elastic@users.noreply.github.com> --- .../timeline/factory/helpers/format_timeline_data.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.ts b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.ts index 481b74a802fec..3b83bb0873981 100644 --- a/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.ts +++ b/x-pack/plugins/timelines/server/search_strategy/timeline/factory/helpers/format_timeline_data.ts @@ -34,7 +34,14 @@ const createBaseTimelineEdges = (): TimelineEdges => ({ function deepMerge(target: EventSource, source: EventSource) { for (const key in source) { - if (source && source[key] instanceof Object && target && target[key] instanceof Object) { + if ( + !Object.prototype.hasOwnProperty.call(source, key) || + key === '__proto__' || + key === 'constructor' + ) + // eslint-disable-next-line no-continue + continue; + if (source[key] instanceof Object && target[key] instanceof Object) { deepMerge(target[key], source[key]); } else { target[key] = source[key]; From a5f86f1810fc55de5465d83bcd37441a8cd25f98 Mon Sep 17 00:00:00 2001 From: Brad White Date: Wed, 27 Nov 2024 17:58:21 -0700 Subject: [PATCH 8/9] [8.17] Update ftr (main) (#199090) (#202085) # Backport This will backport the following commits from `main` to `8.17`: - [Update ftr (main) (#199090)](https://github.com/elastic/kibana/pull/199090) Co-authored-by: elastic-renovate-prod[bot] <174716857+elastic-renovate-prod[bot]@users.noreply.github.com> --- package.json | 6 ++--- yarn.lock | 64 ++++++++++++++++++++++++++-------------------------- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index 8ee2dca666de1..c48e7173dc67e 100644 --- a/package.json +++ b/package.json @@ -1638,7 +1638,7 @@ "@types/resolve": "^1.20.1", "@types/scheduler": "^0.23.0", "@types/seedrandom": ">=2.0.0 <4.0.0", - "@types/selenium-webdriver": "^4.1.26", + "@types/selenium-webdriver": "^4.1.27", "@types/semver": "^7.5.8", "@types/set-value": "^2.0.0", "@types/sinon": "^7.0.13", @@ -1734,7 +1734,7 @@ "file-loader": "^4.2.0", "find-cypress-specs": "^1.41.4", "form-data": "^4.0.0", - "geckodriver": "^4.5.1", + "geckodriver": "^5.0.0", "gulp-brotli": "^3.0.0", "gulp-postcss": "^9.0.1", "gulp-terser": "^2.1.0", @@ -1809,7 +1809,7 @@ "rxjs-marbles": "^7.0.1", "sass-embedded": "^1.78.0", "sass-loader": "^10.5.1", - "selenium-webdriver": "^4.25.0", + "selenium-webdriver": "^4.26.0", "sharp": "0.32.6", "simple-git": "^3.16.0", "sinon": "^7.4.2", diff --git a/yarn.lock b/yarn.lock index 93135c3779b57..dec36f2ee03b7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1919,10 +1919,10 @@ resolved "https://registry.yarnpkg.com/@bazel/ibazel/-/ibazel-0.16.2.tgz#05dd7f06659759fda30f87b15534f1e42f1201bb" integrity sha512-KgqAWMH0emL6f3xH6nqyTryoBMqlJ627LBIe9PT1PRRQPz2FtHib3FIHJPukp1slzF3hJYZvdiVwgPnHbaSOOA== -"@bazel/runfiles@^5.8.1": - version "5.8.1" - resolved "https://registry.yarnpkg.com/@bazel/runfiles/-/runfiles-5.8.1.tgz#737d5b3dc9739767054820265cfe432a80564c82" - integrity sha512-NDdfpdQ6rZlylgv++iMn5FkObC/QlBQvipinGLSOguTYpRywmieOyJ29XHvUilspwTFSILWpoE9CqMGkHXug1g== +"@bazel/runfiles@^6.3.1": + version "6.3.1" + resolved "https://registry.yarnpkg.com/@bazel/runfiles/-/runfiles-6.3.1.tgz#3f8824b2d82853377799d42354b4df78ab0ace0b" + integrity sha512-1uLNT5NZsUVIGS4syuHwTzZ8HycMPyr6POA3FCE4GbMtc4rhoJk8aZKtNIRthJYfL+iioppi+rTfH3olMPr9nA== "@bazel/typescript@4.6.2": version "4.6.2" @@ -12221,10 +12221,10 @@ resolved "https://registry.yarnpkg.com/@types/seedrandom/-/seedrandom-2.4.28.tgz#9ce8fa048c1e8c85cb71d7fe4d704e000226036f" integrity sha512-SMA+fUwULwK7sd/ZJicUztiPs8F1yCPwF3O23Z9uQ32ME5Ha0NmDK9+QTsYE4O2tHXChzXomSWWeIhCnoN1LqA== -"@types/selenium-webdriver@^4.1.26": - version "4.1.26" - resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-4.1.26.tgz#09c696a341cf8cfc1641cded11d14813350b6ca9" - integrity sha512-PUgqsyNffal0eAU0bzGlh37MJo558aporAPZoKqBeB/pF7zhKl1S3zqza0GpwFqgoigNxWhEIJzru75eeYco/w== +"@types/selenium-webdriver@^4.1.27": + version "4.1.27" + resolved "https://registry.yarnpkg.com/@types/selenium-webdriver/-/selenium-webdriver-4.1.27.tgz#e08000d649df6f099b4099432bd2fece9f50ea7b" + integrity sha512-ALqsj8D7Swb6MnBQuAQ58J3KC3yh6fLGtAmpBmnZX8j+0kmP7NaLt56CuzBw2W2bXPrvHFTgn8iekOQFUKXEQA== dependencies: "@types/node" "*" "@types/ws" "*" @@ -12664,10 +12664,10 @@ resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406" integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ== -"@wdio/logger@^9.0.0": - version "9.0.4" - resolved "https://registry.yarnpkg.com/@wdio/logger/-/logger-9.0.4.tgz#63e901b9f0f29fa1ded5af54006fbd4df2354c33" - integrity sha512-b6gcu0PTVb3fgK4kyAH/k5UUWN5FOUdAfhA4PAY/IZvxZTMFYMqnrZb0WRWWWqL6nu9pcrOVtCOdPBvj0cb+Nw== +"@wdio/logger@^9.1.3": + version "9.1.3" + resolved "https://registry.yarnpkg.com/@wdio/logger/-/logger-9.1.3.tgz#b64b3d2ac642498f3c97580e2f0971f13c1e8fbb" + integrity sha512-cumRMK/gE1uedBUw3WmWXOQ7HtB6DR8EyKQioUz2P0IJtRRpglMBdZV7Svr3b++WWawOuzZHMfbTkJQmaVt8Gw== dependencies: chalk "^5.1.2" loglevel "^1.6.0" @@ -13047,10 +13047,10 @@ resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== -"@zip.js/zip.js@^2.7.48": - version "2.7.51" - resolved "https://registry.yarnpkg.com/@zip.js/zip.js/-/zip.js-2.7.51.tgz#a434e285048b951a5788d3d2d59aa68f209e7141" - integrity sha512-RKHaebzZZgQkUuzb49/qweN69e8Np9AUZ9QygydDIrbG1njypSAKwkeqIVeuf2JVGBDyB7Z9HKvzPgYrSlv9gw== +"@zip.js/zip.js@^2.7.53": + version "2.7.53" + resolved "https://registry.yarnpkg.com/@zip.js/zip.js/-/zip.js-2.7.53.tgz#bf88e90d8eed562182c01339643bc405446b0578" + integrity sha512-G6Bl5wN9EXXVaTUIox71vIX5Z454zEBe+akKpV4m1tUboIctT5h7ID3QXCJd/Lfy2rSvmkTmZIucf1jGRR4f5A== a-sync-waterfall@^1.0.0: version "1.0.1" @@ -19504,19 +19504,19 @@ gcp-metadata@^6.1.0: gaxios "^6.0.0" json-bigint "^1.0.0" -geckodriver@^4.5.1: - version "4.5.1" - resolved "https://registry.yarnpkg.com/geckodriver/-/geckodriver-4.5.1.tgz#624fc01815c1aa498dd3f717f7bd4c6cca0c57b8" - integrity sha512-lGCRqPMuzbRNDWJOQcUqhNqPvNsIFu6yzXF8J/6K3WCYFd2r5ckbeF7h1cxsnjA7YLSEiWzERCt6/gjZ3tW0ug== +geckodriver@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/geckodriver/-/geckodriver-5.0.0.tgz#88437f3812075988bb05b5e19dc4aaa42d200577" + integrity sha512-vn7TtQ3b9VMJtVXsyWtQQl1fyBVFhQy7UvJF96kPuuJ0or5THH496AD3eUyaDD11+EqCxH9t6V+EP9soZQk4YQ== dependencies: - "@wdio/logger" "^9.0.0" - "@zip.js/zip.js" "^2.7.48" + "@wdio/logger" "^9.1.3" + "@zip.js/zip.js" "^2.7.53" decamelize "^6.0.0" http-proxy-agent "^7.0.2" https-proxy-agent "^7.0.5" node-fetch "^3.3.2" tar-fs "^3.0.6" - which "^4.0.0" + which "^5.0.0" gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: version "1.0.0-beta.2" @@ -29043,12 +29043,12 @@ select-hose@^2.0.0: resolved "https://registry.yarnpkg.com/select-hose/-/select-hose-2.0.0.tgz#625d8658f865af43ec962bfc376a37359a4994ca" integrity sha1-Yl2GWPhlr0Psliv8N2o3NZpJlMo= -selenium-webdriver@^4.25.0: - version "4.25.0" - resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.25.0.tgz#3562b49668817974bb1d13d25a50e8bc0264fcf3" - integrity sha512-zl9IX93caOT8wbcCpZzAkEtYa+hNgJ4C5GUN8uhpzggqRLvsg1asfKi0p1uNZC8buYVvsBZbx8S+9MjVAjs4oA== +selenium-webdriver@^4.26.0: + version "4.26.0" + resolved "https://registry.yarnpkg.com/selenium-webdriver/-/selenium-webdriver-4.26.0.tgz#23163cdad20388214a4ad17c1f38262a0857c902" + integrity sha512-nA7jMRIPV17mJmAiTDBWN96Sy0Uxrz5CCLb7bLVV6PpL417SyBMPc2Zo/uoREc2EOHlzHwHwAlFtgmSngSY4WQ== dependencies: - "@bazel/runfiles" "^5.8.1" + "@bazel/runfiles" "^6.3.1" jszip "^3.10.1" tmp "^0.2.3" ws "^8.18.0" @@ -33076,10 +33076,10 @@ which@^2.0.1: dependencies: isexe "^2.0.0" -which@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/which/-/which-4.0.0.tgz#cd60b5e74503a3fbcfbf6cd6b4138a8bae644c1a" - integrity sha512-GlaYyEb07DPxYCKhKzplCWBJtvxZcZMrL+4UkrTSJHHPyZU4mYYTv3qaOe77H7EODLSSopAUFAc6W8U4yqvscg== +which@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/which/-/which-5.0.0.tgz#d93f2d93f79834d4363c7d0c23e00d07c466c8d6" + integrity sha512-JEdGzHwwkrbWoGOlIHqQ5gtprKGOenpDHpxE9zVR1bWbOtYRyPPHMe9FaP6x61CmNaTThSkb0DAJte5jD+DmzQ== dependencies: isexe "^3.1.1" From 67e441f665c5e68e1ea031ed216b20e3a865255b Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Thu, 28 Nov 2024 17:18:55 +1100 Subject: [PATCH 9/9] [8.17] [Stack Monitoring] Do not add empty include array when retrieving logstash pipelines (#202039) (#202100) # Backport This will backport the following commits from `main` to `8.17`: - [[Stack Monitoring] Do not add empty include array when retrieving logstash pipelines (#202039)](https://github.com/elastic/kibana/pull/202039) ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) Co-authored-by: Valentin Crettaz --- .../__snapshots__/metrics.test.js.snap | 4 +-- .../server/lib/metrics/logstash/classes.ts | 25 ++++++++----------- .../server/lib/metrics/logstash/metrics.ts | 20 ++++++++------- 3 files changed, 23 insertions(+), 26 deletions(-) diff --git a/x-pack/plugins/monitoring/server/lib/metrics/__snapshots__/metrics.test.js.snap b/x-pack/plugins/monitoring/server/lib/metrics/__snapshots__/metrics.test.js.snap index 24d9d52224fa4..242bfaeaffb6b 100644 --- a/x-pack/plugins/monitoring/server/lib/metrics/__snapshots__/metrics.test.js.snap +++ b/x-pack/plugins/monitoring/server/lib/metrics/__snapshots__/metrics.test.js.snap @@ -5981,7 +5981,7 @@ Object { "isNotSupportedInInternalCollection": undefined, "label": "Pipeline Node Count", "legendFormat": undefined, - "mbField": undefined, + "mbField": "logstash.node.stats.logstash.uuid", "metricAgg": undefined, "periodsField": undefined, "quotaField": undefined, @@ -6437,7 +6437,7 @@ Object { "isNotSupportedInInternalCollection": undefined, "label": "Pipeline Node Count", "legendFormat": undefined, - "mbField": undefined, + "mbField": "logstash.node.stats.logstash.uuid", "metricAgg": undefined, "periodsField": undefined, "quotaField": undefined, diff --git a/x-pack/plugins/monitoring/server/lib/metrics/logstash/classes.ts b/x-pack/plugins/monitoring/server/lib/metrics/logstash/classes.ts index fd150864c6b2e..b1240a2ca9798 100644 --- a/x-pack/plugins/monitoring/server/lib/metrics/logstash/classes.ts +++ b/x-pack/plugins/monitoring/server/lib/metrics/logstash/classes.ts @@ -7,11 +7,11 @@ /* eslint-disable max-classes-per-file */ -import _ from 'lodash'; import { i18n } from '@kbn/i18n'; -import { ClusterMetric, Metric, MetricOptions } from '../classes'; -import { LARGE_FLOAT } from '../../../../common/formatting'; +import _ from 'lodash'; import { NORMALIZED_DERIVATIVE_UNIT } from '../../../../common/constants'; +import { LARGE_FLOAT } from '../../../../common/formatting'; +import { ClusterMetric, Metric, MetricOptions } from '../classes'; const msTimeUnitLabel = i18n.translate('xpack.monitoring.metrics.logstash.msTimeUnitLabel', { defaultMessage: 'ms', @@ -411,7 +411,7 @@ export class LogstashPipelineThroughputMetric extends LogstashMetric { type LogstashPipelineNodeCountMetricOptions = Pick< MetricOptions, - 'field' | 'label' | 'description' | 'format' | 'units' + 'field' | 'label' | 'mbField' | 'description' | 'format' | 'units' > & Partial>; @@ -427,15 +427,10 @@ export class LogstashPipelineNodeCountMetric extends LogstashMetric { }: { pageOfPipelines: Array<{ id: string }>; }) => { - const termAggExtras: { - include: string[]; - } = { - include: [], - }; + const include: string[] | undefined = pageOfPipelines?.length + ? pageOfPipelines.map((pipeline) => pipeline.id) + : undefined; - if (pageOfPipelines) { - termAggExtras.include = pageOfPipelines.map((pipeline) => pipeline.id); - } return { pipelines_nested: { nested: { @@ -446,7 +441,7 @@ export class LogstashPipelineNodeCountMetric extends LogstashMetric { terms: { field: 'logstash_stats.pipelines.id', size: 1000, - ...termAggExtras, + include, }, aggs: { to_root: { @@ -472,7 +467,7 @@ export class LogstashPipelineNodeCountMetric extends LogstashMetric { terms: { field: 'logstash.node.stats.pipelines.id', size: 1000, - ...termAggExtras, + include, }, aggs: { to_root: { @@ -480,7 +475,7 @@ export class LogstashPipelineNodeCountMetric extends LogstashMetric { aggs: { node_count: { cardinality: { - field: this.field, + field: this.mbField, }, }, }, diff --git a/x-pack/plugins/monitoring/server/lib/metrics/logstash/metrics.ts b/x-pack/plugins/monitoring/server/lib/metrics/logstash/metrics.ts index 97119289d2139..73aa91ef6f5fa 100644 --- a/x-pack/plugins/monitoring/server/lib/metrics/logstash/metrics.ts +++ b/x-pack/plugins/monitoring/server/lib/metrics/logstash/metrics.ts @@ -6,23 +6,23 @@ */ import { i18n } from '@kbn/i18n'; +import { + LARGE_ABBREVIATED, + LARGE_BYTES, + LARGE_FLOAT, + SMALL_BYTES, +} from '../../../../common/formatting'; import { QuotaMetric } from '../classes'; import { - LogstashEventsRateClusterMetric, LogstashEventsLatencyClusterMetric, - LogstashEventsRateMetric, LogstashEventsLatencyMetric, + LogstashEventsRateClusterMetric, + LogstashEventsRateMetric, LogstashMetric, + LogstashPipelineNodeCountMetric, LogstashPipelineQueueSizeMetric, LogstashPipelineThroughputMetric, - LogstashPipelineNodeCountMetric, } from './classes'; -import { - LARGE_FLOAT, - LARGE_BYTES, - SMALL_BYTES, - LARGE_ABBREVIATED, -} from '../../../../common/formatting'; const instanceSystemLoadTitle = i18n.translate( 'xpack.monitoring.metrics.logstash.systemLoadTitle', @@ -451,6 +451,7 @@ export const metrics = { logstash_cluster_pipeline_nodes_count: new LogstashPipelineNodeCountMetric({ field: 'logstash_stats.logstash.uuid', label: pipelineNodeCountLabel, + mbField: 'logstash.node.stats.logstash.uuid', description: pipelineNodeCountDescription, format: LARGE_FLOAT, units: '', @@ -459,6 +460,7 @@ export const metrics = { uuidField: 'logstash_stats.logstash.uuid', // TODO: add comment explaining why field: 'logstash_stats.logstash.uuid', label: pipelineNodeCountLabel, + mbField: 'logstash.node.stats.logstash.uuid', description: pipelineNodeCountDescription, format: LARGE_FLOAT, units: '',