From 8e5c60cfc59286a051f82417cfa0c4037fa144f8 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Tue, 31 May 2022 06:25:38 -0500 Subject: [PATCH 1/4] Adds documentation of alternate kibana yml usage. (#132578) (#133200) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> (cherry picked from commit 891e21230c9a02c199727d85cdac03324531230a) Co-authored-by: Jeramy Soucy --- .../getting-started/running-kibana-advanced.asciidoc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/developer/getting-started/running-kibana-advanced.asciidoc b/docs/developer/getting-started/running-kibana-advanced.asciidoc index 5b2a58836008c..612ec02bc40b9 100644 --- a/docs/developer/getting-started/running-kibana-advanced.asciidoc +++ b/docs/developer/getting-started/running-kibana-advanced.asciidoc @@ -52,6 +52,11 @@ non-dev version and accepts any of the https://www.elastic.co/guide/en/kibana/current/settings.html[standard settings]. +[discrete] +=== Using an Alternate YML File + +To run Kibana with an alternate yml file, use the `--config` option to specify the path to the desired yml file. For example: `yarn start --config=config/my_config.yml` + [discrete] === Potential Optimization Pitfalls From 75cfbbebafb46ee1d5f869b8636604a6ac80144a Mon Sep 17 00:00:00 2001 From: Robert Oskamp Date: Tue, 31 May 2022 14:44:57 +0200 Subject: [PATCH 2/4] [ML] Functional tests - fix advanced job wizard tests (#133172) (#133203) This PR fixes and re-enables the advanced job wizard functional tests. (cherry picked from commit ab4943e62c6b608786ca9c829917ff6e5ac24abb) # Conflicts: # x-pack/test/functional/apps/ml/anomaly_detection/advanced_job.ts --- .../apps/ml/anomaly_detection/advanced_job.ts | 47 ++++++++++--------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/x-pack/test/functional/apps/ml/anomaly_detection/advanced_job.ts b/x-pack/test/functional/apps/ml/anomaly_detection/advanced_job.ts index ca634d81f5c1c..5161b83db0ab1 100644 --- a/x-pack/test/functional/apps/ml/anomaly_detection/advanced_job.ts +++ b/x-pack/test/functional/apps/ml/anomaly_detection/advanced_job.ts @@ -151,19 +151,19 @@ export default function ({ getService }: FtrProviderContext) { }, { suiteTitle: 'with categorization detector and default datafeed settings', - jobSource: 'ft_ecommerce', - jobId: `ec_advanced_2_${Date.now()}`, + jobSource: 'ft_categorization_small', + jobId: `categorization_advanced_2_${Date.now()}`, get jobIdClone(): string { return `${this.jobId}_clone`; }, jobDescription: - 'Create advanced job from ft_ecommerce dataset with a categorization detector and default datafeed settings', - jobGroups: ['automated', 'ecommerce', 'advanced'], + 'Create advanced job from ft_categorization_small dataset with a categorization detector and default datafeed settings', + jobGroups: ['automated', 'categorization', 'advanced'], get jobGroupsClone(): string[] { return [...this.jobGroups, 'clone']; }, pickFieldsConfig: { - categorizationField: 'products.product_name', + categorizationField: 'field1', detectors: [ { identifier: 'count by mlcategory', @@ -178,30 +178,30 @@ export default function ({ getService }: FtrProviderContext) { datafeedConfig: {} as DatafeedConfig, expected: { wizard: { - timeField: 'order_date', + timeField: '@timestamp', }, row: { - recordCount: '4,675', + recordCount: '1,000', memoryStatus: 'ok', jobState: 'closed', datafeedState: 'stopped', - latestTimestamp: '2019-07-12 23:45:36', + latestTimestamp: '2019-11-21 00:01:13', }, counts: { - processed_record_count: '4,675', - processed_field_count: '4,675', - input_bytes: '354.2 KB', - input_field_count: '4,675', + processed_record_count: '1,000', + processed_field_count: '1,000', + input_bytes: '148.8 KB', + input_field_count: '1,000', invalid_date_count: '0', missing_field_count: '0', out_of_order_timestamp_count: '0', - empty_bucket_count: '0', + empty_bucket_count: '1,073', sparse_bucket_count: '0', - bucket_count: '185', - earliest_record_timestamp: '2019-06-12 00:04:19', - latest_record_timestamp: '2019-07-12 23:45:36', - input_record_count: '4,675', - latest_bucket_timestamp: '2019-07-12 20:00:00', + bucket_count: '1,378', + earliest_record_timestamp: '2019-04-05 11:25:35', + latest_record_timestamp: '2019-11-21 00:01:13', + input_record_count: '1,000', + latest_bucket_timestamp: '2019-11-21 00:00:00', }, modelSizeStats: { result_type: 'model_size_stats', @@ -211,7 +211,7 @@ export default function ({ getService }: FtrProviderContext) { total_partition_field_count: '2', bucket_allocation_failures_count: '0', memory_status: 'ok', - timestamp: '2019-07-12 16:00:00', + timestamp: '2019-11-20 20:00:00', }, }, }, @@ -219,12 +219,13 @@ export default function ({ getService }: FtrProviderContext) { const calendarId = `wizard-test-calendar_${Date.now()}`; - // Failing: See https://github.com/elastic/kibana/issues/133020 - describe.skip('advanced job', function () { + describe('advanced job', function () { this.tags(['mlqa']); before(async () => { await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/ecommerce'); + await esArchiver.loadIfNeeded('x-pack/test/functional/es_archives/ml/categorization_small'); await ml.testResources.createIndexPatternIfNeeded('ft_ecommerce', 'order_date'); + await ml.testResources.createIndexPatternIfNeeded('ft_categorization_small', '@timestamp'); await ml.testResources.setKibanaTimeZoneToUTC(); await ml.api.createCalendar(calendarId); @@ -234,6 +235,7 @@ export default function ({ getService }: FtrProviderContext) { after(async () => { await ml.api.cleanMlIndices(); await ml.testResources.deleteIndexPatternByTitle('ft_ecommerce'); + await ml.testResources.deleteIndexPatternByTitle('ft_categorization_small'); }); for (const testData of testDataList) { @@ -421,8 +423,7 @@ export default function ({ getService }: FtrProviderContext) { await ml.jobWizardCommon.advanceToSummarySection(); }); - // Failing ES Promotion: https://buildkite.com/elastic/kibana-elasticsearch-snapshot-verify/builds/1253 - it.skip('job creation runs the job and displays it correctly in the job list', async () => { + it('job creation runs the job and displays it correctly in the job list', async () => { await ml.testExecution.logTestStep( 'job creation creates the job and finishes processing' ); From e80cea3a3a812a970e06dfe731c73657c0ffcc94 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Wed, 1 Jun 2022 13:20:12 +0200 Subject: [PATCH 3/4] Bump d3-scale v1.0.7 to v2.2.2 (#104888) (#133282) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Felix Stürmer (cherry picked from commit bace3e44fa304cfb46b230c839384439d5773986) # Conflicts: # x-pack/plugins/ml/public/application/explorer/swimlane_annotation_container.tsx --- package.json | 4 +-- .../shared/charts/Timeline/timeline_axis.tsx | 4 +-- .../logging/log_minimap/density_chart.tsx | 8 +++--- .../logging/log_minimap/log_minimap.tsx | 2 +- .../logging/log_minimap/search_markers.tsx | 2 +- .../logging/log_minimap/time_ruler.tsx | 2 +- .../swimlane_annotation_container.tsx | 6 ++--- .../source_destination_arrows.tsx | 12 ++++----- yarn.lock | 26 ++++++++++++++----- 9 files changed, 39 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index e4d03c516769b..f46c993fb5d74 100644 --- a/package.json +++ b/package.json @@ -216,7 +216,7 @@ "d3-array": "1.2.4", "d3-cloud": "1.2.5", "d3-interpolate": "^3.0.1", - "d3-scale": "1.0.7", + "d3-scale": "^2.2.2", "d3-shape": "^1.1.0", "d3-time": "^1.1.0", "dedent": "^0.7.0", @@ -514,7 +514,7 @@ "@types/d3": "^3.5.43", "@types/d3-array": "^1.2.7", "@types/d3-interpolate": "^2.0.0", - "@types/d3-scale": "^2.1.1", + "@types/d3-scale": "^2.2.6", "@types/d3-shape": "^1.3.1", "@types/d3-time": "^1.0.10", "@types/d3-time-format": "^2.1.1", diff --git a/x-pack/plugins/apm/public/components/shared/charts/Timeline/timeline_axis.tsx b/x-pack/plugins/apm/public/components/shared/charts/Timeline/timeline_axis.tsx index cf942ebb75776..9baf2ca66cfa4 100644 --- a/x-pack/plugins/apm/public/components/shared/charts/Timeline/timeline_axis.tsx +++ b/x-pack/plugins/apm/public/components/shared/charts/Timeline/timeline_axis.tsx @@ -88,14 +88,14 @@ export function TimelineAxis({ {topTraceDuration > 0 && ( )} {marks.map((mark) => ( - + ))} diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/density_chart.tsx b/x-pack/plugins/infra/public/components/logging/log_minimap/density_chart.tsx index d85459d3dae8d..91c1582c4f663 100644 --- a/x-pack/plugins/infra/public/components/logging/log_minimap/density_chart.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_minimap/density_chart.tsx @@ -38,10 +38,10 @@ export const DensityChart: React.FC = ({ const xScale = scaleLinear().domain([0, xMax]).range([0, width]); const path = area() - .x0(xScale(0)) - .x1((bucket) => xScale(bucket.entriesCount)) - .y0((bucket) => yScale(bucket.start)) - .y1((bucket) => yScale(bucket.end)) + .x0(xScale(0) ?? 0) + .x1((bucket) => xScale(bucket.entriesCount) ?? 0) + .y0((bucket) => yScale(bucket.start) ?? 0) + .y1((bucket) => yScale(bucket.end) ?? 0) .curve(curveMonotoneY); const firstBucket = buckets[0]; diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/log_minimap.tsx b/x-pack/plugins/infra/public/components/logging/log_minimap/log_minimap.tsx index b0ee59d5d3bea..5c3c7a144bede 100644 --- a/x-pack/plugins/infra/public/components/logging/log_minimap/log_minimap.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_minimap/log_minimap.tsx @@ -78,7 +78,7 @@ export class LogMinimap extends React.Component { - return this.getYScale()(time); + return this.getYScale()(time) ?? 0; }; private updateTimeCursor: React.MouseEventHandler = (event) => { diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/search_markers.tsx b/x-pack/plugins/infra/public/components/logging/log_minimap/search_markers.tsx index 137f095b484c7..74a547c123a4a 100644 --- a/x-pack/plugins/infra/public/components/logging/log_minimap/search_markers.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_minimap/search_markers.tsx @@ -43,7 +43,7 @@ export class SearchMarkers extends React.PureComponent { > diff --git a/x-pack/plugins/infra/public/components/logging/log_minimap/time_ruler.tsx b/x-pack/plugins/infra/public/components/logging/log_minimap/time_ruler.tsx index 6588d87982cf4..3e6e5a2a06f99 100644 --- a/x-pack/plugins/infra/public/components/logging/log_minimap/time_ruler.tsx +++ b/x-pack/plugins/infra/public/components/logging/log_minimap/time_ruler.tsx @@ -28,7 +28,7 @@ export const TimeRuler: React.FC = ({ end, height, start, tickCo return ( {ticks.map((tick, tickIndex) => { - const y = yScale(tick); + const y = yScale(tick) ?? 0; return ( diff --git a/x-pack/plugins/ml/public/application/explorer/swimlane_annotation_container.tsx b/x-pack/plugins/ml/public/application/explorer/swimlane_annotation_container.tsx index 9838fb623db95..e6a8375a6ad83 100644 --- a/x-pack/plugins/ml/public/application/explorer/swimlane_annotation_container.tsx +++ b/x-pack/plugins/ml/public/application/explorer/swimlane_annotation_container.tsx @@ -87,13 +87,13 @@ export const SwimlaneAnnotationContainer: FC = annotationsData.forEach((d) => { const annotationWidth = Math.max( d.end_timestamp - ? xScale(Math.min(d.end_timestamp, domain.max)) - - Math.max(xScale(d.timestamp), startingXPos) + ? (xScale(Math.min(d.end_timestamp, domain.max)) as number) - + Math.max(xScale(d.timestamp) as number, startingXPos) : 0, ANNOTATION_MIN_WIDTH ); - const xPos = d.timestamp >= domain.min ? xScale(d.timestamp) : startingXPos; + const xPos = d.timestamp >= domain.min ? (xScale(d.timestamp) as number) : startingXPos; svg .append('rect') .classed('mlAnnotationRect', true) diff --git a/x-pack/plugins/security_solution/public/network/components/source_destination/source_destination_arrows.tsx b/x-pack/plugins/security_solution/public/network/components/source_destination/source_destination_arrows.tsx index 6858520340aae..deca4438ba93c 100644 --- a/x-pack/plugins/security_solution/public/network/components/source_destination/source_destination_arrows.tsx +++ b/x-pack/plugins/security_solution/public/network/components/source_destination/source_destination_arrows.tsx @@ -69,7 +69,7 @@ const SourceArrow = React.memo<{ return ( - + {sourceBytes != null && !isNaN(Number(sourceBytes)) ? ( @@ -95,7 +95,7 @@ const SourceArrow = React.memo<{ ) : null} - + {sourcePackets != null && !isNaN(Number(sourcePackets)) ? ( @@ -114,7 +114,7 @@ const SourceArrow = React.memo<{ ) : null} - + @@ -158,7 +158,7 @@ const DestinationArrow = React.memo<{ - + {destinationBytes != null && !isNaN(Number(destinationBytes)) ? ( @@ -184,7 +184,7 @@ const DestinationArrow = React.memo<{ ) : null} - + {destinationPackets != null && !isNaN(Number(destinationPackets)) ? ( @@ -205,7 +205,7 @@ const DestinationArrow = React.memo<{ ) : null} - + ); diff --git a/yarn.lock b/yarn.lock index dfd3a495af22d..56306c8c7d346 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5330,12 +5330,12 @@ resolved "https://registry.yarnpkg.com/@types/d3-path/-/d3-path-1.0.7.tgz#a0736fceed688a695f48265a82ff7a3369414b81" integrity sha512-U8dFRG+8WhkLJr2sxZ9Cw/5WeRgBnNqMxGdA1+Z0+ZG6tK0s75OQ4OXnxeyfKuh6E4wQPY8OAKr1+iNDx01BEQ== -"@types/d3-scale@^2.1.1": - version "2.1.1" - resolved "https://registry.yarnpkg.com/@types/d3-scale/-/d3-scale-2.1.1.tgz#405e58771ec6ae7b8f7b4178ee1887620759e8f7" - integrity sha512-kNTkbZQ+N/Ip8oX9PByXfDLoCSaZYm+VUOasbmsa6KD850/ziMdYepg/8kLg2plHzoLANdMqPoYQbvExevLUHg== +"@types/d3-scale@^2.2.6": + version "2.2.6" + resolved "https://registry.yarnpkg.com/@types/d3-scale/-/d3-scale-2.2.6.tgz#28540b4dfc99d978970e873e4138a6bea2ea6ab8" + integrity sha512-CHu34T5bGrJOeuhGxyiz9Xvaa9PlsIaQoOqjDg7zqeGj2x0rwPhGquiy03unigvcMxmvY0hEaAouT0LOFTLpIw== dependencies: - "@types/d3-time" "*" + "@types/d3-time" "^1" "@types/d3-shape@^1.3.1": version "1.3.1" @@ -5349,7 +5349,7 @@ resolved "https://registry.yarnpkg.com/@types/d3-time-format/-/d3-time-format-2.1.1.tgz#dd2c79ec4575f1355484ab6b10407824668eba42" integrity sha512-tJSyXta8ZyJ52wDDHA96JEsvkbL6jl7wowGmuf45+fAkj5Y+SQOnz0N7/H68OWmPshPsAaWMQh+GAws44IzH3g== -"@types/d3-time@*", "@types/d3-time@^1.0.10": +"@types/d3-time@^1", "@types/d3-time@^1.0.10": version "1.0.10" resolved "https://registry.yarnpkg.com/@types/d3-time/-/d3-time-1.0.10.tgz#d338c7feac93a98a32aac875d1100f92c7b61f4f" integrity sha512-aKf62rRQafDQmSiv1NylKhIMmznsjRN+MnXRXTqHoqm0U/UZzVpdrtRnSIfdiLS616OuC1soYeX1dBg2n1u8Xw== @@ -11274,7 +11274,7 @@ d3-sankey@^0.7.1: d3-collection "1" d3-shape "^1.2.0" -d3-scale@1.0.7, d3-scale@^1.0.5, d3-scale@^1.0.7: +d3-scale@^1.0.5, d3-scale@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-1.0.7.tgz#fa90324b3ea8a776422bd0472afab0b252a0945d" integrity sha512-KvU92czp2/qse5tUfGms6Kjig0AhHOwkzXG0+PqIJB3ke0WUv088AHMZI0OssO9NCkXt4RP8yju9rpH8aGB7Lw== @@ -11287,6 +11287,18 @@ d3-scale@1.0.7, d3-scale@^1.0.5, d3-scale@^1.0.7: d3-time "1" d3-time-format "2" +d3-scale@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-2.2.2.tgz#4e880e0b2745acaaddd3ede26a9e908a9e17b81f" + integrity sha512-LbeEvGgIb8UMcAa0EATLNX0lelKWGYDQiPdHj+gLblGVhGLyNbaCn3EvrJf0A3Y/uOOU5aD6MTh5ZFCdEwGiCw== + dependencies: + d3-array "^1.2.0" + d3-collection "1" + d3-format "1" + d3-interpolate "1" + d3-time "1" + d3-time-format "2" + d3-scale@^4.0.2: version "4.0.2" resolved "https://registry.yarnpkg.com/d3-scale/-/d3-scale-4.0.2.tgz#82b38e8e8ff7080764f8dcec77bd4be393689396" From 2eee19d2db0cf55a1f47b860e789b53915f47052 Mon Sep 17 00:00:00 2001 From: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Date: Wed, 1 Jun 2022 13:54:42 -0500 Subject: [PATCH 4/4] [artifact testing] Use local ansible provisioner (#133047) (#133329) We've seen a number of package testing timeouts where a random command will hang while establishing an ssh connection. Instead of running installation remotely, this switches to the ansible_local provisioner. (cherry picked from commit a6a66381b66f5e7afc75de68182c6e4ad16e2890) Co-authored-by: Jonathan Budzenski --- test/package/Vagrantfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/package/Vagrantfile b/test/package/Vagrantfile index 50d873b6efcb6..743feb3feaca7 100644 --- a/test/package/Vagrantfile +++ b/test/package/Vagrantfile @@ -3,7 +3,7 @@ Vagrant.configure("2") do |config| config.vm.boot_timeout = 600 config.vm.define "deb" do |deb| deb.vm.box = 'elastic/debian-9-x86_64' - deb.vm.provision "ansible" do |ansible| + deb.vm.provision "ansible_local" do |ansible| ansible.playbook = "deb.yml" end deb.vm.network "private_network", ip: "192.168.56.5" @@ -11,7 +11,7 @@ Vagrant.configure("2") do |config| config.vm.define "rpm" do |rpm| rpm.vm.box = 'elastic/centos-7-x86_64' - rpm.vm.provision "ansible" do |ansible| + rpm.vm.provision "ansible_local" do |ansible| ansible.playbook = "rpm.yml" end rpm.vm.network "private_network", ip: "192.168.56.6" @@ -19,7 +19,7 @@ Vagrant.configure("2") do |config| config.vm.define "docker" do |docker| docker.vm.box = 'elastic/ubuntu-18.04-x86_64' - docker.vm.provision "ansible" do |ansible| + docker.vm.provision "ansible_local" do |ansible| ansible.playbook = "docker.yml" end docker.vm.network "private_network", ip: "192.168.56.7"